Merge "Example as code, documentation template for sphinx build"
[doctor.git] / manuals / mark-host-down_manual.rst
1 OpenStack NOVA API for marking host down.
2
3 Related Blueprints:
4
5   https://blueprints.launchpad.net/nova/+spec/mark-host-down
6   https://blueprints.launchpad.net/python-novaclient/+spec/support-force-down-service
7
8 What the API is for
9
10   This API will give external fault monitoring system a possibility of telling
11   OpenStack Nova fast that compute host is down. This will immediately enable
12   calling of evacuation of any VM on host and further enabling faster HA
13   actions.
14
15 What this API does
16
17   In OpenStack the nova-compute service state can represent the compute host
18   state and this new API is used to force this service down. It is assumed
19   that the one calling this API has made sure the host is also fenced or
20   powered down. This is important, so there is no chance same VM instance will
21   appear twice in case evacuated to new compute host. When host is recovered
22   by any means, the external system is responsible of calling the API again to
23   disable forced_down flag and let the host nova-compute service report again
24   host being up. If network fenced host come up again it should not boot VMs
25   it had if figuring out they are evacuated to other compute host. The
26   decision of deleting or booting VMs there used to be on host should be
27   enhanced later to be more reliable by Nova blueprint:
28   https://blueprints.launchpad.net/nova/+spec/robustify-evacuate
29
30 REST API for forcing down:
31
32   Parameter explanations:
33   tenant_id:       Identifier of the tenant.
34   binary:          Compute service binary name.
35   host:            Compute host name.
36   forced_down:     Compute service forced down flag.
37   token:           Token received after successful authentication.
38   service_host_ip: Serving controller node ip.
39
40   request:
41   PUT /v2.1/{tenant_id}/os-services/force-down
42   {
43   "binary": "nova-compute",
44   "host": "compute1",
45   "forced_down": true
46   }
47
48   response:
49   200 OK
50   {
51   "service": {
52   "host": "compute1",
53   "binary": "nova-compute",
54   "forced_down": true
55   }
56   }
57
58   Example:
59   curl -g -i -X PUT http://{service_host_ip}:8774/v2.1/{tenant_id}/os-services
60   /force-down -H "Content-Type: application/json" -H "Accept: application/json
61   " -H "X-OpenStack-Nova-API-Version: 2.11" -H "X-Auth-Token: {token}" -d '{"b
62   inary": "nova-compute", "host": "compute1", "forced_down": true}'
63
64 CLI for forcing down:
65
66   nova service-force-down <hostname> nova-compute
67
68   Example:
69   nova service-force-down compute1 nova-compute
70
71 REST API for disabling forced down:
72
73   Parameter explanations:
74   tenant_id:       Identifier of the tenant.
75   binary:          Compute service binary name.
76   host:            Compute host name.
77   forced_down:     Compute service forced down flag.
78   token:           Token received after successful authentication.
79   service_host_ip: Serving controller node ip.
80
81   request:
82   PUT /v2.1/{tenant_id}/os-services/force-down
83   {
84   "binary": "nova-compute",
85   "host": "compute1",
86   "forced_down": false
87   }
88
89   response:
90   200 OK
91   {
92   "service": {
93   "host": "compute1",
94   "binary": "nova-compute",
95   "forced_down": false
96   }
97   }
98
99   Example:
100   curl -g -i -X PUT http://{service_host_ip}:8774/v2.1/{tenant_id}/os-services
101   /force-down -H "Content-Type: application/json" -H "Accept: application/json
102   " -H "X-OpenStack-Nova-API-Version: 2.11" -H "X-Auth-Token: {token}" -d '{"b
103   inary": "nova-compute", "host": "compute1", "forced_down": false}'
104
105 CLI for disabling forced down:
106   nova service-force-down --unset <hostname> nova-compute
107
108   Example:
109   nova service-force-down --unset compute1 nova-compute