Updated on 2024-09-27 GMT+08:00

Querying BMS Details

Function

This API is used to query BMS details.

The information that can be queried includes the BMS billing mode and whether the BMS is frozen.

URI

GET /v1/{project_id}/baremetalservers/{server_id}

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

server_id

Yes

Specifies the BMS ID.

You can obtain the BMS ID from the BMS console or by calling the Querying BMSs (Native OpenStack API).

Request Parameters

None

Example Request

Querying details about a BMS (ID: 53206ed0-56de-4d6b-b7ee-ffc62ca26f43)
1
GET https://{BMS Endpoint}/v1/bbf1946d374b44a0a2a95533562ba954/baremetalservers/53206ed0-56de-4d6b-b7ee-ffc62ca26f43

Response Parameters

Parameter

Type

Description

server

Object

Specifies BMS information. For details, see Table 2.

Table 2 server field data structure description

Parameter

Type

Description

id

String

Specifies the BMS ID in UUID format.

user_id

String

Specifies the ID of the user to which the BMS belongs. The value is in UUID format.

name

String

Specifies the BMS name.

created

String

Specifies the time when the BMS was created.

The timestamp format is YYYY-MM-DDTHH:MM:SSZ (ISO 8601), for example, 2019-05-22T03:30:52Z.

updated

String

Specifies the time when the BMS was updated.

The timestamp format is YYYY-MM-DDTHH:MM:SSZ (ISO 8601), for example, 2019-05-22T04:30:52Z.

tenant_id

String

Specifies the ID of the tenant owning the BMS. The value is in UUID format.

This parameter specifies the same meaning as project_id.

hostId

String

Specifies the host ID of the BMS.

addresses

Map<String,Array of address objects>

Specifies the VPC used by the BMS.

key: indicates the ID of the VPC used by the BMS.

value indicates the VPC details.

key_name

String

Specifies the key pair that is used to authenticate the BMS.

image

Object

Specifies the BMS image. For details, see Table 4.

flavor

Object

Specifies the BMS flavor. For details, see Table 6.

security_groups

Array of objects

Specifies the security groups to which the BMS belongs. For details, see Table 7.

accessIPv4

String

This is a reserved attribute.

accessIPv6

String

This is a reserved attribute.

status

String

Specifies the BMS status.

Value range:

  • ACTIVE: Running, Stopping, Deleting
  • BUILD: Creating
  • ERROR: Faulty
  • HARD_REBOOT: Forcibly Restarting
  • REBOOT: Restarting
  • SHUTOFF: Stopped, Starting, Deleting, Rebuilding, Reinstalling OS, OS Reinstallation Failed, Frozen

progress

Integer

This is a reserved attribute.

config_drive

String

Specifies whether to configure the config drive partition for the BMS.

The value can be True or an empty string.

metadata

object

Specifies the BMS metadata. For details, see Table 11.

NOTE:

Metadata includes system default fields and the fields set by users.

OS-EXT-STS:task_state

String

Specifies the BMS task status. This is an extended attribute. Examples:

  • rebooting: The BMS is being restarted.
  • reboot_started: The BMS is normally restarted.
  • reboot_started_hard: The BMS is forcibly restarted.
  • powering-off: The BMS is being powered off.
  • powering-on: The BMS is being powered on.
  • rebuilding: The BMS is being rebuilt.
  • scheduling: The BMS is being scheduled.
  • deleting: The BMS is being deleted.

OS-EXT-STS:vm_state

String

Specifies the BMS status. This is an extended attribute. Examples:

  • active: The BMS is running.
  • stopped: The BMS is stopped.

OS-EXT-SRV-ATTR:host

String

Specifies the hostname of the BMS. This is an extended attribute.

OS-EXT-SRV-ATTR:instance_name

String

Specifies the BMS alias. This is an extended attribute.

OS-EXT-STS:power_state

Integer

Specifies the BMS power status. This is an extended attribute. Examples:

  • 0: indicates NO STATE.
  • 1: indicates RUNNING.
  • 4: indicates SHUTDOWN.

OS-EXT-SRV-ATTR:hypervisor_hostname

String

Specifies the hostname of the hypervisor.

OS-EXT-AZ:availability_zone

String

Specifies the AZ where the BMS is located.

OS-DCF:diskConfig

String

Specifies the disk configuration. This is an extended attribute. The value can be:

  • MANUAL: The API uses the partitioning scheme in the image and the file system to create a BMS. If the target flavor has a large disk, the API does not partition the remaining disk space.
  • AUTO: The API uses a single partition with the same size as the disk of the target flavor to create a BMS. The API automatically adjusts the file system to adapt to the entire partition.

fault

Object

Specifies the cause of a BMS fault. For details, see Table 8.

OS-SRV-USG:launched_at

String

Specifies the time when the BMS was started.

The timestamp format is ISO 8601, for example, 2019-05-22T03:23:59.000000.

OS-SRV-USG:terminated_at

String

Specifies the time when the BMS was deleted.

The timestamp format is ISO 8601, for example, 2019-05-22T04:23:59.000000.

os-extended-volumes:volumes_attached

Array of objects

