Showing virtual machine details

GET /servers/{server_id}

Show details of a server with the specified ID.

Includes server details including configuration drive, extended status, and server usage information.

The extended status information appears in the OS-EXT-STS:vm_state, OS-EXT-STS:power_state, and OS-EXT-STS:task_state attributes.

The server usage information appears in the OS-SRV-USG:launched_at and OS-SRV-USG:terminated_at attributes.

Precondition: the server must exist.

Source: https://docs.openstack.org/api-ref/compute/?expanded=show-server-details-detail#show-server-details

Request

Parameters

Name In Type Description
server_id path string The UUID of the server.

Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/servers/bb4f4c8d-a6ca-4723-ace3-1683f54cca1e

Response

Parameters

Name In Type Description
server body object A server object.
id body string The UUID of the server.
links body array Links to the resources in question. See API Guide / Links and References for more info.
name body string The server name.
accessIPv4 body string IPv4 address that should be used to access this server. May be automatically set by the provider.
accessIPv6 body string IPv6 address that should be used to access this server. May be automatically set by the provider.
addresses body object The addresses for the server. Servers with status BUILD hide their addresses information.
security_groups (Optional) body array

One or more security groups objects.

security_groups.name body string

The security group name.

config_drive body string Indicates whether or not a config drive was used for this server. The value is True or an empty string. An empty string stands for False.
created body string

The date and time when the resource was created.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

flavor body object

Before microversion 2.47 this contains the ID and links for the flavor used to boot the server instance. This can be an empty object in case flavor information is no longer present in the system.

As of microversion 2.47 this contains a subset of the actual flavor information used to create the server instance, represented as a nested dictionary.

flavor.id body string

The ID of the flavor. While people often make this look like an int, this is really a string.

Available until version 2.46

flavor.links body array

Links to the flavor resource. See API Guide / Links and References for more details.

Available until version 2.46

flavor.vcpus body integer

The number of virtual CPUs that were allocated to the server.

New in version 2.47

flavor.ram body integer

The amount of RAM a flavor has, in MiB.

New in version 2.47

flavor.disk body integer

The size of the root disk that was created in GiB.

New in version 2.47

flavor.ephemeral body integer

The size of the ephemeral disk that was created, in GiB.

New in version 2.47

flavor.swap body integer

The size of a dedicated swap disk that was allocated, in MiB.

New in version 2.47

flavor.original_name body string

The display name of a flavor.

New in version 2.47

flavor.extra_specs (Optional) body object

A dictionary of the flavor’s extra-specs key-and-value pairs. This will only be included if the user is allowed by policy to index flavor extra_specs.

New in version 2.47

flavor.extra_specs.key body string

The extra spec key of a flavor.

New in version 2.47

flavor.extra_specs.value body string

The extra spec value of a flavor.

New in version 2.47

guest_agent body object The guest tools connection state and version.
hci_info body object The information about the VM networks, disks, traits, and OS distribution.
hostId body string An ID string representing the host. This is a hashed value so will not actually look like a hostname, and is hashed with data from the project_id, so the same physical host as seen by two different project_ids, will be different. It is useful when within the same project you need to determine if two instances are on the same or different physical hosts for the purposes of availability or performance.
host_status (Optional) body string

The host status. Values where next value in list can override the previous:

  • UP if nova-compute up.
  • UNKNOWN if nova-compute not reported by servicegroup driver.
  • DOWN if nova-compute forced down.
  • MAINTENANCE if nova-compute is disabled.
  • Empty string indicates there is no host for server.

This attribute appears in the response only if the policy permits. By default, only administrators can get this parameter.

New in version 2.16

image body object The UUID and links for the image for your server instance. The image object will be an empty string when you boot the server from a volume.
image_metadata (Optional) body object Metadata key and value pairs for the image. The maximum size for each metadata key and value pair is 255 bytes.
key_name body string

The name of associated key pair, if any.

locked body boolean

True if the instance is locked otherwise False.

New in version 2.9

locked_reason body string

The reason behind locking a server.

New in version 2.73

memory_mb body integer

The memory of this hypervisor (in MiB). This does not take allocation ratios used for overcommit into account so there may be disparity between this and the used count.

Available until version 2.87

metadata body object A dictionary of metadata key-and-value pairs, which is maintained for backward compatibility.
OS-DCF:diskConfig body string

Disk configuration. The value is either:

  • AUTO: The API builds the server with a single partition the size of the target flavor disk. The API automatically adjusts the file system to fit the entire partition.
  • MANUAL: The API builds the server by using the partition scheme and file system that is in the source image. If the target flavor disk is larger, The API does not partition the remaining disk space.
OS-EXT-AZ:availability_zone body string The availability zone name.
OS-EXT-SRV-ATTR:host body string The name of the compute host on which this instance is running. Appears in the response for administrative users only.
OS-EXT-SRV-ATTR:hostname (Optional) body string

