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
-
In the Images dashboard, check the box of the image you want to share.
The image is selected. -
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
-
In the Images dashboard, check the box of the image you want to modify the privacy.
The image is selected. -
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" \
--Description "Private image" \
--PermissionsToLaunch '{
"Removals": {
"GlobalPermission": True
}
}'
This command contains the following attributes that you need to specify:
-
Description
: (optional) A new description for the image. -
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
: (optional) Information about the permissions for the resource.
Specify either theAdditions
or theRemovals
parameter.-
Additions
: (optional) Permissions for the resource.-
AccountIds
: (optional) One or more account IDs that the permission is associated with. -
GlobalPermission
: (optional) A global permission for all accounts.
(Request) Set this parameter to true to make the resource public (if the parent parameter isAdditions
) or to make the resource private (if the parent parameter isRemovals
).
(Response) If true, the resource is public. If false, the resource is private.
-
-
Removals
: (optional) Permissions for the resource.-
AccountIds
: (optional) One or more account IDs that the permission is associated with. -
GlobalPermission
: (optional) A global permission for all accounts.
(Request) Set this parameter to true to make the resource public (if the parent parameter isAdditions
) or to make the resource private (if the parent parameter isRemovals
).
(Response) If true, the resource is public. If false, the resource is private.
-
-
The UpdateImage command returns the following elements:
-
Image
: Information about the OMI.-
AccountAlias
: The account alias of the owner of the OMI. -
AccountId
: The account ID of the owner of the OMI. -
Architecture
: The architecture of the OMI. -
BlockDeviceMappings
: One or more block device mappings.-
Bsu
: Information about the BSU volume to create.-
DeleteOnVmDeletion
: By default or if set to true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM. -
Iops
: The number of I/O operations per second (IOPS). This parameter must be specified only if you create anio1
volume. The maximum number of IOPS allowed forio1
volumes is13000
with a maximum performance ratio of 300 IOPS per gibibyte. -
SnapshotId
: The ID of the snapshot used to create the volume. -
VolumeSize
: The size of the volume, in gibibytes (GiB).
If you specify a snapshot ID, the volume size must be at least equal to the snapshot size.
If you specify a snapshot ID but no volume size, the volume is created with a size similar to the snapshot one. -
VolumeType
: The type of the volume (standard
|io1
|gp2
). If not specified in the request, astandard
volume is created.
For more information about volume types, see About Volumes > Volume Types and IOPS.
-
-
DeviceName
: The device name for the volume. For a root device, you must use/dev/sda1
. For other volumes, you must use/dev/sdX
,/dev/sdXX
,/dev/xvdX
, or/dev/xvdXX
(where the firstX
is a letter betweenb
andz
, and the secondX
is a letter betweena
andz
). -
VirtualDeviceName
: The name of the virtual device (ephemeralN
).
-
-
CreationDate
: The date and time (UTC) at which the OMI was created. -
Description
: The description of the OMI. -
FileLocation
: The location from which the OMI files were created. -
ImageId
: The ID of the OMI. -
ImageName
: The name of the OMI. -
ImageType
: The type of the OMI. -
PermissionsToLaunch
: Permissions for the resource.-
AccountIds
: One or more account IDs that the permission is associated with. -
GlobalPermission
: A global permission for all accounts.
(Request) Set this parameter to true to make the resource public (if the parent parameter isAdditions
) or to make the resource private (if the parent parameter isRemovals
).
(Response) If true, the resource is public. If false, the resource is private.
-
-
ProductCodes
: The product codes associated with the OMI. -
RootDeviceName
: The name of the root device. -
RootDeviceType
: The type of root device used by the OMI (alwaysbsu
). -
State
: The state of the OMI (pending
|available
|failed
). -
StateComment
: Information about the change of state.-
StateCode
: The code of the change of state. -
StateMessage
: A message explaining the change of state.
-
-
Tags
: One or more tags associated with the OMI.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"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": "Private image",
"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 oapi-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.
$ oapi-cli --profile "default" UpdateImage \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Additions": {
"AccountIds": ["987654321098"]
}
}'
$ oapi-cli --profile "default" UpdateImage \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Removals": {
"AccountIds": ["987654321098"]
}
}'
$ oapi-cli --profile "default" UpdateImage \
--ImageId "ami-12345678" \
--PermissionsToLaunch '{
"Additions": {
"GlobalPermission": True
}
}'
$ oapi-cli --profile "default" UpdateImage \
--ImageId "ami-12345678" \
--Description "Private image" \
--PermissionsToLaunch '{
"Removals": {
"GlobalPermission": True
}
}'
This command contains the following attributes that you need to specify:
-
Description
: (optional) A new description for the image. -
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
: (optional) Information about the permissions for the resource.
Specify either theAdditions
or theRemovals
parameter.-
Additions
: (optional) Permissions for the resource.-
AccountIds
: (optional) One or more account IDs that the permission is associated with. -
GlobalPermission
: (optional) A global permission for all accounts.
(Request) Set this parameter to true to make the resource public (if the parent parameter isAdditions
) or to make the resource private (if the parent parameter isRemovals
).
(Response) If true, the resource is public. If false, the resource is private.
-
-
Removals
: (optional) Permissions for the resource.-
AccountIds
: (optional) One or more account IDs that the permission is associated with. -
GlobalPermission
: (optional) A global permission for all accounts.
(Request) Set this parameter to true to make the resource public (if the parent parameter isAdditions
) or to make the resource private (if the parent parameter isRemovals
).
(Response) If true, the resource is public. If false, the resource is private.
-
-
The UpdateImage command returns the following elements:
-
Image
: Information about the OMI.-
AccountAlias
: The account alias of the owner of the OMI. -
AccountId
: The account ID of the owner of the OMI. -
Architecture
: The architecture of the OMI. -
BlockDeviceMappings
: One or more block device mappings.-
Bsu
: Information about the BSU volume to create.-
DeleteOnVmDeletion
: By default or if set to true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM. -
Iops
: The number of I/O operations per second (IOPS). This parameter must be specified only if you create anio1
volume. The maximum number of IOPS allowed forio1
volumes is13000
with a maximum performance ratio of 300 IOPS per gibibyte. -
SnapshotId
: The ID of the snapshot used to create the volume. -
VolumeSize
: The size of the volume, in gibibytes (GiB).
If you specify a snapshot ID, the volume size must be at least equal to the snapshot size.
If you specify a snapshot ID but no volume size, the volume is created with a size similar to the snapshot one. -
VolumeType
: The type of the volume (standard
|io1
|gp2
). If not specified in the request, astandard
volume is created.
For more information about volume types, see About Volumes > Volume Types and IOPS.
-
-
DeviceName
: The device name for the volume. For a root device, you must use/dev/sda1
. For other volumes, you must use/dev/sdX
,/dev/sdXX
,/dev/xvdX
, or/dev/xvdXX
(where the firstX
is a letter betweenb
andz
, and the secondX
is a letter betweena
andz
). -
VirtualDeviceName
: The name of the virtual device (ephemeralN
).
-
-
CreationDate
: The date and time (UTC) at which the OMI was created. -
Description
: The description of the OMI. -
FileLocation
: The location from which the OMI files were created. -
ImageId
: The ID of the OMI. -
ImageName
: The name of the OMI. -
ImageType
: The type of the OMI. -
PermissionsToLaunch
: Permissions for the resource.-
AccountIds
: One or more account IDs that the permission is associated with. -
GlobalPermission
: A global permission for all accounts.
(Request) Set this parameter to true to make the resource public (if the parent parameter isAdditions
) or to make the resource private (if the parent parameter isRemovals
).
(Response) If true, the resource is public. If false, the resource is private.
-
-
ProductCodes
: The product codes associated with the OMI. -
RootDeviceName
: The name of the root device. -
RootDeviceType
: The type of root device used by the OMI (alwaysbsu
). -
State
: The state of the OMI (pending
|available
|failed
). -
StateComment
: Information about the change of state.-
StateCode
: The code of the change of state. -
StateMessage
: A message explaining the change of state.
-
-
Tags
: One or more tags associated with the OMI.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"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": "Private image",
"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
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring 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. For more information, see Installing and Configuring AWS CLI.
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.