Obtenir des informations sur vos OMI

Avec AWS CLI, vous pouvez obtenir des informations sur les OMI que vous pouvez utiliser pour lancer des machines virtuelles (VM) :

  • Les OMI que vous avez créées.

  • Les OMI que les autres comptes ont partagées avec vous.

Obtenir des informations sur vos OMI avec Cockpit v2

Voir le dashboard Images.

Obtenir des informations sur vos OMI avec OSC CLI

À ce jour, cette section est disponible en anglais uniquement.

The ReadImages command lists one or more OUTSCALE machine images (OMIs) you can use.

Request sample: Reading a specific image
$ osc-cli api ReadImages --profile "default" \
    --Filters '{
        "ImageIds": ["ami-12345678"]
      }'
Request sample: Reading Ubuntu and RockyLinux images created by Outscale
$ osc-cli api ReadImages --profile "default" \
    --Filters '{
        "AccountAliases": ["Outscale"],
        "ImageNames": ["Ubuntu*", "RockyLinux*"]
      }'

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.

  • Filters: (optional) One or more filters.

    • AccountAliases: (optional) The account aliases of the owners of the OMIs.

    • AccountIds: (optional) The account IDs of the owners of the OMIs. By default, all the OMIs for which you have launch permissions are described.

    • Architectures: (optional) The architectures of the OMIs (i386 | x86_64).

    • BlockDeviceMappingDeleteOnVmDeletion: (optional) Whether the volumes are deleted or not when terminating the VM.

    • BlockDeviceMappingDeviceNames: (optional) The device names for the volumes.

    • BlockDeviceMappingSnapshotIds: (optional) The IDs of the snapshots used to create the volumes.

    • BlockDeviceMappingVolumeSizes: (optional) The sizes of the volumes, in gibibytes (GiB).

    • BlockDeviceMappingVolumeTypes: (optional) The types of volumes (standard | gp2 | io1).

    • Descriptions: (optional) The descriptions of the OMIs, provided when they were created.

    • FileLocations: (optional) The locations of the buckets where the OMI files are stored.

    • Hypervisors: (optional) The hypervisor type of the OMI (always xen).

    • ImageIds: (optional) The IDs of the OMIs.

    • ImageNames: (optional) The names of the OMIs, provided when they were created.

    • PermissionsToLaunchAccountIds: (optional) The account IDs which have launch permissions for the OMIs.

    • PermissionsToLaunchGlobalPermission: (optional) If true, lists all public OMIs. If false, lists all private OMIs.

    • ProductCodeNames: (optional) The names of the product codes associated with the OMI.

    • ProductCodes: (optional) The product codes associated with the OMI.

    • RootDeviceNames: (optional) The name of the root device. This value must be /dev/sda1.

    • RootDeviceTypes: (optional) The types of root device used by the OMIs (bsu or ebs).

    • States: (optional) The states of the OMIs (pending | available | failed).

    • TagKeys: (optional) The keys of the tags associated with the OMIs.

    • TagValues: (optional) The values of the tags associated with the OMIs.

    • Tags: (optional) The key/value combination of the tags associated with the OMIs, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

    • VirtualizationTypes: (optional) The virtualization types (always hvm).

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadImages command returns the following elements:

  • Images: Information about one or more OMIs.

    • 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 an io1 volume. The maximum number of IOPS allowed for io1 volumes is 13000 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, a standard 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 first X is a letter between b and z, and the second X is a letter between a and z).

      • 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 is Additions) or to make the resource private (if the parent parameter is Removals).
        (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 (always bsu).

    • 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.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample: Reading a specific image
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "Images": [
    {
      "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/create-image-example",
      "Architecture": "x86_64",
      "ImageName": "create-image-example"
    }
  ]
}
Result sample: Reading Ubuntu and RockyLinux images created by Outscale
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "Images": [
    {
      "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": 10,
            "SnapshotId": "snap-12345678"
          }
        }
      ],
      "ImageType": "machine",
      "AccountAlias": "Outscale",
      "CreationDate": "2010-10-01T12:34:56.789Z",
      "FileLocation": "Outscale/Ubuntu-2010.10.01-0",
      "Architecture": "x86_64",
      "ImageName": "Ubuntu-2010.10.01-0"
    },
    {
      "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": 10,
            "SnapshotId": "snap-12345678"
          }
        }
      ],
      "ImageType": "machine",
      "AccountAlias": "Outscale",
      "CreationDate": "2010-10-01T12:34:56.789Z",
      "FileLocation": "Outscale/RockyLinux-2010.10.01-0",
      "Architecture": "x86_64",
      "ImageName": "RockyLinux-2010.10.01-0"
    }
  ]
}

