Getting Information About Your Instances

You can get information about your instances, their statuses, and their attributes.

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

These procedures use AWS CLI only. Information about your instances is also available:

Getting General Information About Your Instances

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

Request sample
$ aws ec2 describe-instances \
    --profile YOUR_PROFILE \
    --instance-ids i-12345678 i-87654321 i-12348765 i-56784321 \
    --filters Name=instance-state-name,Values=stopped \
    --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) instance-ids: One or more instance IDs.

    If you do not specify any instance ID, all your instances or all the instances matching the specified filters are described.

  • (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 instance (i386 | x86_64).

    • availability-zone: The Availability Zone of the instance. For more information, see About Regions, Endpoints, and Availability Zones.

    • block-device-mapping.attach-time: The time when a BSU volume was attached to the instance (for example, 2016-01-23T18:45:30.000Z).

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

    • block-device-mapping.device-name: The device name for a BSU volume (for example, xvdh).

    • block-device-mapping.status: The state for the BSU volume (attaching | attached | detaching | detached).

    • block-device-mapping.volume-id: The ID of the volume of the BSU volume.

    • client-token: The idempotency token provided when launching the instance.

    • dns-name: The public DNS name of the instance.

    • group-id: The ID of the security group for the instance (only in the public Cloud).

    • group-name: The name of the security group for the instance (only in the public Cloud).

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

    • image-id: The ID of the OMI used to launch the instance.

    • instance-id: The ID of the instance.

    • instance-state-code: The code for the state of the instance (a 16-bit unsigned integer). The high byte is an internal value you should ignore. The low byte represents the state of the instance: -1 (quarantine), 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), or 80 (stopped).

    • instance-state-name: The state of the instance (pending | running | stopping | stopped | shutting-down | terminated | quarantine).

    • instance-type: The instance type (for example, t2.micro). For more information, see Instance Types.

    • instance.group-id: The ID of the security group for the instance.

    • instance.group-name: The name of the security group for the instance.

    • ip-address: In the public Cloud, the public IP associated with the instance (replaced by the External IP, if any). In a Virtual Private Cloud (VPC), the External IP associated with the instance, if any.

    • kernel-id: The ID of the kernel.

    • key-name: The name of the keypair used when launching the instance. For more information, see About Keypairs.

    • launch-index: The launch index of the instance. For more information, see About Instances > General Information About Instances.

    • launch-time: The time when the instance was launched (for example, 2016-04-20T08:26:26.540Z)

    • monitoring-state: Indicates whether monitoring is enabled for the instance (always disabled).

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

    • placement-group-name: The name of the placement group for the instance.

    • platform: The platform (windows if you have Windows instances, leave blank otherwise).

    • private-dns-name: The private DNS name of the instance.

    • private-ip-address: The private IP of the instance.

    • product-code: The product code associated with the OMI used to launch the instance (0001 for Linux/Unix | 0002 for Windows | 0004 for Linux/Oracle | 0005 for Windows 10).

    • ramdisk-id: The ID of the RAM disk.

    • reason: The reason for the current state of the instance (similar to state-reason-code).

    • requester-id: The ID of the entity that launched the instance (for example Cockpit or Auto Scaling).

    • reservation-id: The ID of the reservation of the instance. For more information, see About Instances > General Information About Instances.

    • root-device-name: The device name associated with the root device (for example, /dev/vda1).

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

    • source-dest-check: If true, source/destination check of network traffic is enabled. If false, it is disabled.

    • state-reason-code: The reason code for the state change.

    • state-reason-message: A message describing the state change.

    • subnet-id: In the public Cloud, subnet-820c5bf8. In a VPC, the ID of the subnet in which the instance is.

    • 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

    • tenancy: The tenancy of the instance (dedicated | default). For more information, see About Instances > Instance Tenancy and Dedicated Instances.

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

    • vpc-id: The ID of the VPC in which the instance is running.

    • network-interface.description: The description of the network interface.

    • network-interface.subnet-id: In the public Cloud, subnet-820c5bf8. In a VPC, the ID of the subnet in which the instance is.

    • network-interface.vpc-id: In the public Cloud, vpc-00000000. In a VPC, the ID of the VPC (vpc-XXXXXXXX).

    • network-interface.network-interface-id: The ID of the network interface of the instance (eni-XXXXXXXX).

    • network-interface.owner-id: The account ID of the owner of the network interface.

    • network-interface.availability-zone: The Availability Zone for the network interface.

    • network-interface.requester-id: The requester ID for the network interface.

    • network-interface.requester-managed: Indicates whether the network interface is managed by 3DS OUTSCALE.

    • network-interface.status: The state of the network interface (available | in-use).

    • network-interface.mac-address: The MAC address of the network interface.

    • network-interface.private-dns-name: The private DNS name of the network interface.

    • network-interface.source-dest-check: If true, source/destination check of network traffic for the network interface is enabled. If false, it is disabled.

    • network-interface.group-id: The ID of the security group for the network interface.

    • network-interface.group-name: The name of the security group for the network interface.

    • network-interface.attachment.attachment-id: The ID of the interface attachment.

    • network-interface.attachment.instance-id: The ID of the instance the network interface is attached to.

    • network-interface.attachment.instance-owner-id: The account ID of the owner of the instance the network interface is attached to.

    • network-interface.attachment.device-index: The device index the network interface is attached to.

    • network-interface.attachment.status: The state of the attachment (attaching | attached | detaching | detached).

    • network-interface.attachment.attach-time: The time when the network interface was attached to the instance.

    • network-interface.attachment.delete-on-termination: Indicates whether the attachment is deleted when terminating an instance.

    • network-interface.addresses.private-ip-address: The private IP associated with the network interface.

    • network-interface.addresses.primary: Indicates whether the IP of the network interface is the primary private IP.

    • network-interface.addresses.association.public-ip: The External IP associated with the network interface of the instance (if any).

    • network-interface.addresses.association.ip-owner-id: The account ID of the owner of the External IP associated with the network interface of the instance.

    • network-interface.association.public-ip: The External IP associated with the network interface.

    • network-interface.association.ip-owner-id: The account ID of the owner of the External IP associated with the network interface.

    • network-interface.association.allocation-id: The allocation ID. This ID is returned when you allocate the External IP for your network interface.

    • network-interface.association.association-id: The association ID. This ID is returned when the network interface is associated with an IP.

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