The hostname set on the instance when it is booted. By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-SRV-ATTR:hypervisor_hostname body string The hypervisor host name provided by the Nova virt driver. For the Ironic driver, it is the Ironic node UUID. Appears in the response for administrative users only.
OS-EXT-SRV-ATTR:instance_name body string The instance name. The Compute API generates the instance name from the instance name template. Appears in the response for administrative users only.
OS-EXT-SRV-ATTR:kernel_id (Optional) body string

The UUID of the kernel image when using an AMI. Will be null if not. By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-SRV-ATTR:launch_index (Optional) body integer

When servers are launched via multiple create, this is the sequence in which the servers were launched. By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-SRV-ATTR:reservation_id (Optional) body string

The reservation id for the server. This is an id that can be useful in tracking groups of servers created with multiple create, that will all have the same reservation_id. By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-SRV-ATTR:ramdisk_id (Optional) body string

The UUID of the ramdisk image when using an AMI. Will be null if not. By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-SRV-ATTR:root_device_name (Optional) body string

The root device name for the instance By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-SRV-ATTR:user_data (Optional) body string

The user_data the instance was created with. By default, it appears in the response for administrative users only.

New in version 2.3

OS-EXT-STS:power_state body integer

The power state of the instance. This is an enum value that is mapped as:

0: NOSTATE
1: RUNNING
3: PAUSED
4: SHUTDOWN
6: CRASHED
7: SUSPENDED
8: SHUTDOWN_ACTIVE
OS-EXT-STS:task_state body string

The task state of the instance.

OS-EXT-STS:vm_state body string

The VM state.

os-extended-volumes:volumes_attached body array

The attached volumes, if any.

os-extended-volumes:volumes_attached.id body string

The attached volume ID.

os-extended-volumes:volumes_attached.delete_on_termination body boolean

A flag indicating if the attached volume will be deleted when the server is deleted. By default this is False.

New in version 2.3

OS-SRV-USG:launched_at body string

The date and time when the server was launched.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

If the deleted_at date and time stamp is not set, its value is null.

OS-SRV-USG:terminated_at body string

The date and time when the server was deleted.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

If the deleted_at date and time stamp is not set, its value is null.

description body string

The description of the server. Before microversion 2.19 this was set to the server name.

New in version 2.19

server_groups body array

The UUIDs of the server groups to which the server belongs. Currently this can contain at most one entry.

New in version 2.71

tags body array

A list of tags. The maximum count of tags in this list is 50.

New in version 2.26

trusted_image_certificates body array

A list of trusted certificate IDs, that were used during image signature verification to verify the signing certificate. The list is restricted to a maximum of 50 IDs. The value is null if trusted certificate IDs are not set.

New in version 2.63

progress (Optional) body integer A percentage value of the operation progress. This parameter only appears when the server status is ACTIVE, BUILD, REBUILD, RESIZE, VERIFY_RESIZE or MIGRATING.
status body string The server status.
tenant_id body string The UUID of the tenant in a multi-tenancy cloud.
updated body string

The date and time when the resource was updated.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

user_id body string The user ID of the user who owns the server.
fault (Optional) body object A fault object. Only displayed when the server status is ERROR or DELETED and a fault occurred.
fault.code body integer The error response code.
fault.created body string

The date and time when the exception was raised.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

fault.message body string The error message.
fault.details (Optional) body string The stack trace. It is available if the response code is not 500 or you have the administrator privilege
vcpu_model body object The description of the used virtual CPU model.
vcpus body integer The number of virtual CPUs that the server uses.

Status codes

Success

Code Reason
200 - OK Request was successful.

Error

Code Reason
401 - Unauthorized

User must authenticate before making a request.

403 - Forbidden

Policy does not allow current user to do this operation.

404 - Not Found

The requested resource could not be found.

Example

