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.

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

    • BlockDeviceMappingDeleteOnVmDeletion: (optional) Whether the BSU volumes are deleted when terminating the VMs.

    • BlockDeviceMappingDeviceNames: (optional) The device names for the BSU volumes (in the format /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX).

    • BlockDeviceMappingLinkDates: (optional) The link dates for the BSU volumes mapped to the VMs (for example, 2016-01-23T18:45:30.000Z).

    • BlockDeviceMappingStates: (optional) The states for the BSU volumes (attaching | attached | detaching | detached).

    • BlockDeviceMappingVolumeIds: (optional) The volume IDs of the BSU volumes.

    • ClientTokens: (optional) The idempotency tokens provided when launching the VMs.

    • CreationDates: (optional) The dates when the VMs were launched.

    • ImageIds: (optional) The IDs of the OMIs used to launch the VMs.

    • IsSourceDestChecked: (optional) Whether the source/destination checking is enabled (true) or disabled (false).

    • KeypairNames: (optional) The names of the keypairs used when launching the VMs.

    • LaunchNumbers: (optional) The numbers for the VMs when launching a group of several VMs (for example, 0, 1, 2, and so on).

    • Lifecycles: (optional) Whether the VMs are Spot Instances (spot).

    • NetIds: (optional) The IDs of the Nets in which the VMs are running.

    • NicAccountIds: (optional) The IDs of the NICs.

    • NicDescriptions: (optional) The descriptions of the NICs.

    • NicIsSourceDestChecked: (optional) Whether the source/destination checking is enabled (true) or disabled (false).

    • NicLinkNicDeleteOnVmDeletion: (optional) Whether the NICs are deleted when the VMs they are attached to are deleted.

    • NicLinkNicDeviceNumbers: (optional) The device numbers the NICs are attached to.

    • NicLinkNicLinkNicDates: (optional) The dates and times (UTC) when the NICs were attached to the VMs.

    • NicLinkNicLinkNicIds: (optional) The IDs of the NIC attachments.

    • NicLinkNicStates: (optional) The states of the attachments.

    • NicLinkNicVmAccountIds: (optional) The account IDs of the owners of the VMs the NICs are attached to.

    • NicLinkNicVmIds: (optional) The IDs of the VMs the NICs are attached to.

    • NicLinkPublicIpAccountIds: (optional) The account IDs of the owners of the public IPs associated with the NICs.

    • NicLinkPublicIpLinkPublicIpIds: (optional) The association IDs returned when the public IPs were associated with the NICs.

    • NicLinkPublicIpPublicIpIds: (optional) The allocation IDs returned when the public IPs were allocated to their accounts.

    • NicLinkPublicIpPublicIps: (optional) The public IPs associated with the NICs.

    • NicMacAddresses: (optional) The Media Access Control (MAC) addresses of the NICs.

    • NicNetIds: (optional) The IDs of the Nets where the NICs are located.

    • NicNicIds: (optional) The IDs of the NICs.

    • NicPrivateIpsLinkPublicIpAccountIds: (optional) The account IDs of the owner of the public IPs associated with the private IPs.

    • NicPrivateIpsLinkPublicIpIds: (optional) The public IPs associated with the private IPs.

    • NicPrivateIpsPrimaryIp: (optional) Whether the private IPs are the primary IPs associated with the NICs.

    • NicPrivateIpsPrivateIps: (optional) The private IPs of the NICs.

    • NicSecurityGroupIds: (optional) The IDs of the security groups associated with the NICs.

    • NicSecurityGroupNames: (optional) The names of the security groups associated with the NICs.

    • NicStates: (optional) The states of the NICs (available | in-use).

    • NicSubnetIds: (optional) The IDs of the Subnets for the NICs.

    • NicSubregionNames: (optional) The Subregions where the NICs are located.

    • Platforms: (optional) The platforms. Use windows if you have Windows VMs. Otherwise, leave this filter blank.

    • PrivateIps: (optional) The private IPs of the VMs.

    • ProductCodes: (optional) The product codes associated with the OMI used to create the VMs.

    • PublicIps: (optional) The public IPs of the VMs.

    • ReservationIds: (optional) The IDs of the reservation of the VMs, created every time you launch VMs. These reservation IDs can be associated with several VMs when you launch a group of VMs using the same launch request.

    • RootDeviceNames: (optional) The names of the root devices for the VMs (for example, /dev/sda1)

    • RootDeviceTypes: (optional) The root devices types used by the VMs (always ebs)

    • SecurityGroupIds: (optional) The IDs of the security groups for the VMs (only in the public Cloud).

    • SecurityGroupNames: (optional) The names of the security groups for the VMs (only in the public Cloud).

    • StateReasonCodes: (optional) The reason codes for the state changes.

    • StateReasonMessages: (optional) The messages describing the state changes.

    • StateReasons: (optional) The reasons explaining the current states of the VMs. This filter is like the StateReasonCodes one.

    • SubnetIds: (optional) The IDs of the Subnets for the VMs.

    • SubregionNames: (optional) The names of the Subregions of the VMs.

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

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

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

    • Tenancies: (optional) The tenancies of the VMs (dedicated | default | host).

    • VmIds: (optional) One or more IDs of VMs.

    • VmSecurityGroupIds: (optional) The IDs of the security groups for the VMs.

    • VmSecurityGroupNames: (optional) The names of the security group for the VMs.

    • VmStateCodes: (optional) The state codes of the VMs: -1 (quarantine), 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).

    • VmStateNames: (optional) The state names of the VMs (pending | running | stopping | stopped | shutting-down | terminated | quarantine).

    • VmTypes: (optional) The VM types (for example, t2.micro). For more information, see VM Types.

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

    • RequestId: The ID of the request.

  • Vms: Information about one or more VMs.

    • Architecture: The architecture of the VM (i386 | x86_64).

    • BlockDeviceMappings: The block device mapping of the VM.

      • Bsu: Information about the created BSU volume.

        • DeleteOnVmDeletion: If true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM.

        • LinkDate: The date and time (UTC) at which the volume was attached to the VM, in ISO 8601 date-time format.

        • State: The state of the volume.

        • VolumeId: The ID of the volume.

      • DeviceName: The name of the device.

    • BsuOptimized: This parameter is not available. It is present in our API for the sake of historical compatibility with AWS.

    • ClientToken: The idempotency token provided when launching the VM.

    • CreationDate: The date and time (UTC) at which the VM was created.

    • DeletionProtection: If true, you cannot delete the VM unless you change this parameter back to false.

    • Hypervisor: The hypervisor type of the VMs (ovm | xen).

    • ImageId: The ID of the OMI used to create the VM.

    • IsSourceDestChecked: (Net only) If true, the source/destination check is enabled. If false, it is disabled.

    • KeypairName: The name of the keypair used when launching the VM.

    • LaunchNumber: The number for the VM when launching a group of several VMs (for example, 0, 1, 2, and so on).

    • NestedVirtualization: If true, nested virtualization is enabled. If false, it is disabled.

    • NetId: The ID of the Net in which the VM is running.

    • Nics: (Net only) The network interface cards (NICs) the VMs are attached to.

      • AccountId: The account ID of the owner of the NIC.

      • Description: The description of the NIC.

      • IsSourceDestChecked: (Net only) If true, the source/destination check is enabled. If false, it is disabled.

      • LinkNic: Information about the network interface card (NIC).

        • DeleteOnVmDeletion: If true, the NIC is deleted when the VM is terminated.

        • DeviceNumber: The device index for the NIC attachment (between 1 and 7, both included).

        • LinkNicId: The ID of the NIC to attach.

        • State: The state of the attachment (attaching | attached | detaching | detached).

      • LinkPublicIp: Information about the public IP associated with the NIC.

        • PublicDnsName: The name of the public DNS.

        • PublicIp: The public IP associated with the NIC.

        • PublicIpAccountId: The account ID of the owner of the public IP.

      • MacAddress: The Media Access Control (MAC) address of the NIC.

      • NetId: The ID of the Net for the NIC.

      • NicId: The ID of the NIC.

      • PrivateDnsName: The name of the private DNS.

      • PrivateIps: The private IP or IPs of the NIC.

        • IsPrimary: If true, the IP is the primary private IP of the NIC.

        • LinkPublicIp: Information about the public IP associated with the NIC.

          • PublicDnsName: The name of the public DNS.

          • PublicIp: The public IP associated with the NIC.

          • PublicIpAccountId: The account ID of the owner of the public IP.

        • PrivateDnsName: The name of the private DNS.

        • PrivateIp: The private IP.

      • SecurityGroups: One or more IDs of security groups for the NIC.

        • SecurityGroupId: The ID of the security group.

        • SecurityGroupName: The name of the security group.

      • State: The state of the NIC (available | attaching | in-use | detaching).

      • SubnetId: The ID of the Subnet for the NIC.

    • OsFamily: Indicates the operating system (OS) of the VM.

    • Performance: The performance of the VM (medium | high | highest).

    • Placement: Information about the placement of the VM.

      • SubregionName: The name of the Subregion. If you specify this parameter, you must not specify the Nics parameter.

      • Tenancy: The tenancy of the VM (default, dedicated, or a dedicated group ID).

    • PrivateDnsName: The name of the private DNS.

    • PrivateIp: The primary private IP of the VM.

    • ProductCodes: The product codes associated with the OMI used to create the VM.

    • PublicDnsName: The name of the public DNS.

    • PublicIp: The public IP of the VM.

    • ReservationId: The reservation ID of the VM.

    • RootDeviceName: The name of the root device for the VM (for example, /dev/sda1).

    • RootDeviceType: The type of root device used by the VM (always bsu).

    • SecurityGroups: One or more security groups associated with the VM.

      • SecurityGroupId: The ID of the security group.

      • SecurityGroupName: The name of the security group.

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

    • StateReason: The reason explaining the current state of the VM.

    • SubnetId: The ID of the Subnet for the VM.

    • Tags: One or more tags associated with the VM.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • UserData: The Base64-encoded MIME user data.

    • VmId: The ID of the VM.

    • VmInitiatedShutdownBehavior: The VM behavior when you stop it. If set to stop, the VM stops. If set to restart, the VM stops then automatically restarts. If set to terminate, the VM stops and is deleted.

    • VmType: The type of VM. For more information, see VM Types.

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.

    • MaintenanceEventCodes: (optional) The code for the scheduled event (system-reboot | system-maintenance).

    • MaintenanceEventDescriptions: (optional) The description of the scheduled event.

    • MaintenanceEventsNotAfter: (optional) The latest date and time (UTC) the event can end.

    • MaintenanceEventsNotBefore: (optional) The earliest date and time (UTC) the event can start.

    • SubregionNames: (optional) The names of the Subregions of the VMs.

    • VmIds: (optional) One or more IDs of VMs.

    • VmStates: (optional) The states of the VMs (pending | running | stopping | stopped | shutting-down | terminated | quarantine).

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

    • RequestId: The ID of the request.

  • VmStates: Information about one or more VM states.

    • MaintenanceEvents: One or more scheduled events associated with the VM.

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

      • Description: The description of the event.

      • NotAfter: The latest scheduled end date and time (UTC) for the event.

      • NotBefore: The earliest scheduled start date and time (UTC) for the event.

    • SubregionName: The name of the Subregion of the VM.

    • VmId: The ID of the VM.

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

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 VMs Using oapi-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
$ oapi-cli --profile "default" ReadVms \
    --Filters '{
        "VmIds": ["i-12345678"]
      }'