Specifies the disks attached to the BMS. For details, see Table 9.

description

String

Specifies BMS information.

host_status

String

Specifies the status of the host that accommodates the BMS.

  • UP: The nova-compute status is normal.
  • UNKNOWN: The nova-compute status is unknown.
  • DOWN: the nova-compute status is abnormal.
  • MAINTENANCE: The nova-compute is in the maintenance state.
  • Empty string: The BMS does not have host information.

OS-EXT-SRV-ATTR:hostname

String

Specifies the hostname of the BMS.

OS-EXT-SRV-ATTR:reservation_id

String

Specifies the reserved BMS IDs in a batch creation situation.

When BMSs are created in a batch, they have the same reservation_id.

OS-EXT-SRV-ATTR:launch_index

Integer

Specifies the BMS startup sequence in a batch creation situation.

OS-EXT-SRV-ATTR:kernel_id

String

Specifies the UUID of the kernel image when the AMI image is used. In other scenarios, leave this parameter blank.

OS-EXT-SRV-ATTR:ramdisk_id

String

Specifies the UUID of the Ramdisk image when the AMI image is used. In other scenarios, leave this parameter blank.

OS-EXT-SRV-ATTR:root_device_name

String

Specifies the device name of the BMS system disk, for example, /dev/sda.

OS-EXT-SRV-ATTR:user_data

String

Specifies the user_data specified during BMS creation. The value is encoded using Base64 or an empty string.

locked

Boolean

Specifies whether the BMS is locked.

  • true: The BMS is locked.
  • false: The BMS is not locked.

tags

Array of strings

Specifies tags of the BMS.

os:scheduler_hints

Object

Specifies scheduling information of the BMS. For details, see Table 10.

enterprise_project_id

String

Specifies the ID of the enterprise project to which the BMS belongs.

sys_tags

Array of objects

Specifies system tags of the BMS. For details, see Table 12.

Table 3 address field data structure description

Parameter

Type

Description

version

String

Specifies the IP address version.

  • 4: indicates IPv4.
  • 6: indicates IPv6.

addr

String

Specifies the IP address.

OS-EXT-IPS:type

String

Specifies the IP address type.

  • fixed: indicates the private IP address.
  • floating: indicates the EIP.

OS-EXT-IPS-MAC:mac_addr

String

Specifies the MAC address.

OS-EXT-IPS:port_id

String

Specifies the port ID corresponding to the IP address.

Table 4 image field data structure description

Parameter

Type

Description

id

String

Specifies the image ID in UUID format.

Table 5 links field data structure description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Specifies the corresponding shortcut link.

Table 6 flavor field data structure description

Parameter

Type

Description

id

String

Specifies the flavor ID of the BMS.

name

String

Specifies the flavor name of the BMS.

disk

String

Specifies the system disk size in the BMS flavor. The value 0 indicates that the disk size is not limited.

vcpus

String

Specifies the number of CPU cores in the BMS flavor.

ram

String

Specifies the memory size (MB) in the BMS flavor.

gpus

Array of objects

Specifies the GPU information in the BMS flavor. For details, see Table 13.

asic_accelerators

Array of objects

Specifies the ASIC information in the BMS flavor. For details, see Table 14.

Table 7 security_groups field data structure description

Parameter

Type

Description

name

String

Specifies the security group name.

id

String

Specifies the security group ID.

Table 8 fault field data structure description

Parameter

Type

Description

message

String

Specifies the fault information.

code

Integer

Specifies the fault code.

details

String

Specifies the fault details.

created

String

Specifies the time when the fault occurred. The time is in ISO 8601 format.

Table 9 os-extended-volumes:volumes_attached field data structure description

Parameter

Type

Description

id

String

Specifies the disk ID in UUID format.

delete_on_termination

String

Specifies whether to delete the disk when deleting the BMS.

  • true: Yes
  • false: No

bootIndex

String

Specifies whether it is a boot disk. 0 specifies a boot disk, and -1 specifies a non-boot disk.

device

String

Specifies the device name of the disk, for example, /dev/sdb.

Table 10 os:scheduler_hints field data structure description

Parameter

Type

Description

dec_baremetal

Array of strings

Specifies whether to create the BMS in a DeC. The value can be share or dedicate.

Table 11 metadata field data structure description

Parameter

Type

Description

chargingMode

String

Specifies the billing type of the BMS.

1: yearly/monthly billing mode (pre-paid)

metering.order_id

String

Specifies the order ID for a yearly/monthly BMS.

metering.product_id

String

Specifies the product ID for a yearly/monthly BMS.

vpc_id

String

Specifies the ID of the VPC where the BMS is located.

metering.image_id

String

Specifies the image ID of the BMS.

metering.imagetype

String

Specifies the image type. The following types are supported:

  • Public image: The value is gold.
  • Private image: The value is private.
  • Shared image: The value is shared.

baremetalPortIDList

String

Specifies NICs of the BMS.

metering.resourcespeccode

String

Specifies the flavor code of the BMS in {Flavor ID}.{os_type} format, for example, physical.o2.medium.linux.

metering.resourcetype

String

Specifies the resource type of the BMS. The value is __type_baremetal.