{
  "server": {
    "server_groups": [],
    "OS-EXT-STS:task_state": null,
    "addresses": {
      "private": [
        {
          "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:3b:ce:89",
          "version": 4,
          "addr": "192.168.128.20",
          "OS-EXT-IPS:type": "fixed"
        }
      ]
    },
    "links": [
      {
        "href": "https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/servers/bb4f4c8d-a6ca-4723-ace3-1683f54cca1e",
        "rel": "self"
      },
      {
        "href": "https://<node_IP_addr>:8774/f5d834d636c642c7bfe8af86139c6f26/servers/bb4f4c8d-a6ca-4723-ace3-1683f54cca1e",
        "rel": "bookmark"
      }
    ],
    "image": "",
    "OS-EXT-SRV-ATTR:user_data": null,
    "OS-EXT-STS:vm_state": "active",
    "OS-EXT-SRV-ATTR:instance_name": "instance-00000034",
    "OS-EXT-SRV-ATTR:root_device_name": "/dev/vda",
    "OS-SRV-USG:launched_at": "2021-02-09T20:50:19.000000",
    "flavor": {
      "ephemeral": 0,
      "ram": 512,
      "original_name": "tiny",
      "vcpus": 1,
      "extra_specs": {},
      "swap": 0,
      "disk": 0
    },
    "id": "bb4f4c8d-a6ca-4723-ace3-1683f54cca1e",
    "security_groups": [
      {
        "name": "default"
      }
    ],
    "description": "vm1",
    "host_status": "UP",
    "user_id": "ee8e3378b56145ba9989228db6cad4b8",
    "OS-EXT-SRV-ATTR:hostname": "vm1",
    "OS-DCF:diskConfig": "MANUAL",
    "memory_mb": 512,
    "accessIPv4": "",
    "accessIPv6": "",
    "OS-EXT-SRV-ATTR:reservation_id": "r-rq1oigx3",
    "progress": 0,
    "OS-EXT-STS:power_state": 1,
    "OS-EXT-AZ:availability_zone": "nova",
    "config_drive": "",
    "status": "ACTIVE",
    "OS-EXT-SRV-ATTR:ramdisk_id": "",
    "updated": "2021-02-09T20:50:18Z",
    "hostId": "02a55bdaebde6d78b39e8413ee3645b6da7ff04db2c2a950f1092162",
    "OS-EXT-SRV-ATTR:host": "node1.vstoragedomain",
    "OS-SRV-USG:terminated_at": null,
    "tags": [],
    "vcpu_model": {
      "vendor": null,
      "features": [],
      "mode": "host-model",
      "model": null,
      "arch": null,
      "match": "exact",
      "topology": {
        "nova_object.version": "1.0",
        "nova_object.changes": [
          "cores",
          "threads",
          "sockets"
        ],
        "nova_object.name": "VirtCPUTopology",
        "nova_object.data": {
          "cores": 1,
          "threads": 1,
          "sockets": 1
        },
        "nova_object.namespace": "nova"
      }
    },
    "key_name": null,
    "OS-EXT-SRV-ATTR:kernel_id": "",
    "locked": false,
    "hci_info": {
      "os_distro": "linux",
      "network": [
        {
          "port_security_enabled": true,
          "mac": "fa:16:3e:3b:ce:89",
          "emulation_type": "virtio",
          "network": {
            "bridge": "br-int",
            "label": "private",
            "meta": {
              "injected": true,
              "tunneled": true,
              "mtu": 1400,
              "physical_network": null,
              "tenant_id": "f5d834d636c642c7bfe8af86139c6f26"
            },
            "id": "bda82e1d-571d-4450-81cc-454808e8e68b",
            "subnets": [
              {
                "ips": [
                  {
                    "meta": {},
                    "type": "fixed",
                    "version": 4,
                    "address": "192.168.128.20",
                    "floating_ips": []
                  }
                ],
                "version": 4,
                "meta": {
                  "dhcp_server": "192.168.128.1"
                },
                "dns": [
                  {
                    "meta": {},
                    "type": "dns",
                    "version": 4,
                    "address": "0.0.0.0"
                  }
                ],
                "routes": [],
                "cidr": "192.168.128.0/24",
                "gateway": {
                  "meta": {},
                  "type": "gateway",
                  "version": null,
                  "address": null
                }
              }
            ]
          },
          "ips": [
            "192.168.128.20"
          ]
        }
      ],
      "boot_order": [
        "hd"
      ],
      "vzhardware": "1.0.2",
      "disks": [
        {
          "bus": "virtio",
          "address": "0000:00:06.0",
          "readonly": false,
          "physical_block_size": "4096",
          "device_type": "disk",
          "logical_block_size": "512",
          "serial": "380dd098-e53f-4e8e-ab37-109c4c564a53"
        }
      ],
      "required_traits": [],
      "os_type": "linux"
    },
    "image_metadata": {
      "os_distro": "linux",
      "image_validated": "yes",
      "container_format": "bare",
      "min_ram": "0",
      "disk_format": "qcow2",
      "base_image_ref": "200ab392-03ed-41ee-b889-b57d13962c01",
      "min_disk": "1",
      "os_type": "linux",
      "hw_disk_bus": "virtio"
    },
    "root_gb": 0,
    "OS-EXT-SRV-ATTR:hypervisor_hostname": "node1.vstoragedomain",
    "name": "vm1",
    "OS-EXT-SRV-ATTR:launch_index": 0,
    "created": "2021-02-09T20:50:05Z",
    "tenant_id": "f5d834d636c642c7bfe8af86139c6f26",
    "os-extended-volumes:volumes_attached": [
      {
        "id": "380dd098-e53f-4e8e-ab37-109c4c564a53",
        "delete_on_termination": true
      }
    ],
    "guest_agent": {
      "status": "unknown",
      "version": null
    },
    "vcpus": 1,
    "trusted_image_certificates": null,
    "metadata": {},
    "OS-EXT-SRV-ATTR:vm_mode": null
  }
}