Skip to content

Commit fd480a7

Browse files
zhubx007mriedem
authored andcommitted
Update AZ admin doc to mention the new way to specify hosts
Mention the new way to specify hosts where instances are launched. Compare with these two ways. Also fixed a few things in the existing docs: 1. Fixed the policy rule name for forced_host. 2. Updated the "openstack availability zone list" command to use the --compute option. 3. Replaced the "openstack host list" example with "openstack compute service list --service nova-compute" since the os-hosts API was deprecated in 2.43. Depends-On: https://review.opendev.org/#/c/669609/ Part of Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server Change-Id: Ic471c0621e15aa497d33ef010c7f87890508fbeb
1 parent 564290a commit fd480a7

File tree

1 file changed

+94
-47
lines changed

1 file changed

+94
-47
lines changed

doc/source/admin/availability-zones.rst

Lines changed: 94 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,113 @@ Select hosts where instances are launched
55
With the appropriate permissions, you can select which host instances are
66
launched on and which roles can boot instances on this host.
77

8-
#. To select the host where instances are launched, use the
9-
``--availability-zone ZONE:HOST:NODE`` parameter on the :command:`openstack
10-
server create` command.
8+
Starting with the 2.74 microversion, there are two ways to specify a host
9+
and/or node when creating a server.
1110

12-
For example:
11+
Using Explicit Host and/or Node
12+
-------------------------------
1313

14-
.. code-block:: console
14+
We can create servers by using explicit host and/or node. When we use this
15+
way to request where instances are launched, we will still execute scheduler
16+
filters on the requested destination.
1517

16-
$ openstack server create --image IMAGE --flavor m1.tiny \
17-
--key-name KEY --availability-zone ZONE:HOST:NODE \
18-
--nic net-id=UUID SERVER
18+
.. todo: mention the minimum required release of python-openstackclient for
19+
the --host and --hypevisor-hostname options to work with "server create".
1920
20-
.. note::
21+
- To select the host where instances are launched, use the ``--host HOST``
22+
and/or ``--hypervisor-hostname HYPERVISOR`` options on
23+
the :command:`openstack server create` command.
2124

22-
HOST and NODE are optional parameters. In such cases, use the
23-
``--availability-zone ZONE::NODE``, ``--availability-zone ZONE:HOST`` or
24-
``--availability-zone ZONE``.
25+
For example:
2526

