@@ -5,66 +5,113 @@ Select hosts where instances are launched
5
5
With the appropriate permissions, you can select which host instances are
6
6
launched on and which roles can boot instances on this host.
7
7
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.
11
10
12
- For example:
11
+ Using Explicit Host and/or Node
12
+ -------------------------------
13
13
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.
15
17
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".
19
20
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.
21
24
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:
25
26
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
30
28
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
33
32
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.
35
38
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 `_.
43
41
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
+ ------------------------------------------------------
46
44
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.
48
48
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.
56
52
53
+ For example:
57
54
58
- #. To view the list of valid compute nodes, use the :command: `openstack
59
- hypervisor list ` command.
55
+ .. code-block :: console
60
56
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
62
59
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