Getting Information About Your VMs

You can get information about your virtual machines (VMs), their statuses, and their attributes.

Information about your VMs is also available from within the VMs themselves. For more information, see Accessing the Metadata and User Data of a VM.

Getting Information About Your VMs Using Cockpit v2

See the VMs dashboard.

Getting Information About Your VMs Using OSC CLI

Getting Information About Your VMs

The ReadVms command lists one or more of your virtual machines (VMs).
If you provide one or more VM IDs, this action returns a description for all of these VMs. If you do not provide any VM ID, this action returns a description for all of the VMs that belong to you. If you provide an invalid VM ID, an error is returned. If you provide the ID of a VM that does not belong to you, the description of this VM is not included in the response. The refresh interval for data returned by this action is one hour, meaning that a terminated VM may appear in the response.

Request sample
$ osc-cli api ReadVms --profile "default" \
    --Filters '{
        "VmIds": ["i-12345678"],
      }'
Request sample
$ osc-cli api ReadVms --profile "default" \
    --Filters '{
        "TagKeys": ["env"],
        "TagValues": ["prod", "test"],
      }'

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 ReadVms command returns the following elements:

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

  • Vms: Information about one or more VMs.

Result sample
{
  "Vms": [
    {
      "VmType": "tinav5.c1r1p2",
      "VmInitiatedShutdownBehavior": "stop",
      "State": "running",
      "StateReason": "",
      "RootDeviceType": "ebs",
      "RootDeviceName": "/dev/sda1",
      "IsSourceDestChecked": true,
      "KeypairName": "keypair-example",
      "ImageId": "ami-12345678",
      "DeletionProtection": false,
      "Architecture": "x86_64",
      "NestedVirtualization": false,
      "BlockDeviceMappings": [
        {
          "DeviceName": "/dev/sda1",
          "Bsu": {
            "VolumeId": "vol-12345678",
            "State": "attached",
            "LinkDate": "2010-10-01T12:34:56.789Z",
            "DeleteOnVmDeletion": true
          }
        }
      ],
      "VmId": "i-12345678",
      "ReservationId": "r-12345678",
      "Hypervisor": "xen",
      "Placement": {
        "Tenancy": "default",
        "SubregionName": "eu-west-2a"
      },
      "ProductCodes": [
        "0001"
      ],
      "CreationDate": "2010-10-01T12:34:56.789Z",
      "UserData": "",
      "SubnetId": "subnet-12345678",
      "PrivateIp": "10.0.0.4",
      "SecurityGroups": [
        {
          "SecurityGroupName": "security-group-example",
          "SecurityGroupId": "sg-12345678"
        }
      ],
      "BsuOptimized": false,
      "LaunchNumber": 0,
      "NetId": "vpc-12345678",
      "Nics": [
        {
          "SubnetId": "subnet-12345678",
          "State": "in-use",
          "LinkNic": {
            "State": "attached",
            "DeviceNumber": 0,
            "LinkNicId": "eni-attach-12345678",
            "DeleteOnVmDeletion": true
          },
          "IsSourceDestChecked": true,
          "PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
          "Description": "Primary network interface",
          "AccountId": "123456789012",
          "SecurityGroups": [
            {
              "SecurityGroupName": "security-group-example",
              "SecurityGroupId": "sg-12345678"
            }
          ],
          "MacAddress": "A1:B2:C3:D4:E5:F6",
          "NetId": "vpc-12345678",
          "NicId": "eni-12345678",
          "PrivateIps": [
            {
              "PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
              "PrivateIp": "10.0.0.4",
              "IsPrimary": true
            }
          ]
        }
      ],
      "Performance": "high",
      "Tags": [
        {
          "Value": "prod",
          "Key": "env"
        }
      ],
      "PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal"
    }
  ],
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Getting Information About the States of Your VMs

The ReadVmsState command lists the status of one or more virtual machines (VMs).

Request sample
$ osc-cli api ReadVmsState --profile "default" \
    --AllVms True
Request sample
$ osc-cli api ReadVmsState --profile "default" \
    --Filters '{
        "SubregionNames": ["eu-west-2a"],
      }'

This command contains the following attributes that you need to specify:

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

  • 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 ReadVmsState command returns the following elements:

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

  • VmStates: Information about one or more VM states.

Result sample
{
  "VmStates": [
    {
      "VmId": "i-12345678",
      "VmState": "running",
      "SubregionName": "eu-west-2a",
      "MaintenanceEvents": []
    },
    {
      "VmId": "i-87654321",
      "VmState": "stopped",
      "SubregionName": "eu-west-2a",
      "MaintenanceEvents": []
    }
  ],
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}
Result sample
{
  "VmStates": [
    {
      "VmId": "i-12345678",
      "VmState": "running",
      "SubregionName": "eu-west-2a",
      "MaintenanceEvents": []
    }
  ],
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  }
}

Getting Information About Your Instances Using AWS CLI

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

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

    • 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: -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 VM 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-ip-address: The private IP of the instance.

    • product-code: The product code associated with the OMI used to launch the instance.

    • 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/sda1).

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

      • 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-111-1-1-1.eu-west-2.compute.outscale.com",
                            "Platform": "",
                            "State": {
                                "Code": 16,
                                "Name": "running"
                            },
                            "EbsOptimized": false,
                            "LaunchTime": "2016-04-25T13:57:26.393Z",
                            "PublicIpAddress": "111.1.1.1",
                            "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/sda1",
                                    "Ebs": {
                                        "Status": "attached",
                                        "DeleteOnTermination": true,
                                        "VolumeId": "vol-12345678",
                                        "AttachTime": "2016-04-25T13:57:26.393Z"
                                    }
                                }
                            ],
                            "Architecture": "x86_64",
                            "KernelId": "",
                            "RootDeviceName": "/dev/sda1",
                            "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 Subregions.

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