Request sample
$ oapi-cli --profile "default" ReadVms \
    --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.

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

    • BlockDeviceMappingDeleteOnVmDeletion: (optional) Whether the BSU volumes are deleted when terminating the VMs.

    • BlockDeviceMappingDeviceNames: (optional) The device names for the BSU volumes (in the format /dev/sdX, /dev/sdXX, /dev/xvdX, or /dev/xvdXX).

    • BlockDeviceMappingLinkDates: (optional) The link dates for the BSU volumes mapped to the VMs (for example, 2016-01-23T18:45:30.000Z).

    • BlockDeviceMappingStates: (optional) The states for the BSU volumes (attaching | attached | detaching | detached).

    • BlockDeviceMappingVolumeIds: (optional) The volume IDs of the BSU volumes.

    • ClientTokens: (optional) The idempotency tokens provided when launching the VMs.

    • CreationDates: (optional) The dates when the VMs were launched.

    • ImageIds: (optional) The IDs of the OMIs used to launch the VMs.

    • IsSourceDestChecked: (optional) Whether the source/destination checking is enabled (true) or disabled (false).

    • KeypairNames: (optional) The names of the keypairs used when launching the VMs.

    • LaunchNumbers: (optional) The numbers for the VMs when launching a group of several VMs (for example, 0, 1, 2, and so on).

    • Lifecycles: (optional) Whether the VMs are Spot Instances (spot).

    • NetIds: (optional) The IDs of the Nets in which the VMs are running.

    • NicAccountIds: (optional) The IDs of the NICs.

    • NicDescriptions: (optional) The descriptions of the NICs.

    • NicIsSourceDestChecked: (optional) Whether the source/destination checking is enabled (true) or disabled (false).

    • NicLinkNicDeleteOnVmDeletion: (optional) Whether the NICs are deleted when the VMs they are attached to are deleted.

    • NicLinkNicDeviceNumbers: (optional) The device numbers the NICs are attached to.

    • NicLinkNicLinkNicDates: (optional) The dates and times (UTC) when the NICs were attached to the VMs.

    • NicLinkNicLinkNicIds: (optional) The IDs of the NIC attachments.

    • NicLinkNicStates: (optional) The states of the attachments.

    • NicLinkNicVmAccountIds: (optional) The account IDs of the owners of the VMs the NICs are attached to.

    • NicLinkNicVmIds: (optional) The IDs of the VMs the NICs are attached to.

    • NicLinkPublicIpAccountIds: (optional) The account IDs of the owners of the public IPs associated with the NICs.

    • NicLinkPublicIpLinkPublicIpIds: (optional) The association IDs returned when the public IPs were associated with the NICs.

    • NicLinkPublicIpPublicIpIds: (optional) The allocation IDs returned when the public IPs were allocated to their accounts.

    • NicLinkPublicIpPublicIps: (optional) The public IPs associated with the NICs.

    • NicMacAddresses: (optional) The Media Access Control (MAC) addresses of the NICs.

    • NicNetIds: (optional) The IDs of the Nets where the NICs are located.

    • NicNicIds: (optional) The IDs of the NICs.

    • NicPrivateIpsLinkPublicIpAccountIds: (optional) The account IDs of the owner of the public IPs associated with the private IPs.

    • NicPrivateIpsLinkPublicIpIds: (optional) The public IPs associated with the private IPs.

    • NicPrivateIpsPrimaryIp: (optional) Whether the private IPs are the primary IPs associated with the NICs.

    • NicPrivateIpsPrivateIps: (optional) The private IPs of the NICs.

    • NicSecurityGroupIds: (optional) The IDs of the security groups associated with the NICs.

    • NicSecurityGroupNames: (optional) The names of the security groups associated with the NICs.

    • NicStates: (optional) The states of the NICs (available | in-use).

    • NicSubnetIds: (optional) The IDs of the Subnets for the NICs.

    • NicSubregionNames: (optional) The Subregions where the NICs are located.

    • Platforms: (optional) The platforms. Use windows if you have Windows VMs. Otherwise, leave this filter blank.

    • PrivateIps: (optional) The private IPs of the VMs.

    • ProductCodes: (optional) The product codes associated with the OMI used to create the VMs.

    • PublicIps: (optional) The public IPs of the VMs.

    • ReservationIds: (optional) The IDs of the reservation of the VMs, created every time you launch VMs. These reservation IDs can be associated with several VMs when you launch a group of VMs using the same launch request.

    • RootDeviceNames: (optional) The names of the root devices for the VMs (for example, /dev/sda1)

    • RootDeviceTypes: (optional) The root devices types used by the VMs (always ebs)

    • SecurityGroupIds: (optional) The IDs of the security groups for the VMs (only in the public Cloud).

    • SecurityGroupNames: (optional) The names of the security groups for the VMs (only in the public Cloud).

    • StateReasonCodes: (optional) The reason codes for the state changes.

    • StateReasonMessages: (optional) The messages describing the state changes.

    • StateReasons: (optional) The reasons explaining the current states of the VMs. This filter is like the StateReasonCodes one.

    • SubnetIds: (optional) The IDs of the Subnets for the VMs.

    • SubregionNames: (optional) The names of the Subregions of the VMs.

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

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

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

    • Tenancies: (optional) The tenancies of the VMs (dedicated | default | host).

    • VmIds: (optional) One or more IDs of VMs.

    • VmSecurityGroupIds: (optional) The IDs of the security groups for the VMs.

    • VmSecurityGroupNames: (optional) The names of the security group for the VMs.

    • VmStateCodes: (optional) The state codes of the VMs: -1 (quarantine), 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped).

    • VmStateNames: (optional) The state names of the VMs (pending | running | stopping | stopped | shutting-down | terminated | quarantine).

    • VmTypes: (optional) The VM types (for example, t2.micro). For more information, see VM Types.

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

    • RequestId: The ID of the request.

  • Vms: Information about one or more VMs.

    • Architecture: The architecture of the VM (i386 | x86_64).

    • BlockDeviceMappings: The block device mapping of the VM.

      • Bsu: Information about the created BSU volume.

        • DeleteOnVmDeletion: If true, the volume is deleted when terminating the VM. If false, the volume is not deleted when terminating the VM.

        • LinkDate: The date and time (UTC) at which the volume was attached to the VM, in ISO 8601 date-time format.

        • State: The state of the volume.

        • VolumeId: The ID of the volume.

      • DeviceName: The name of the device.

    • BsuOptimized: This parameter is not available. It is present in our API for the sake of historical compatibility with AWS.

    • ClientToken: The idempotency token provided when launching the VM.

    • CreationDate: The date and time (UTC) at which the VM was created.

    • DeletionProtection: If true, you cannot delete the VM unless you change this parameter back to false.

    • Hypervisor: The hypervisor type of the VMs (ovm | xen).

    • ImageId: The ID of the OMI used to create the VM.

    • IsSourceDestChecked: (Net only) If true, the source/destination check is enabled. If false, it is disabled.

    • KeypairName: The name of the keypair used when launching the VM.

    • LaunchNumber: The number for the VM when launching a group of several VMs (for example, 0, 1, 2, and so on).

    • NestedVirtualization: If true, nested virtualization is enabled. If false, it is disabled.

    • NetId: The ID of the Net in which the VM is running.

    • Nics: (Net only) The network interface cards (NICs) the VMs are attached to.

      • AccountId: The account ID of the owner of the NIC.

      • Description: The description of the NIC.

      • IsSourceDestChecked: (Net only) If true, the source/destination check is enabled. If false, it is disabled.

      • LinkNic: Information about the network interface card (NIC).

        • DeleteOnVmDeletion: If true, the NIC is deleted when the VM is terminated.

        • DeviceNumber: The device index for the NIC attachment (between 1 and 7, both included).

        • LinkNicId: The ID of the NIC to attach.

        • State: The state of the attachment (attaching | attached | detaching | detached).

      • LinkPublicIp: Information about the public IP associated with the NIC.

        • PublicDnsName: The name of the public DNS.

        • PublicIp: The public IP associated with the NIC.

        • PublicIpAccountId: The account ID of the owner of the public IP.

      • MacAddress: The Media Access Control (MAC) address of the NIC.

      • NetId: The ID of the Net for the NIC.

      • NicId: The ID of the NIC.

      • PrivateDnsName: The name of the private DNS.

      • PrivateIps: The private IP or IPs of the NIC.

        • IsPrimary: If true, the IP is the primary private IP of the NIC.

        • LinkPublicIp: Information about the public IP associated with the NIC.

          • PublicDnsName: The name of the public DNS.

          • PublicIp: The public IP associated with the NIC.

          • PublicIpAccountId: The account ID of the owner of the public IP.

        • PrivateDnsName: The name of the private DNS.

        • PrivateIp: The private IP.

      • SecurityGroups: One or more IDs of security groups for the NIC.

        • SecurityGroupId: The ID of the security group.

        • SecurityGroupName: The name of the security group.

      • State: The state of the NIC (available | attaching | in-use | detaching).

      • SubnetId: The ID of the Subnet for the NIC.

    • OsFamily: Indicates the operating system (OS) of the VM.

    • Performance: The performance of the VM (medium | high | highest).

    • Placement: Information about the placement of the VM.

      • SubregionName: The name of the Subregion. If you specify this parameter, you must not specify the Nics parameter.

      • Tenancy: The tenancy of the VM (default, dedicated, or a dedicated group ID).

    • PrivateDnsName: The name of the private DNS.

    • PrivateIp: The primary private IP of the VM.

    • ProductCodes: The product codes associated with the OMI used to create the VM.

    • PublicDnsName: The name of the public DNS.

    • PublicIp: The public IP of the VM.

    • ReservationId: The reservation ID of the VM.

    • RootDeviceName: The name of the root device for the VM (for example, /dev/sda1).

    • RootDeviceType: The type of root device used by the VM (always bsu).

    • SecurityGroups: One or more security groups associated with the VM.

      • SecurityGroupId: The ID of the security group.

      • SecurityGroupName: The name of the security group.

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

    • StateReason: The reason explaining the current state of the VM.

    • SubnetId: The ID of the Subnet for the VM.

    • Tags: One or more tags associated with the VM.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

    • UserData: The Base64-encoded MIME user data.

    • VmId: The ID of the VM.

    • VmInitiatedShutdownBehavior: The VM behavior when you stop it. If set to stop, the VM stops. If set to restart, the VM stops then automatically restarts. If set to terminate, the VM stops and is deleted.

    • VmType: The type of VM. For more information, see VM Types.

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
$ oapi-cli --profile "default" ReadVmsState \
    --AllVms True