Obtenir des informations sur vos OMI avec oapi-cli

À ce jour, cette section est disponible en anglais uniquement.

The ReadImages command lists one or more OUTSCALE machine images (OMIs) you can use.

Request sample: Reading a specific image
$ oapi-cli --profile "default" ReadImages \
    --Filters '{
        "ImageIds": ["ami-12345678"]
      }'
Request sample: Reading Ubuntu and RockyLinux images created by Outscale
$ oapi-cli --profile "default" ReadImages \
    --Filters '{
        "AccountAliases": ["Outscale"],
        "ImageNames": ["Ubuntu*", "RockyLinux*"]
      }'

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.

  • Filters: (optional) One or more filters.

    • AccountAliases: (optional) The account aliases of the owners of the OMIs.

    • AccountIds: (optional) The account IDs of the owners of the OMIs. By default, all the OMIs for which you have launch permissions are described.

    • Architectures: (optional) The architectures of the OMIs (i386 | x86_64).

    • BlockDeviceMappingDeleteOnVmDeletion: (optional) Whether the volumes are deleted or not when terminating the VM.

    • BlockDeviceMappingDeviceNames: (optional) The device names for the volumes.

    • BlockDeviceMappingSnapshotIds: (optional) The IDs of the snapshots used to create the volumes.

    • BlockDeviceMappingVolumeSizes: (optional) The sizes of the volumes, in gibibytes (GiB).

    • BlockDeviceMappingVolumeTypes: (optional) The types of volumes (standard | gp2 | io1).

    • Descriptions: (optional) The descriptions of the OMIs, provided when they were created.

    • FileLocations: (optional) The locations of the buckets where the OMI files are stored.

    • Hypervisors: (optional) The hypervisor type of the OMI (always xen).

    • ImageIds: (optional) The IDs of the OMIs.

    • ImageNames: (optional) The names of the OMIs, provided when they were created.

    • PermissionsToLaunchAccountIds: (optional) The account IDs which have launch permissions for the OMIs.

    • PermissionsToLaunchGlobalPermission: (optional) If true, lists all public OMIs. If false, lists all private OMIs.

    • ProductCodeNames: (optional) The names of the product codes associated with the OMI.

    • ProductCodes: (optional) The product codes associated with the OMI.

    • RootDeviceNames: (optional) The name of the root device. This value must be /dev/sda1.

    • RootDeviceTypes: (optional) The types of root device used by the OMIs (bsu or ebs).

    • States: (optional) The states of the OMIs (pending | available | failed).

    • TagKeys: (optional) The keys of the tags associated with the OMIs.

    • TagValues: (optional) The values of the tags associated with the OMIs.

    • Tags: (optional) The key/value combination of the tags associated with the OMIs, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

    • VirtualizationTypes: (optional) The virtualization types (always hvm).

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadImages command returns the following elements:

  • Images: Information about one or more OMIs.

    • 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 an io1 volume. The maximum number of IOPS allowed for io1 volumes is 13000 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, a standard 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 first X is a letter between b and z, and the second X is a letter between a and z).

      • 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 is Additions) or to make the resource private (if the parent parameter is Removals).
        (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 (always bsu).

    • 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.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample: Reading a specific image
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "Images": [
    {
      "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/create-image-example",
      "Architecture": "x86_64",
      "ImageName": "create-image-example"
    }
  ]
}
Result sample: Reading Ubuntu and RockyLinux images created by Outscale
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "Images": [
    {
      "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": 10,
            "SnapshotId": "snap-12345678"
          }
        }
      ],
      "ImageType": "machine",
      "AccountAlias": "Outscale",
      "CreationDate": "2010-10-01T12:34:56.789Z",
      "FileLocation": "Outscale/Ubuntu-2010.10.01-0",
      "Architecture": "x86_64",
      "ImageName": "Ubuntu-2010.10.01-0"
    },
    {
      "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": 10,
            "SnapshotId": "snap-12345678"
          }
        }
      ],
      "ImageType": "machine",
      "AccountAlias": "Outscale",
      "CreationDate": "2010-10-01T12:34:56.789Z",
      "FileLocation": "Outscale/RockyLinux-2010.10.01-0",
      "Architecture": "x86_64",
      "ImageName": "RockyLinux-2010.10.01-0"
    }
  ]
}