26-
#. To specify which roles can launch an instance on a specified host, enable
27-
the ``create:forced_host`` option in the ``policy.json`` file. By default,
28-
this option is enabled for only the admin role. If you see ``Forbidden (HTTP
29-
403)`` in return, then you are not using admin credentials.
27+
.. code-block:: console
3028
31-
#. To view the list of valid zones, use the :command:`openstack availability
32-
zone list` command.
29+
$ openstack --os-compute-api-version 2.74 server create --image IMAGE \
30+
--flavor m1.tiny --key-name KEY --host HOST \
31+
--hypervisor-hostname HYPERVISOR --nic net-id=UUID SERVER
3332
34-
.. code-block:: console
33+
- To specify which roles can launch an instance on a specified host, enable
34+
the ``compute:servers:create:requested_destination`` rule in the
35+
``policy.json`` file. By default, this rule is enabled for only the admin
36+
role. If you see ``Forbidden (HTTP 403)`` in the response, then you are
37+
not using the required credentials.
3538

36-
$ openstack availability zone list
37-
+-----------+-------------+
38-
| Zone Name | Zone Status |
39-
+-----------+-------------+
40-
| zone1 | available |
41-
| zone2 | available |
42-
+-----------+-------------+
39+
- To view the list of valid compute hosts and nodes, you can follow
40+
`Finding Host and Node Names`_.
4341

44-
#. To view the list of valid compute hosts, use the :command:`openstack host
45-
list` command.
42+
[Legacy] Using Host and/or Node with Availability Zone
43+
------------------------------------------------------
4644

47-
.. code-block:: console
45+
We can create servers by using host and/or node with availability zone. When
46+
we use this way to select hosts where instances are launched, we will not run
47+
the scheduler filters.
4848

49-
$ openstack host list
50-
+----------------+-------------+----------+
51-
| Host Name | Service | Zone |
52-
+----------------+-------------+----------+
53-
| compute01 | compute | nova |
54-
| compute02 | compute | nova |
55-
+----------------+-------------+----------+
49+
- To select the host where instances are launched, use the
50+
``--availability-zone ZONE:HOST:NODE`` parameter on the :command:`openstack
51+
server create` command.
5652

53+
For example:
5754

58-
#. To view the list of valid compute nodes, use the :command:`openstack
59-
hypervisor list` command.
55+
.. code-block:: console
6056
61-
.. code-block:: console
57+
$ openstack server create --image IMAGE --flavor m1.tiny --key-name KEY \
58+
--availability-zone ZONE:HOST:NODE --nic net-id=UUID SERVER
6259
63-
$ openstack hypervisor list
64-
+----+---------------------+
65-
| ID | Hypervisor Hostname |
66-
+----+---------------------+
67-
| 1 | server2 |
68-
| 2 | server3 |
69-
| 3 | server4 |
70-
+----+---------------------+
60+
.. note::
61+
62+
HOST and NODE are optional parameters. In such cases, use the
63+
``--availability-zone ZONE::NODE``, ``--availability-zone ZONE:HOST`` or
64+
``--availability-zone ZONE``.
65+
66+
- To specify which roles can launch an instance on a specified host, enable
67+
the ``os_compute_api:servers:create:forced_host`` rule in the ``policy.json``
68+
file. By default, this rule is enabled for only the admin role. If you see
69+
``Forbidden (HTTP 403)`` in return, then you are not using the required
70+
credentials.
71+
72+
- To view the list of valid zones, use the :command:`openstack availability
73+
zone list --compute` command.
74+
75+
.. code-block:: console
76+
77+
$ openstack availability zone list --compute
78+
+-----------+-------------+
79+
| Zone Name | Zone Status |
80+
+-----------+-------------+
81+
| zone1 | available |
82+
| zone2 | available |
83+
+-----------+-------------+
84+
85+
- To view the list of valid compute hosts and nodes, you can follow
86+
`Finding Host and Node Names`_.
87+
88+
Finding Host and Node Names
89+
---------------------------
90+
91+
- To view the list of valid compute hosts, use the :command:`openstack compute
92+
service list --service nova-compute` command.
93+
94+
.. code-block:: console
95+
96+
$ openstack compute service list --service nova-compute
97+
+----+--------------+---------------+------+---------+-------+----------------------------+
98+
| ID | Binary | Host | Zone | Status | State | Updated At |
99+
+----+--------------+---------------+------+---------+-------+----------------------------+
100+
| 10 | nova-compute | compute01 | nova | enabled | up | 2019-07-09T03:59:19.000000 |
101+
| 11 | nova-compute | compute02 | nova | enabled | up | 2019-07-09T03:59:19.000000 |
102+
| 12 | nova-compute | compute03 | nova | enabled | up | 2019-07-09T03:59:19.000000 |
103+
+----+--------------+---------------+------+---------+-------+----------------------------+
104+
105+
- To view the list of valid compute nodes, use the :command:`openstack
106+
hypervisor list` command.
107+
108+
.. code-block:: console
109+
110+
$ openstack hypervisor list
111+
+----+---------------------+-----------------+---------------+-------+
112+
| ID | Hypervisor Hostname | Hypervisor Type | Host IP | State |
113+
+----+---------------------+-----------------+---------------+-------+
114+
| 6 | compute01 | QEMU | 172.16.50.100 | up |
115+
| 7 | compute02 | QEMU | 172.16.50.101 | up |
116+
| 8 | compute03 | QEMU | 172.16.50.102 | up |
117+
+----+---------------------+-----------------+---------------+-------+

0 commit comments

Comments
 (0)