The describe-instances command returns the following elements:

  • Reservations: Information about one or more reservations. This element contains the following information:

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

    • ReservationId: The ID of the reservation.

    • Groups: The security groups for the instances of the reservation (security group name and security group ID).

    • Instances: Information about one or more instances. This element contains the following information:

      • Monitoring: Information about the state of the instance monitoring (always disabled).

      • PublicDnsName: The public DNS name for the instance.

      • Platform: No information returned.

      • State: Information about the state of the instance (the state code and its name).

      • EbsOptimized: Whether the instance is BSU-optimized or not. For more information, see Instance Types.

      • LaunchTime: The time when the instance was launched.

      • PublicIpAddress: The public IP associated with the instance (replaced by the External IP (EIP), if any). In a VPC, the EIP if any.

      • PrivateIpAddress: The private IP associated with the instance.

      • ProductCodes: No information returned when using official OMIs.

      • Tags: One or more tags associated with the instance, with their Value and their Key.

      • InstanceId: The ID of the instance.

      • ImageId: The ID of the OMI used to launch the instance.

      • VpcId: In a VPC, the ID of the VPC in which the instance is.

      • PrivateDnsNAme: The private DNS name for the instance.

      • KeyName: The name of the keypair used for the instance. For more information, see About Keypairs.

      • SecurityGroups: The security groups for the instance (security group name and security group ID).

      • ClientToken: A unique identifier which enables you to manage the idempotency.

      • InstanceType: The instance type. For more information, see Instance Types.

      • NetworkInterfaces: In a VPC, one or more network interfaces for the instance.

      • Placement: Information about the placement of the instance.

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

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

      • Architecture: The architecture of the instance.

      • KernelId: No information retuned.

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

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

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

      • AmiLaunchIndex: The launch index of the instance. For more information, see About Instances > General Information About Instances.

        Result sample
            "Reservations": [
                {
                    "OwnerId": "1234567890000",
                    "ReservationId": "r-12345678",
                    "Groups": [
                        {
                            "GroupName": "Dev_BL",
                            "GroupId": "sg-87654321"
                        }
                    ],
                    "Instances": [
                        {
                            "Monitoring": {
                                "State": "disabled"
                            },
                            "PublicDnsName": "ows-100-10-10-10.eu-west-2.compute.outscale.com",
                            "Platform": "",
                            "State": {
                                "Code": 16,
                                "Name": "running"
                            },
                            "EbsOptimized": false,
                            "LaunchTime": "2016-04-25T13:57:26.393Z",
                            "PublicIpAddress": "100.10.10.10",
                            "PrivateIpAddress": "10.0.1.100",
                            "ProductCodes": [],
                            "Tags": [
                                {
                                    "Value": "Jenkins",
                                    "Key": "Name"
                                }
                            ],
                            "InstanceId": "i-87654321",
                            "ImageId": "ami-12345678",
                            "PrivateDnsName": "ip-10-0-1-100.eu-west-2.compute.internal",
                            "KeyName": "key_name",
                            "SecurityGroups": [
                                {
                                    "GroupName": "group_name",
                                    "GroupId": "sg-87654321"
                                }
                            ],
                            "ClientToken": "",
                            "InstanceType": "m1.large",
                            "NetworkInterfaces": [],
                            "Placement": {
                                "Tenancy": "default",
                                "GroupName": "",
                                "AvailabilityZone": "eu-west-2a"
                            },
                            "Hypervisor": "xen",
                            "BlockDeviceMappings": [
                                {
                                    "DeviceName": "/dev/vda1",
                                    "Ebs": {
                                        "Status": "attached",
                                        "DeleteOnTermination": true,
                                        "VolumeId": "vol-12345678",
                                        "AttachTime": "2016-04-25T13:57:26.393Z"
                                    }
                                }
                            ],
                            "Architecture": "x86_64",
                            "KernelId": "",
                            "RootDeviceName": "/dev/vda1",
                            "VirtualizationType": "hvm",
                            "RootDeviceType": "ebs",
                            "AmiLaunchIndex": 0
                        }
                    ]
                }
            ]
        }