Obtenir des informations sur vos OMI avec AWS CLI

Avant de commencer : Installez et configurez AWS CLI. Pour en savoir plus, voir Installer et configurer AWS CLI.

Obtenir des informations générales sur vos OMI

Pour obtenir des informations générales sur une ou plusieurs OMI, utilisez la commande describe-images en suivant cette syntaxe :

Exemple de requête
$ aws ec2 describe-images \
    --profile YOUR_PROFILE \
    --image-ids ami-12345678 ami-87654321 ami-56781234 \
    --owners 1234567890000 \
    --executable-users 0000987654321 \
    --filters Name=X,Values=Y \
    --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-ids : Un ou plusieurs ID d’OMI.

    Si vous ne spécifiez aucun ID d’OMI, toutes vos OMI ou toutes vos OMI en accord avec les filtres spécifiés (s’il y en a) sont décrites.

  • (optionnel) owners : L’ID de compte d’un ou plusieurs propriétaires d’OMI. Par défaut, toutes les OMI pour lesquelles vous avez une autorisation d’utilisation sont décrites.

  • (optionnel) executable-users : Les ID de comptes autorisés à utiliser les OMI.

  • (optionnel) filters : Un ou plusieurs filtres, au format "Name=X,Values=Y".

    Vous pouvez spécifier plusieurs valeurs pour un même filtre en utilisant le format "Name=X,Values=Y, Z".

    Les filtres suivants sont disponibles :

    • architecture : L’architecture de l’OMI (i386 ou x86_64).

    • block-device-mapping.delete-on-termination : Indique si le volume BSU est supprimé quand l’instance est terminée.

    • block-device-mapping.device-name : Le nom du périphérique pour le volume BSU (au format /dev/sdX, /dev/sdXX, /dev/xvdX, ou /dev/xvdXX).

    • block-device-mapping.snapshot-id : L’ID du snapshot utilisé pour créer le volume.

    • block-device-mapping.volume-size : La taille du volume, en gibioctets (Gio).

    • block-device-mapping.volume-type : Le type de volume (standard | gp2 | io1).

    • description : La description de l’OMI, fournie lors de sa création.

    • hypervisor : Le type d’hyperviseur de l’instance (toujours xen).

    • image-id : L’ID de l’OMI.

    • image-type : Le type d’OMI (toujours machine pour les OMI officielles).

    • is-public : Indique si l’OMI est publique.

    • manifest-location : L’emplacement du manifeste OMI.

    • name : Le nom de l’OMI, fourni lors de sa création.

    • owner-alias : L’alias du compte du propriétaire de l’OMI.

    • owner-id : L’ID de compte du propriétaire de l’OMI.

    • platform : La plateforme.

    • product-code.type : Le type de code produit associé à l’OMI.

      Une fois associé à une OMI, un code produit ne peut pas être enlevé.

    • root-device-name : Le nom du périphérique pour le volume système (par exemple, /dev/sda1).

    • root-device-type : Le type de volume système utilisé par l’OMI (toujours ebs).

    • state : L’état actuel de l’OMI (pending | available | failed).

    • tag:key=value : La combinaison clé/valeur d’un tag associé à la ressource, au format suivant : Filter=[{'Name':'tag:tag_key','Value':'tag_value'}].

    • tag-key : La clé d’un tag associé à la ressource. Vous pouvez utiliser ce filtre avec le filtre tag-value. Dans ce cas, vous filtrez les ressources correspondant à chaque tag, indépendamment de l’autre filtre.

    • tag-value : La valeur d’un tag associé à la ressource. Vous pouvez utiliser ce filtre avec le filtre tag-key. Dans ce cas, vous filtrez les ressources correspondant à chaque tag, indépendamment de l’autre filtre.

    • tag-key : La clé d’un tag associé à la ressource.

    • tag-value : La valeur d’un tag associé à la ressource.

    • tag:XXXX : La valeur d’un tag associé à la ressource, où XXXX est la clé du tag.

      Pour filtrer un tag dont la clé est XXXX et la valeur est YYYY, vous pouvez donc utiliser un des deux formats suivants :

      • --filters Name=tag-key,Values=XXXX Name=tag-value,Values=YYYY

      • --filters Name=tag:XXXX,Values=YYYY

    • virtualization-type : Le type de virtualisation de l’instance (toujours hvm).

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.

