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