Modifying the Attributes of an OMI
You can modify the attributes of an OUTSCALE machine image (OMI), such as its description, permissions, or privacy.
You can also share a private OMI that you created, or that you copied, with one or more accounts within the same Region. Sharing an OMI with other accounts means that they can access this OMI and create similar virtual machines (VMs) from it. You can copy an OMI that another account has shared with you, provided both accounts are in the same Region. You can also share a copy you created from a shared OMI with other accounts. For more information, see Copying an OMI.
You can manage who can access an OMI by adding or removing permissions. To get information about accounts which have permission for an OMI, see Getting Information About Your OMIs > Getting Information About an Attribute of an OMI.
Modifying the Attributes of an Image Using Cockpit v2
Updating Permissions for an Image
-
Click inside the Images dashboard to make checkboxes appear.
-
Check the box of the image you want to share.
The image is selected and an action menu appears. -
Click Update Permissions.
The UPDATE IMAGE PERMISSIONS dialog box appears.A list of the account IDs of the users that are allowed to use the image is displayed, if any.
-
To share the image with one or more users, click Add and type their account IDs separated by a comma in the Account ID field.
To remove the permissions for a user, click next to its account ID.
-
Click Update.
The image is shared with the users you specified.
Updating Privacy for an Image
-
Click inside the Images dashboard to make checkboxes appear.
-
Check the box of the image you want to modify the privacy.
The image is selected and an action menu appears. -
Click Update Privacy.
The UPDATE IMAGE PRIVACY dialog box appears. -
If you want your image to be public, switch on Public Cloud.
-
If you want to keep your image private, leave the Public Cloud switch off.
-
Click Update.
The image privacy is updated.
Modifying the Attributes of an OMI Using OSC CLI
The UpdateImage command modifies the access permissions for an OUTSCALE machine image (OMI).
You must specify either the Additions
or the Removals
parameter.
After sharing an OMI with an account, the other account can create a copy of it that they own. For more information about copying OMIs, see CreateImage.
$ osc-cli api UpdateImage --profile "default" \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Additions": {
"AccountIds": ["987654321098"],
},
}'
$ osc-cli api UpdateImage --profile "default" \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Removals": {
"AccountIds": ["987654321098"],
},
}'
$ osc-cli api UpdateImage --profile "default" \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Additions": {
"GlobalPermission": True,
},
}'
$ osc-cli api UpdateImage --profile "default" \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Removals": {
"GlobalPermission": True,
},
}'
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
ImageId
: The ID of the OMI you want to modify. -
PermissionsToLaunch
: Information about the permissions for the resource.
Specify either theAdditions
or theRemovals
parameter.
The UpdateImage command returns the following elements:
-
Image
: Information about the OMI. -
ResponseContext
: Information about the context of the response.
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Image": {
"StateComment": {},
"State": "available",
"RootDeviceType": "bsu",
"RootDeviceName": "/dev/sda1",
"ProductCodes": [
"0001"
],
"PermissionsToLaunch": {
"GlobalPermission": false,
"AccountIds": [
"987654321098"
]
},
"AccountId": "123456789012",
"Tags": [],
"Description": "",
"ImageId": "ami-12345678",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Bsu": {
"VolumeType": "standard",
"DeleteOnVmDeletion": true,
"VolumeSize": 50,
"SnapshotId": "snap-12345678"
}
}
],
"ImageType": "machine",
"CreationDate": "2010-10-01T12:34:56.789Z",
"FileLocation": "123456789012/image-example",
"Architecture": "x86_64",
"ImageName": "image-example"
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Image": {
"StateComment": {},
"State": "available",
"RootDeviceType": "bsu",
"RootDeviceName": "/dev/sda1",
"ProductCodes": [
"0001"
],
"PermissionsToLaunch": {
"GlobalPermission": false,
"AccountIds": []
},
"AccountId": "123456789012",
"Tags": [],
"Description": "",
"ImageId": "ami-12345678",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Bsu": {
"VolumeType": "standard",
"DeleteOnVmDeletion": true,
"VolumeSize": 50,
"SnapshotId": "snap-12345678"
}
}
],
"ImageType": "machine",
"CreationDate": "2010-10-01T12:34:56.789Z",
"FileLocation": "123456789012/image-example",
"Architecture": "x86_64",
"ImageName": "image-example"
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Image": {
"StateComment": {},
"State": "available",
"RootDeviceType": "bsu",
"RootDeviceName": "/dev/sda1",
"ProductCodes": [
"0001"
],
"PermissionsToLaunch": {
"GlobalPermission": true,
"AccountIds": []
},
"AccountId": "123456789012",
"Tags": [],
"Description": "",
"ImageId": "ami-12345678",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Bsu": {
"VolumeType": "standard",
"DeleteOnVmDeletion": true,
"VolumeSize": 50,
"SnapshotId": "snap-12345678"
}
}
],
"ImageType": "machine",
"CreationDate": "2010-10-01T12:34:56.789Z",
"FileLocation": "123456789012/image-example",
"Architecture": "x86_64",
"ImageName": "image-example"
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Image": {
"StateComment": {},
"State": "available",
"RootDeviceType": "bsu",
"RootDeviceName": "/dev/sda1",
"ProductCodes": [
"0001"
],
"PermissionsToLaunch": {
"GlobalPermission": false,
"AccountIds": []
},
"AccountId": "123456789012",
"Tags": [],
"Description": "",
"ImageId": "ami-12345678",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Bsu": {
"VolumeType": "standard",
"DeleteOnVmDeletion": true,
"VolumeSize": 50,
"SnapshotId": "snap-12345678"
}
}
],
"ImageType": "machine",
"CreationDate": "2010-10-01T12:34:56.789Z",
"FileLocation": "123456789012/image-example",
"Architecture": "x86_64",
"ImageName": "image-example"
}
}
Modifying the Attributes of an OMI Using AWS CLI
To modify the attributes of an OMI and add or remove permissions, use the modify-image-attribute command following this syntax:
$ aws ec2 modify-image-attribute \
--profile YOUR_PROFILE \
--description NOT_SPECIFIED \
--image-id ami-12345678 \
--launch-permission "{\"Add\":[{\"UserId\":\"123456789000\"},{\"UserId\":\"123456789001\"}]}" \
--endpoint https://fcu.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
image-id
: The ID of the OMI. -
(optional)
description
: The new description of the OMI. -
(optional)
launch-permissions
: One or more permissions to access and use the OMI. This attribute requires at least one of the following elements:-
Add
: One or more permissions to add. To add permissions for one or more accounts, use theUserId
element. -
Remove
: One or more permissions to remove. To remove permissions from one or more accounts, use theUserId
element.You cannot modify both the
description
and thelaunch-permissions
attributes in the same command.
-
-
endpoint
: The endpoint corresponding to the Region you want to send the request to.
The attributes of the OMI are modified.
Related Pages
Corresponding API Methods
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.