• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. API Reference
  4. API
  5. BMS Lifecycle Management (Native OpenStack APIs)
  6. Querying Details About a BMS (Native OpenStack API)

Querying Details About a BMS (Native OpenStack API)

Function

This interface is used to query details about a BMS by the BMS ID. The interface version is v2.1 Querying with the micro version number is supported. Add a group of key-value pairs to the request header. The key is fixed at X-OpenStack-Nova-API-Version, and the value is the microversion number, for example 2.26 indicating that the microversion number is 2.26.

URI

GET /v2.1/{project_id}/servers/{server_id}

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the BMS ID.

Request Message

N/A

Response Message

  • Response parameters

    Parameter

    Type

    Description

    server

    Dictionary data structure [1]

    Specifies the BMS information.

    [1] server field data structure description

    Parameter

    Type

    Description

    name

    String

    Specifies the BMS name.

    id

    String

    Specifies the unique ID of the BMS.

    status

    String

    Specifies the BMS status.

    Value range:

    ACTIVE, BUILD, DELETED, ERROR, HARD_REBOOT, MIGRATING, PASSWORD, PAUSED, REBOOT, REBUILD, RESIZE, REVERT_RESIZE, SHUTOFF, SHELVED, SHELVED_OFFLOADED, SOFT_DELETED, SUSPENDED, and VERIFY_RESIZE

    created

    String:DateTime

    Specifies the time when the BMS was created.

    updated

    String:DateTime

    Specifies the time when the BMS was last updated.

    flavor

    Dictionary data structure [2]

    Specifies the BMS flavor information.

    image

    Dictionary data structure [3]

    Specifies the BMS image.

    tenant_id

    String

    Specifies the ID of the tenant to which the BMS belongs.

    key_name

    String

    Specifies the SSH key name.

    user_id

    String

    Specifies the ID of the user to which the BMS belongs.

    metadata

    Dictionary data structure [5]

    Specifies the BMS metadata.

    hostId

    String

    Specifies the host ID of the BMS.

    addresses

    Dictionary data structure [6]

    Specifies the BMS network address.

    security_groups

    List data structure [8]

    Specifies the list of security groups to which the BMS belongs.

    links

    List data structure [4]

    Specifies the shortcut links of the BMS.

    OS-DCF:diskConfig

    String

    Specifies the disk configuration mode. This is an extended attribute.

    OS-EXT-AZ:availability_zone

    String

    Specifies the AZ ID. This is an extended attribute.

    OS-EXT-SERVICE:service_state

    String

    Specifies the BMS service status. This is an extended attribute.

    OS-EXT-SRV-ATTR:host

    String

    Specifies the host name of the BMS. This is an extended attribute.

    OS-EXT-SRV-ATTR:hypervisor_hostname

    String

    Specifies the name of a host on the hypervisor. This is an extended attribute provided by the Nova virt driver.

    OS-EXT-SRV-ATTR:instance_name

    String

    Specifies the BMS ID. This is an extended attribute.

    OS-EXT-STS:power_state

    Integer

    Specifies the power status of the BMS. This is an extended attribute.

    Options: 0, 1, 2, 3, and 4

    • 0: pending
    • 1: running
    • 2: paused
    • 3: shutdown
    • 4: crashed

    OS-EXT-STS:task_state

    String

    Specifies the job status of the BMS. This is an extended attribute.

    Value range:

    SHOUTOFF, RESIZE, REBUILD, VERIFY_RESIZE, REVERT_RESIZE, PAUSED, MIGRATING, SUSPENDED, RESCUE, ERROR, DELETED, SOFT_DELETED, SHELVED, and SHELVED_OFFLOADED

    OS-EXT-STS:vm_state

    String

    Specifies the BMS status. This is an extended attribute.

    Value range:

    ACTIVE, BUILDING, STOPPED, RESIZED, PAUSED, SUSPENDED, RESCUED, ERROR, DELETED, SOFT_DELETED, SHELVED, SHELVED_OFFLOADED

    OS-SRV-USG:launched_at

    String:DateTime

    Specifies the time when the BMS was started. This is an extended attribute.

    OS-SRV-USG:terminated_at

    String:DateTime

    Specifies the time when the BMS was stopped. This is an extended attribute.

    os-extended-volumes:volumes_attached

    List data structure [9]

    Specifies information about the EVS disks attached to the BMS.

    accessIPv4

    String

    This is a reserved attribute.

    accessIPv6

    String

    This is a reserved attribute.

    fault

    Dictionary data structure [10]

    Specifies the fault cause. This is an optional returned attribute.

    config_drive

    String

    This is a reserved attribute.

    progress

    Integer

    This is a reserved attribute.

    description

    String

    Provides supplementary information about the pool.

    Added in micro version 2.19.

    host_status

    String

    Specifies the nova-compute status.

    • UP: The nova-compute 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.
    • Null: The BMS does not have host information.

    Added in micro version 2.16.

    OS-EXT-SRV-ATTR:hostname

    String

    Specifies the hostname of the BMS.

    Added in micro version 2.3.

    OS-EXT-SRV-ATTR:reservation_id

    String

    Specifies the reserved BMS IDs in the batch BMS creation scenario.

    Added in micro version 2.3.

    The public cloud system does not support this parameter.

    OS-EXT-SRV-ATTR:launch_index

    Int

    Specifies the BMS startup sequence in the batch BMS creation scenario.

    Added in micro version 2.3.

    The public cloud system does not support this parameter.

    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.

    Added in micro version 2.3.

    The public cloud system does not support this parameter.

    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.

    Added in micro version 2.3.

    The public cloud system does not support this parameter.

    OS-EXT-SRV-ATTR:root_device_name

    String

    Specifies the device name of the BMS system disk.

    Added in micro version 2.3.

    OS-EXT-SRV-ATTR:user_data

    String

    Specifies the user data specified during BMS creation.

    locked

    boolean

    Specifies whether a BMS is locked.

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

    Added in micro version 2.9.

    tags

    List <String>

    Specifies the BMS tag.

    Added in micro version 2.26.

    [2] flavor field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the ID of the BMS type.

    This field is not supported in microversions later than 2.47.

    links

    List data structure [4]

    Specifies the shortcut links of the BMS type.

    This field is not supported in microversions later than 2.47.

    vcpus

    Integer

    Specifies the number of CPU cores in the BMS flavor.

    This field is supported in microversions later than 2.47.

    ram

    Integer

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

    This field is supported in microversions later than 2.47.

    disk

    Integer

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

    This field is supported in microversions later than 2.47.

    ephemeral

    Integer

    This is a reserved attribute.

    This field is supported in microversions later than 2.47.

    swap

    Integer

    This is a reserved attribute.

    This field is supported in microversions later than 2.47.

    original_name

    String

    This is a reserved attribute.

    This field is supported in microversions later than 2.47.

    extra_specs

    dict

    Extended flavor field

    This field is supported in microversions later than 2.47.

    [3] image field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the ID of the BMS image.

    links

    List data structure [4]

    Specifies the shortcut links of the BMS image.

    [4] links field data structure description

    Parameter

    Type

    Description

    rel

    String

    Specifies the shortcut link marker name.

    href

    String

    Specifies the corresponding shortcut link.

    [5] metadata field data structure description

    Parameter

    Type

    Description

    User-defined field key and value pair

    String

    Specifies the key and value pair of the metadata.

    The maximum size for each metadata key and value pair is 255 bytes.

    [6] addresses field data structure description

    Parameter

    Type

    Description

    VPC ID

    List data structure [7]

    Specifies the ID of the VPC used by the BMS (the VPC name is a variable).

    The value in the data structure is assigned private IP addresses in the VPC.

    [7] VPC ID field data structure description

    Parameter

    Type

    Description

    addr

    String

    Specifies the IP address.

    version

    Integer

    Specifies the type of the IP address. The value can be 4 or 6.

    • 4: The type of the IP address is IPv4.
    • 6: The type of the IP address is IPv6.

    OS-EXT-IPS-MAC:mac_addr

    String

    Specifies the MAC address. This is an extended attribute.

    OS-EXT-IPS:type

    String

    Specifies the IP address assignment mode. This is an extended attribute.

    [8] security_groups field data structure description

    Parameter

    Type

    Description

    name

    String

    • If no security group is specified when you create the BMS, the default value is used.
    • If a security group is specified when you create the BMS, the value is the ID of the VPC to which the BMS belongs.

    [9] os-extended-volumes:volumes_attached field data structure description

    Parameter

    Type

    Description

    id

    String

    Specifies the EVS disk ID.

    delete_on_termination

    boolean

    Specifies whether the EVS disk is deleted together with the BMS.

    • true: Yes
    • false: No

    Added in micro version 2.3.

    [10] fault field data structure description

    Parameter

    Type

    Description

    message

    String

    Specifies the fault information.

    code

    Int

    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 time format.

  • Example response
    {
        "server": {
            "tenant_id": "c685484a8cc2416b97260938705deb65",
            "addresses": {
                "08a7715f-7de6-4ff9-a343-95ba4209f24a": [
    {
                        "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:0e:c3:77",
                        "OS-EXT-IPS:type": "fixed",
                        "addr": "192.168.0.107",
                        "version": 4
                    }
                ]
            },
            "metadata": {
                "op_svc_userid": "1311c433dd9b408886f57d695c229cbe"
            },
            "OS-EXT-STS:task_state": null,
            "OS-DCF:diskConfig": "MANUAL",
            "OS-EXT-AZ:availability_zone": "az1",
            "links": [
    {
                    "rel": "self",
                    "href": "https://openstack.example.com/v2.1/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd"
                },
    {
                    "rel": "bookmark",
                    "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd"
                    }
            ],
            "OS-EXT-STS:power_state": 1,
            "id": "95bf2490-5428-432c-ad9b-5e3406f869dd",
            "os-extended-volumes:volumes_attached": [
    {
                    "id": "dfa375b5-9856-44ad-a937-a4802b6434c3"
                },
    {
                    "id": "bb9f1b27-843b-4561-b62e-ca18eeaec417"
                },
    {
                    "id": "86e801c3-acc6-465d-890c-d43ba493f553"
                },
    {
                    "id": "0994d3ac-3c6a-495c-a439-c597a4f08fa6"
                    }
            ],
            "OS-EXT-SRV-ATTR:host": "bms.az1",
            "image": {
                "links": [
    {
                        "rel": "bookmark",
                        "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/images/1a6635d8-afea-4f2b-abb6-27a202bad319"
                    }
                ],
                "id": "1a6635d8-afea-4f2b-abb6-27a202bad319"
            },
            "OS-SRV-USG:terminated_at": null,
            "accessIPv4": "",
            "accessIPv6": "",
            "created": "2017-05-24T06:14:05Z",
            "hostId": "e9c3ee0fcc58ab6085cf30df70b5544eab958858fb50d925f023e53e",
            "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova004@2",
            "key_name": "KeyPair-JX",
            "flavor": {
                "links": [
    {
                        "rel": "bookmark",
                        "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/flavors/physical.83.medium"
                    }
                ],
                "id": "physical.83.medium"
            },
            "security_groups": [
    {
                    "name": "0011b620-4982-42e4-ad12-47c95ca495c4"
                    }
            ],
            "config_drive": "",
            "OS-EXT-STS:vm_state": "active",
            "OS-EXT-SRV-ATTR:instance_name": "instance-0000ebd3",
            "user_id": "1311c433dd9b408886f57d695c229cbe",
            "name": "bms-83",
            "progress": 0,
            "OS-SRV-USG:launched_at": "2017-05-25T03:40:25.066078",
            "updated": "2017-05-25T03:40:25Z",
            "status": "ACTIVE"
                    }
    }

Returned Values

See section Common Returned Values.