Getting Information About Your OMIs

Using AWS CLI, you can get information about the OMIs you can use to launch instances:

  • OMIs that you created.

  • OMIs that other users shared with you.

If you exceed the number of identical requests allowed for a configured time period, the RequestLimitExceeded error message is returned.

This procedure uses AWS CLI only. Information about these resources is also available from Cockpit. For more information, see OMIs User Interface.

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 ID of one or more users 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 (for example, xvdx).

    • 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 (Linux/Unix | Windows | Linux/Oracle | Windows 10).

      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/vda1).

    • 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 launch 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/vda1",
                    "Ebs": {
                        "DeleteOnTermination": true,
                        "SnapshotId": "snap-87654321",
                        "VolumeSize": 8,
                        "VolumeType": "standard"
                    }
                }
            ],
            "Architecture": "x86_64",
            "ImageLocation": "1234567890000/Image_name",
            "RootDeviceType": "ebs",
            "OwnerId": "1234567890000",
            "RootDeviceName": "/dev/vda1",
            "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 users 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 users 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.