Chuyển tới nội dung chính

Get VM Details

GET /v2.1/servers/{server_id}

To get detailed information about a specific virtual machine (VM), you can send a GET request to the /v2.1/servers/{server_id} endpoint of the compute service, replacing {server_id} with the actual ID of the VM you want to retrieve. This request requires an authentication token, which you should include in the request headers.

Request

Body Parameters

NameInTypeDescription
server_idpathstringThe UUID of the server.

Sample Request

Using curl

curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://api.vietnix.cloud:8774/v2.1/servers/{server_id}

Using HTTP request

GET https://api.vietnix.cloud:8774/v2.1/servers/{server_id}

Response

Parameters

NameInTypeDescription
serverbodyobjectA server object.
idbodystringThe UUID of the server.
linksbodyarrayLinks to the resources in question. See API Guide / Links and References for more info.
namebodystringThe server name.
accessIPv4bodystringIPv4 address that should be used to access this server. May be automatically set by the provider.
accessIPv6bodystringIPv6 address that should be used to access this server. May be automatically set by the provider.
addressesbodyobjectThe addresses for the server. Servers with status BUILD hide their addresses information.
security_groups (Optional)bodyarrayOne or more security groups objects.
security_groups.namebodystringThe security group name.
config_drivebodystringIndicates whether a config drive was used for this server. True or empty string (empty means False).
createdbodystringWhen the resource was created (ISO 8601, CCYY-MM-DDThh:mm:ss±hh:mm).
flavorbodyobjectBefore microversion 2.47: ID and links for the flavor (may be empty). As of 2.47: subset of the actual flavor info as a nested dictionary.
flavor.idbodystringThe ID of the flavor. Available until version 2.46.
flavor.linksbodyarrayLinks to the flavor resource. Available until version 2.46.
flavor.vcpusbodyintegerNumber of vCPUs allocated to the server. New in 2.47.
flavor.rambodyintegerRAM in MiB. New in 2.47.
flavor.diskbodyintegerRoot disk size in GiB. New in 2.47.
flavor.ephemeralbodyintegerEphemeral disk size in GiB. New in 2.47.
flavor.swapbodyintegerSwap disk size in MiB. New in 2.47.
flavor.original_namebodystringDisplay name of the flavor. New in 2.47.
flavor.extra_specs (Optional)bodyobjectFlavor extra-specs key/value pairs; included only if policy allows. New in 2.47.
flavor.extra_specs.keybodystringExtra spec key. New in 2.47.
flavor.extra_specs.valuebodystringExtra spec value. New in 2.47.
guest_agentbodyobjectThe guest tools connection state and version.
hci_infobodyobjectInformation about VM networks, disks, traits, and OS distribution.
hostIdbodystringHashed host identifier, unique per project; useful to check colocation within a project.
host_status (Optional)bodystringHost status: UP, UNKNOWN, DOWN, MAINTENANCE, or empty (no host). Appears only if policy permits. New in 2.16.
imagebodyobjectUUID and links for the image. Empty string when booted from a volume.
image_metadata (Optional)bodyobjectImage metadata key/value pairs (max 255 bytes per key and per value).
key_namebodystringName of the associated key pair, if any.
lockedbodybooleanTrue if the instance is locked; otherwise False. New in 2.9.
locked_reasonbodystringReason behind locking a server. New in 2.73.
memory_mbbodyintegerMemory of this hypervisor (MiB). Available until version 2.87.
metadatabodyobjectMetadata key/value pairs (maintained for backward compatibility).
OS-DCF:diskConfigbodystringDisk configuration: AUTO or MANUAL.
OS-EXT-AZ:availability_zonebodystringAvailability zone name (VHI returns default or null).
OS-EXT-SRV-ATTR:hostbodystringCompute host on which this instance is running (admin only).
OS-EXT-SRV-ATTR:hostname (Optional)bodystringHostname set on the instance (admin only). New in 2.3.
OS-EXT-SRV-ATTR:hypervisor_hostnamebodystringHypervisor host name (Ironic: node UUID) (admin only).
OS-EXT-SRV-ATTR:instance_namebodystringInstance name generated by the template (admin only).
OS-EXT-SRV-ATTR:kernel_id (Optional)bodystringKernel image UUID when using AMI; null otherwise (admin only). New in 2.3.
OS-EXT-SRV-ATTR:launch_index (Optional)bodyintegerLaunch sequence index for multi-create (admin only). New in 2.3.
OS-EXT-SRV-ATTR:reservation_id (Optional)bodystringReservation ID for the server (admin only). New in 2.3.
OS-EXT-SRV-ATTR:ramdisk_id (Optional)bodystringRamdisk image UUID when using AMI; null otherwise (admin only). New in 2.3.
OS-EXT-SRV-ATTR:root_device_name (Optional)bodystringRoot device name (admin only). New in 2.3.
OS-EXT-SRV-ATTR:user_data (Optional)bodystringuser_data provided at create (admin only). New in 2.3.
OS-EXT-STS:power_statebodyintegerPower state: 0 NOSTATE, 1 RUNNING, 3 PAUSED, 4 SHUTDOWN, 6 CRASHED, 7 SUSPENDED, 8 SHUTDOWN_ACTIVE.
OS-EXT-STS:task_statebodystringTask state of the instance.
OS-EXT-STS:vm_statebodystringVM state.
os-extended-volumes:volumes_attachedbodyarrayAttached volumes, if any.
os-extended-volumes:volumes_attached.idbodystringAttached volume ID.
os-extended-volumes:volumes_attached.delete_on_terminationbodybooleanWhether the volume is deleted with the server (default False). New in 2.3.
OS-SRV-USG:launched_atbodystringWhen the server was launched (ISO 8601); null if not set.
OS-SRV-USG:terminated_atbodystringWhen the server was deleted (ISO 8601); null if not set.
descriptionbodystringServer description. New in 2.19.
server_groupsbodyarrayUUIDs of server groups this server belongs to (max 1). New in 2.71.
tagsbodyarrayList of tags (max 50). New in 2.26.
trusted_image_certificatesbodyarrayTrusted certificate IDs used for image signature verification (max 50); null if not set. New in 2.63.
progress (Optional)bodyintegerPercent progress when status is ACTIVE, BUILD, REBUILD, RESIZE, VERIFY_RESIZE, or MIGRATING.
statusbodystringServer status.
tenant_idbodystringUUID of the tenant (project).
updatedbodystringWhen the resource was updated (ISO 8601, CCYY-MM-DDThh:mm:ss±hh:mm).
user_idbodystringID of the user who owns the server.
fault (Optional)bodyobjectFault object; shown when status is ERROR or DELETED and a fault occurred.
fault.codebodyintegerError response code.
fault.createdbodystringWhen the exception was raised (ISO 8601).
fault.messagebodystringError message.
fault.details (Optional)bodystringStack trace (available if response code is not 500 or you have admin privilege).
vcpu_modelbodyobjectDescription of the used virtual CPU model.
vcpusbodyintegerNumber of virtual CPUs the server uses.