Request sample
$ oapi-cli --profile "default" ReadVmsState \
    --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.

    • MaintenanceEventCodes: (optional) The code for the scheduled event (system-reboot | system-maintenance).

    • MaintenanceEventDescriptions: (optional) The description of the scheduled event.

    • MaintenanceEventsNotAfter: (optional) The latest date and time (UTC) the event can end.

    • MaintenanceEventsNotBefore: (optional) The earliest date and time (UTC) the event can start.

    • SubregionNames: (optional) The names of the Subregions of the VMs.

    • VmIds: (optional) One or more IDs of VMs.

    • VmStates: (optional) The states of the VMs (pending | running | stopping | stopped | shutting-down | terminated | quarantine).

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

    • RequestId: The ID of the request.

  • VmStates: Information about one or more VM states.

    • MaintenanceEvents: One or more scheduled events associated with the VM.

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

      • Description: The description of the event.

      • NotAfter: The latest scheduled end date and time (UTC) for the event.

      • NotBefore: The earliest scheduled start date and time (UTC) for the event.

    • SubregionName: The name of the Subregion of the VM.

    • VmId: The ID of the VM.

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

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

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring 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 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 VMs > General Information About VMs.

    • 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 VMs > General Information About VMs.

    • 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 VMs > VM Tenancy and Dedicated VMs.

    • 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. For more information, see Installing and Configuring AWS CLI.

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 VMs > General Information About VMs.

        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 Name=X,Values=Y \
    --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 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. For more information, see Installing and Configuring AWS CLI.

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. For more information, see Installing and Configuring AWS CLI.

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.