image_name

String

Specifies the image name of the BMS.

op_svc_userid

String

Specifies the user ID. You can obtain the user ID from My Credential on the management console.

os_type

String

Specifies the OS type. The value can be Linux or Windows.

__bms_support_evs

String

Specifies whether the BMS supports EVS disks.

os_bit

String

Specifies the number of bits in the OS: 32 or 64.

Table 12 sys_tags field data structure description

Parameter

Type

Description

key

String

Specifies the key of a system tag. The value is _sys_enterprise_project_id, indicating an enterprise project ID.

value

String

Specifies the system tag value.

Table 13 gpus field data structure description

Parameter

Type

Description

name

String

Specifies the GPU name.

count

Integer

Specifies the number of GPUs.

memory_mb

Integer

Specifies the GPU memory size, in MB.

Table 14 asic_accelerators field data structure description

Parameter

Type

Description

name

String

Specifies the ASIC name.

count

Integer

Specifies the number of ASICs.

memory_mb

Integer

Specifies the ASIC memory size, in MB.

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
    "server": {
        "id": "53206ed0-56de-4d6b-b7ee-ffc62ca26f43",
        "name": "bms-test",
        "addresses": {
            "5849fdf1-9d79-4589-80c2-fe557990c417": [
                {
                    "version": "4",
                    "addr": "192.168.1.216",
                    "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:25:56:c3",
                    "OS-EXT-IPS:port_id": "9e62503b-094e-4c6e-bc95-f10bbfb455d5",
                    "OS-EXT-IPS:type": "fixed"
                },
                {
                    "version": "4",
                    "addr": "10.154.72.77",
                    "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:25:56:c3",
                    "OS-EXT-IPS:port_id": "9e62503b-094e-4c6e-bc95-f10bbfb455d5",
                    "OS-EXT-IPS:type": "floating"
                }
            ]
         },
        "flavor": {
            "disk": "9309",
            "vcpus": "32",
            "ram": "193047",
            "id": "physical.o2.medium",
            "name": "physical.o2.medium",
            "gpus": [{
              "name":"Nvidia Tesla V100S 32GB",
              "count":8,
              "memory_mb":32768
            }],
            "asic_accelerators": []
        },
        "accessIPv4": "",
        "accessIPv6": "",
        "status": "ACTIVE",
        "progress": 0,
        "hostId": "cd243addb5d2c64e89218180b7a3ed95abe6882e81c337cc563137df",
        "updated": "2018-09-18T09:29:44Z",
        "created": "2018-09-18T02:43:26Z",
        "metadata": {
            "metering.order_id": "CS1809181040HCFC2",
            "metering.image_id": "8589958c-6bc7-40c6-b81b-3fe4cd2e3d85",
            "baremetalPortIDList": "[9e62503b-094e-4c6e-bc95-f10bbfb455d5]",
            "metering.resourcespeccode": "physical.o2.medium.linux",
            
            "image_name": "redhat_7_2",
            "op_svc_userid": "745973c535ec4d4caba86f6f9419ff6d",
            "metering.resourcetype": "__type_baremetal",
            
            "metering.product_id": "00301-74069-0--0",
            "os_bit": "64",
            "vpc_id": "5849fdf1-9d79-4589-80c2-fe557990c417",
            "os_type": "Linux",
            "chargingMode": "1"
        },
        "tags": [
            "__type_baremetal"
        ],
        "description": "bms-6e18",
        "locked": false,
        "image": {
            "id": "8589958c-6bc7-40c6-b81b-3fe4cd2e3d85"
        },
        "config_drive": "",
        "tenant_id": "bbf1946d374b44a0a2a95533562ba954",
        "user_id": "3fc5ab2b0c544979abcaafd86edd80e6",
        "OS-EXT-STS:power_state": 1,
        "OS-EXT-STS:vm_state": "active",
        "OS-EXT-SRV-ATTR:host": "bms.dc1",
        "OS-EXT-SRV-ATTR:instance_name": "instance-00154f94",
        "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova002@2",
        "OS-DCF:diskConfig": "MANUAL",
        "OS-EXT-AZ:availability_zone": "az-dc-1",
        "os:scheduler_hints": {
         },
        "OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
        "OS-EXT-SRV-ATTR:ramdisk_id": "",
        "enterprise_project_id": "2c7b6d77-9013-4d74-a221-2f612fc56372",
        "OS-EXT-SRV-ATTR:user_data": "$USER_DATA",
        "OS-SRV-USG:launched_at": "2018-09-18T02:46:07.954587",
        "OS-EXT-SRV-ATTR:kernel_id": "",
        "OS-EXT-SRV-ATTR:launch_index": 0,
        "host_status": "UP",
        "OS-EXT-SRV-ATTR:reservation_id": "r-08tuyo8v",
        "OS-EXT-SRV-ATTR:hostname": "bms-6e18",
        "sys_tags": [
            {
                "key": "_sys_enterprise_project_id",
                "value": "2c7b6d77-9013-4d74-a221-2f612fc56372"
            }
        ]
    }
}

Returned Values

Normal values

Returned Values

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.