Modifier les attributs d’une OMI
Vous pouvez modifier les attributs d’une image machine OUTSCALE (OMI), tels que sa description, ses permissions ou sa confidentialité.
Vous pouvez également partager une OUTSCALE machine image (OMI) privée que vous avez créée, ou que vous avez copiée, avec un ou plusieurs comptes dans la même Région.
Partager une OMI avec d’autres comptes leur permet d’accéder à cette OMI et de créer d’autres machines virtuelles (VM) similaires à partir de celle-ci. Vous pouvez copier une OMI qu’un autre compte a partagé avec vous, à condition que les deux comptes soient dans la même Région. Vous pouvez également partager une copie que vous avez créée depuis une OMI partagée avec d’autres comptes. Pour en savoir plus, voir Copier une OMI.
Vous pouvez gérer qui peut accéder à une OMI en ajoutant ou en rentirant des permissions. Pour obtenir des informations sur les comptes qui ont les permissions pour une OMI, voir Obtenir des informations sur vos OMI > Obtenir des informations sur un attribut d’une OMI.
Modifier les attributs d’une image avec Cockpit v2
Modifier les permissions d’une image
-
Dans le dashboard Images, cochez la case de l’image que vous voulez partager.
L’image est sélectionnée. -
Cliquez sur Modifier les permissions.
La boîte de dialogue MODIFIER LES PERMISSIONS D’UNE IMAGE apparaît.Une liste des ID de comptes des utilisateurs autorisés à utiliser l’image apparaît, le cas échéant.
-
Pour partager l’image sélectionnée avec un ou plusieurs utilisateurs, cliquez sur Ajouter et tapez leurs IDs séparés par une virgule dans le champ Account ID.
Pour retirer les permissions à un utilisateur, cliquez sur à côté de son ID.
-
Cliquez sur Modifier.
L’image est partagée avec les utilisateurs que vous avez spécifiés.
Modifier la confidentialité d’une image
-
Dans le dashboard Images, cochez la case de l’image dont vous voulez modifier la confidentialité.
L’image est sélectionnée. -
Cliquez sur Modifier la confidentialité.
La boîte de dialogue MODIFIER LA CONFIDENTIALITÉ D’UNE IMAGE apparaît. -
Si vous voulez rendre votre image publique, activez Cloud public.
-
Si vous voulez que votre image reste privée, laissez Cloud public désactivé.
-
Cliquez sur Modifier.
La confidentialité de l’image est modifiée.
Modifier les attributs d’une OMI avec OSC CLI
À ce jour, cette section est disponible en anglais uniquement. |
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"
}
}
Modifier les attributs d’une OMI avec oapi-cli
À ce jour, cette section est disponible en anglais uniquement. |
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"
}
}
Modifier les attributs d’une OMI avec AWS CLI
Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI. |
-
Pour modifier les attributs d’une OMI et ajouter ou retirer des permissions, utilisez la commande modify-image-attribute en suivant cette syntaxe :
$ aws ec2 modify-image-attribute \
--profile YOUR_PROFILE \
--description NOT_SPECIFIED \
--image-id ami-12345678 \
--launch-permission "{\"Add\":[{\"UserId\":\"123456789000\"}]}" \
--endpoint https://fcu.eu-west-2.outscale.com
Cette commande contient les attributs suivants que vous devez spécifier :
-
(optionnel)
profile
: Le profil nommé que vous voulez utiliser, créé pendant la configuration d’AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI. -
image-id
: L’ID de l’OMI. -
(optionnel)
description
: La nouvelle description de l’OMI. -
(optionnel)
launch-permissions
: Une ou plusieurs permissions d’accéder et d’utiliser l’OMI. Cet attribut requiert au moins un des deux éléments suivants :-
Add
: Une ou plusieurs permissions à ajouter. Pour ajouter une permission pour un compte, utilisez l’élémentUserId
. -
Remove
: Une ou plusieurs permissions à retirer. Pour retirer une permission à un compte, utilisez l’élémentUserId
.Vous ne pouvez pas modifier les attributs
description
etlaunch-permissions
dans la même commande.
-
-
endpoint
: Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.
Les attributs de l’OMI sont modifiés.
Pages connexes
Méthodes API correspondantes
AWS™ et Amazon Web Services™ sont des marques de commerce d'Amazon Technologies, Inc. ou de ses affiliées aux États-Unis et/ou dans les autres pays.