Getting Information About Your OMIs

Using AWS CLI, you can get information about the OMIs you can use to launch virtual machines (VMs):

  • OMIs that you have created.

  • OMIs that other accounts have shared with you.

Getting Information About Your OMIs Using Cockpit v2

See the Images dashboard.

Getting Information About Your OMIs Using OSC CLI

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.

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

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

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"
    }
  ]
}

Getting Information About Your OMIs Using AWS CLI

Getting General Information About Your OMIs

To get information about one or more OMIs, use the describe-images command following this syntax:

Request sample
$ aws ec2 describe-images \
    --profile YOUR_PROFILE \
    --image-ids ami-12345678 ami-87654321 ami-56781234 \
    --owners 1234567890000 \
    --executable-users 0000987654321 \
    [--filters NOT_SPECIFIED] \
    --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.

  • (optional) image-ids: One or more OMI IDs.

    If you do not specify any OMI ID, all your OMIs or all the OMIs matching the specified filters if any are described.

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

  • (optional) executable-users: The account IDs allowed to use the OMIs.

  • (optional) filters: One or more filters, in the "Name=X,Values=Y" format.

    You can specify several values for a same filter using the "Name=X,Values=Y, Z" format.

    The following filters are available:

    • architecture: The architecture of the OMI (i386 or x86_64).

    • block-device-mapping.delete-on-termination: Indicates whether the volume is deleted when terminating the instance.

    • block-device-mapping.device-name: The device name assigned to the volume (in the format /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX).

    • block-device-mapping.snapshot-id: The ID of the snapshot used to create the volume.

    • block-device-mapping.volume-size: The size of the volume, in gibibytes (GiB).

    • block-device-mapping.volume-type: The type of volume (standard | gp2 | io1).

    • description: The description of the OMI, provided when it was created.

    • hypervisor: The hypervisor type of the instance (always xen).

    • image-id: The ID of the OMI.

    • image-type: The type of OMI (always machine for official OMIs).

    • is-public: Indicates whether the OMI has public launch permissions.

    • manifest-location: The location of the OMI manifest.

    • name: The name of the OMI, provided when it was created.

    • owner-alias: The account alias of the owner of the OMI.

    • owner-id: The account ID of the owner of the OMI.

    • platform: The platform.

    • product-code.type: The type of the product code associated with the OMI.

      Once a product code is applied to an OMI, it cannot be removed.

    • root-device-name: The device name assigned to the root device (for example, /dev/sda1).

    • root-device-type: The type of root device used by the OMI (always ebs).

    • state: The current state of the OMI (pending | available | failed).

    • tag-key: The key of a tag associated with the resource.

    • tag-value: The value of a tag associated with the resource.

    • tag:XXXX: The value of a tag associated with the resource, where XXXX is the key of the tag.

      To filter a tag whose key is XXXX and value is YYYY, you can therefore use either of the following two formats:

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

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

    • virtualization-type: The virtualization type of the instance (always hvm).

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-images command returns the following elements:

  • Images: Information about one or more OMIs. This element contains the following information:

    • VirtualizationType: The virtualization type of the instance (always hvm).

    • Name: The name of the OMI.

    • Hypervisor: The hypervisor type of the instance (always xen).

    • ImageId: The ID of the OMI.

    • Platform: No information returned.

    • State: The current state of the OMI.

    • BlockDeviceMappings: One or more block device mappings. For more information, see Defining Block Device Mappings.

    • Architecture: The architecture of the OMI.

    • ImageLocation: The path to the OMI.

    • RootDeviceType: The type of root device for the instance (always ebs).

    • OwnerId: The account ID of the owner of the OMI.

    • RootDeviceName: The device name assigned to the root device of the instance.

    • Public: Indicates whether the OMI has public creation permissions.

    • ImageType: The type of OMI (always machine for official OMIs).

    • Description: The description of the OMI, if any.

Result sample
{
    "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"
        }]
}

Getting Information About an Attribute of an OMI

You can get information about the list of accounts who have permissions to create an instance from the specified OMI. You can modify these permissions at any time. For more information, see Modifying the Attributes of an OMI.

To get information about the accounts who have permissions to use an OMI from Cockpit, you need to use the Share OMI command. For more information, see Modifying the Attributes of an OMI.

To get general information about an attribute of a specified OMI, use the describe-image-attribute command following this syntax:

Request sample
$ aws ec2 describe-image-attribute \
    --profile YOUR_PROFILE \
    --image-id ami-12345678 \
    --attribute launchPermission \
    --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.

  • attribute: The OMI attribute (description | kernel | launchPermission | productCodes).

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The describe-images command returns the following elements:

  • The attribute value (here, LaunchPermission).

  • ImageId: The ID of the OMI.

Result sample
{
    "LaunchPermissions": [
        {
            "UserId": "12345679890000"
        },
        {
            "UserId": "0000987654321"
        }
    ],
    "ImageId": "ami-123456789"
}

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.