1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
11 https://blueprints.launchpad.net/nova/+spec/get-valid-server-state
16 Previously when the owner of a VM has queried his VMs, he has not received
17 enough state information, states have not changed fast enough in the VIM and
18 they have not been accurate in some scenarios. With this change this gap is now
21 A typical case is that, in case of a fault of a host, the user of a high
22 availability service running on top of that host, needs to make an immediate
23 switch over from the faulty host to an active standby host. Now, if the compute
24 host is forced down [1] as a result of that fault, the user has to be notified
25 about this state change such that the user can react accordingly. Similarly,
26 a change of the host state to "maintenance" should also be notified to the
32 A new ``host_status`` parameter is added to the ``/servers/{server_id}`` and
33 ``/servers/detail`` endpoints in microversion 2.16. By this new parameter
34 user can get additional state information about the host.
36 ``host_status`` possible values where next value in list can override the
39 - ``UP`` if nova-compute is up.
40 - ``UNKNOWN`` if nova-compute status was not reported by servicegroup driver
41 within configured time period. Default is within 60 seconds,
42 but can be changed with ``service_down_time`` in nova.conf.
43 - ``DOWN`` if nova-compute was forced down.
44 - ``MAINTENANCE`` if nova-compute was disabled. MAINTENANCE in API directly
45 means nova-compute service is disabled. Different wording is used to avoid
46 the impression that the whole host is down, as only scheduling of new VMs
48 - Empty string indicates there is no host for server.
50 ``host_status`` is returned in the response in case the policy permits. By
51 default the policy is for admin only in Nova policy.json::
53 "os_compute_api:servers:show:host_status": "rule:admin_api"
55 For an NFV use case this has to also be enabled for the owner of the VM::
57 "os_compute_api:servers:show:host_status": "rule:admin_or_owner"
62 Case where nova-compute is enabled and reporting normally::
64 GET /v2.1/{tenant_id}/servers/{server_id}
74 Case where nova-compute is enabled, but not reporting normally::
76 GET /v2.1/{tenant_id}/servers/{server_id}
81 "host_status": "UNKNOWN",
86 Case where nova-compute is enabled, but forced_down::
88 GET /v2.1/{tenant_id}/servers/{server_id}
93 "host_status": "DOWN",
98 Case where nova-compute is disabled::
100 GET /v2.1/{tenant_id}/servers/{server_id}
105 "host_status": "MAINTENANCE",
110 Host Status is also visible in python-novaclient::
112 +-------+------+--------+------------+-------------+----------+-------------+
113 | ID | Name | Status | Task State | Power State | Networks | Host Status |
114 +-------+------+--------+------------+-------------+----------+-------------+
115 | 9a... | vm1 | ACTIVE | - | RUNNING | xnet=... | UP |
116 +-------+------+--------+------------+-------------+----------+-------------+
121 [1] Manual for OpenStack NOVA API for marking host down
122 http://artifacts.opnfv.org/doctor/docs/manuals/mark-host-down_manual.html
124 [2] OpenStack compute manual page
125 http://developer.openstack.org/api-ref-compute-v2.1.html#compute-v2.1