La commande describe-images renvoie les éléments suivants :

  • Images : Informations à propos d’une ou plusieurs OMI. Cet élément contient les informations suivantes :

    • VirtualizationType : Le type de virtualisation de l’instance (toujours hvm).

    • Name : Le nom de l’OMI.

    • Hypervisor : Le type d’hyperviseur de l’instance (toujours xen).

    • ImageId : L’ID de l’OMI.

    • Platform : Pas d’information renvoyée.

    • State : L’état actuel de l’OMI.

    • BlockDeviceMappings : Un ou plusieurs block device mappings. Pour en savoir plus, voir Définir des block device mappings.

    • Architecture : L’architecture de l’OMI.

    • ImageLocation : Le chemin de l’OMI.

    • RootDeviceType : Le type de volume système (toujours ebs).

    • OwnerId : L’ID de compte du propriétaire de l’OMI.

    • RootDeviceName : Le nom du périphérique pour le volume système de l’instance.

    • Public : Indique si l’OMI est publique.

    • ImageType : Le type d’OMI (toujours machine pour les OMI officielles).

    • Description : La description de l’OMI, s’il y en a une.

Exemple de résultat
{
    "Images": [
        {
            "VirtualizationType": "hvm",
            "Name": "Image_name",
            "Hypervisor": "xen",
            "ImageId": "ami-12345678",
            "Platform": "",
            "State": "available",
            "BlockDeviceMappings": [
                {
                    "DeviceName": "/dev/sda1",
                    "Ebs": {
                        "DeleteOnTermination": true,
                        "SnapshotId": "snap-87654321",
                        "VolumeSize": 8,
                        "VolumeType": "standard"
                    }
                }
            ],
            "Architecture": "x86_64",
            "ImageLocation": "1234567890000/Image_name",
            "RootDeviceType": "ebs",
            "OwnerId": "1234567890000",
            "RootDeviceName": "/dev/sda1",
            "Public": false,
            "ImageType": "machine",
            "Description": "CentOS 7 with HAProxy installed and NAT configured"
        }]
}

Obtenir des informations sur un attribut d’une OMI

Vous pouvez obtenir des informations sur la liste des comptes qui ont les permissions pour créer une instance à partir de l’OMI spécifiée. Vous pouvez modifier ces permissions à tout moment. Pour en savoir plus, voir Modifier les attributs d’une OMI.

Pour obtenir des informations sur les comptes qui ont les permissions d’utiliser une OMI depuis Cockpit, vous devez utiliser la commande Autorisations. Pour en savoir plus, voir Modifier les attributs d’une OMI.

Pour obtenir des informations sur un attribut d’une OMI, utilisez la commande describe-image-attribute en suivant cette syntaxe :

Exemple de requête
$ aws ec2 describe-image-attribute \
    --profile YOUR_PROFILE \
    --image-id ami-12345678 \
    --attribute launchPermission \
    --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.

  • attribute : L’attribut de l’OMI (description | kernel | launchPermission | productCodes).

  • endpoint : Le endpoint correspondant à la Région à laquelle vous voulez envoyer la requête. Pour en savoir plus, voir Installer et configurer AWS CLI.

La commande describe-images renvoie les éléments suivants :

  • La valeur de l’attribut (ici, LaunchPermission).

  • ImageId : L’ID de l’OMI.

Exemple de résultat
{
    "LaunchPermissions": [
        {
            "UserId": "12345679890000"
        },
        {
            "UserId": "0000987654321"
        }
    ],
    "ImageId": "ami-123456789"
}

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.