Getting Information About the Status of Your Instances

To get information about the status of one or more instances, use the describe-instance-status command following this syntax:

Request sample
$ aws ec2 describe-instance-status \
    --profile YOUR_PROFILE \
    --instance-ids i-12345678 i-87654321 i-12348765 i-56784321 \
    [--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) instance-ids: One or more instance IDs.

    If you do not specify any instance ID, all your instances or all the instances matching the specified filters are described.

  • (optional) max-items: The maximum number of results that can be returned in a single page, between 5 and 1000.

    You cannot specify both the instance-ids and max-items attributes in the same request.

  • (optional) include-all-instances: If set to true, includes the status of all instances. By default or if set to false, only includes the status of running instances.

  • (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:

    • availability-zone: The Availability Zone of the instance. For more information, see About Regions, Endpoints, and Availability Zones.

    • event.code: The code for a scheduled event (system-reboot | system-maintenance). For more information, see Infrastructure Maintenance.

    • event.description: The description of the scheduled event.

    • instance-state-code: The code for the state of the instance (a 16-bit unsigned integer). The high byte is an internal value you should ignore. The low byte represents the state of the instance: -1 (quarantine), 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), or 80 (stopped).

    • instance-state-name: The state of the instance (pending | running | stopping | stopped | shutting-down | terminated | quarantine).

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

The describe-instance-status command returns the following elements:

  • InstanceStatuses: Information about one or more instance statuses. This element contains the following information:

    • AvailabilityZone: The Availability Zone of the instance.

    • InstanceId: The ID of the instance.

    • InstanceState: Information about the state of the instance. The element contains the following information:

      • Code: The code for the state of the instance (a 16-bit unsigned integer).

      • Name: The name of the state.

    • SystemStatus: The system status of the instance.

    • Events: Information about one or more scheduled event associated with the instance. This element contains the following information:

      • Code: The event code (system-reboot | system-maintenance).

      • Description: Information about the event.

      • NotBefore: The earliest scheduled time for the event to start.

      • NotAfter: The latest scheduled time for the event to end.

  • NextToken: The token to request the next page of results. If null, there are no more results to display.

    Result sample
    {
        "InstanceStatuses": [
            {
                "InstanceStatus": {
                    "Status": "insufficient-data",
                    "Details": []
                },
                "AvailabilityZone": "eu-west-2a",
                "InstanceId": "i-12345678",
                "InstanceState": {
                    "Code": 16,
                    "Name": "running"
                },
                "SystemStatus": {
                    "Status": "insufficient-data",
                    "Details": []
                },
                "Events": []
            },
        "NextToken": null
        ]
    }

Getting Information About an Attribute of an Instance

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

Request sample
$ aws ec2 describe-instance-attribute \
    --profile YOUR_PROFILE \
    --instance-id i-12345678 \
    --attribute disableApiTermination \
    --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.

  • instance-id: The ID of the instance.

  • attribute: The instance attribute (userData | instanceInitiatedShutdownBehavior | rootDeviceName | instanceType | blockDeviceMapping | groupSet | ebsOptimized | sourceDestCheck | disableApiTermination).

    • You can specify only one attribute at a time.

    • You can describe the sourceDestCheck attribute only if the instance is in a VPC.

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

The describe-instance-attribute command returns the following elements:

  • InstanceId: The ID of the instance.

  • The attribute value (here, DisableApiTermination is set to false).

    Result sample
    {
        "InstanceId": "i-12345678",
        "DisableApiTermination": {
            "Value": false
        }
    }

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.