Status Codes

Success

Status CodeDescription
200 - OKRequest was successful.

Error

Status CodeDescription
401 - UnauthorizedUser must authenticate before making a request.
403 - ForbiddenPolicy does not allow current user to do this operation.
404 - Not FoundThe requested resource could not be found.

Sample Response

{
"server": {
"id": "393210ad-152b-4ac3-a0f0-798ee4e93620",
"name": "Ubuntu22",
"status": "ACTIVE",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"user_id": "64166c7effeb4a89b59c073588099640",
"metadata": {
"ha_enabled": "True"
},
"hostId": "8832df28df03a13573bd7478e79d31483ce42e75c8d1a291f2d9637a",
"image": "",
"flavor": {
"id": "dee219cf-cd93-41c1-bae7-0c9874a0cc31",
"links": [
{
"rel": "bookmark",
"href": "https://api.vietnix.cloud:8774/flavors/dee219cf-cd93-41c1-bae7-0c9874a0cc31"
}
]
},
"created": "2025-09-22T02:43:51Z",
"updated": "2025-09-22T02:44:00Z",
"addresses": {
"test01": [
{
"version": 4,
"addr": "192.168.0.75",
"OS-EXT-IPS:type": "fixed",
"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:26:de:79"
}
]
},
"accessIPv4": "",
"accessIPv6": "",
"links": [
{
"rel": "self",
"href": "https://api.vietnix.cloud:8774/v2.1/servers/393210ad-152b-4ac3-a0f0-798ee4e93620"
},
{
"rel": "bookmark",
"href": "https://api.vietnix.cloud:8774/servers/393210ad-152b-4ac3-a0f0-798ee4e93620"
}
],
"OS-DCF:diskConfig": "MANUAL",
"progress": 0,
"OS-EXT-AZ:availability_zone": "nova",
"config_drive": "",
"key_name": "Docs Writter",
"OS-SRV-USG:launched_at": "2025-09-22T02:43:59.000000",
"OS-SRV-USG:terminated_at": null,
"security_groups": [
{
"name": "default"
}
],
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:power_state_reason": "unpaused",
"os-extended-volumes:volumes_attached": [
{
"id": "75a55d31-a6dc-48a2-82e2-3d6ac0f8a2bc",
"size": 10
}
],
"vcpu_model": {
"arch": null,
"vendor": null,
"topology": {
"nova_object.name": "VirtCPUTopology",
"nova_object.namespace": "nova",
"nova_object.version": "1.0",
"nova_object.data": {
"sockets": 1,
"cores": 2,
"threads": 1
},
"nova_object.changes": [
"threads",
"sockets",
"cores"
]
},
"features": [],
"mode": "host-model",
"model": null,
"match": "exact"
},
"image_metadata": {
"image_validated": "yes",
"os_distro": "ubuntu22.04",
"hci_allow_set_password": "True",
"os_admin_user": "root",
"min_ram": "0",
"min_disk": "10",
"disk_format": "qcow2",
"container_format": "bare",
"base_image_ref": "41ecdf81-c112-4231-9fea-049e70f3b564",
"hw_machine_type": "pc-q35-vz9.0.0",
"hw_vif_multiqueue_enabled": "True"
},
"required_traits": [],
"hci_info": {
"network": [
{
"mac": "fa:16:3e:26:de:79",
"emulation_type": "virtio",
"ips": [
"192.168.0.75"
],
"network": {
"id": "8ae2b710-ad3d-469e-a75a-c3e203887d2e",
"bridge": "br-int",
"label": "test01",
"subnets": [
{
"cidr": "192.168.0.0/24",
"dns": [
{
"address": "8.8.8.8",
"type": "dns",
"version": 4,
"meta": {}
}
],
"gateway": {
"address": "192.168.0.1",
"type": "gateway",
"version": 4,
"meta": {}
},
"ips": [
{
"address": "192.168.0.75",
"type": "fixed",
"version": 4,
"meta": {},
"floating_ips": []
}
],
"routes": [],
"version": 4,
"meta": {
"dhcp_server": "192.168.0.2"
}
}
],
"meta": {
"injected": true,
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"mtu": 8913,
"physical_network": null,
"tunneled": true
}
},
"port_security_enabled": true
}
],
"boot_order": [
"hd"
],
"vzhardware": "2.0.1",
"max_mem": null,
"max_vcpu": null,
"has_pci_devices": false
},
"memory_mb": 2048,
"vcpus": 2,
"root_gb": 0,
"guest_agent": {
"status": "connected",
"version": "7.22-1.vz7"
},
"username": "root",
"allow_set_password": true
}
}