18
18
But to scale the services running on OpenStack, sometimes even OpenStack itself has to
19
19
be scaled. This means nodes for computing or storage have to be added.
29
25
To list the hosts and the nova-related services that run on them call:
33
+------------------+-------------+----------+
34
| host_name | service | zone |
35
+------------------+-------------+----------+
36
| devstack-grizzly | conductor | internal |
37
| devstack-grizzly | compute | nova |
38
| devstack-grizzly | cert | internal |
39
| devstack-grizzly | network | internal |
40
| devstack-grizzly | scheduler | internal |
41
| devstack-grizzly | consoleauth | internal |
42
+------------------+-------------+----------+
30
+---------------+-------------+----------+
31
| host_name | service | zone |
32
+---------------+-------------+----------+
33
| mystack-alpha | conductor | internal |
34
| mystack-alpha | compute | nova |
35
| mystack-alpha | cert | internal |
36
| mystack-alpha | network | internal |
37
| mystack-alpha | scheduler | internal |
38
| mystack-alpha | consoleauth | internal |
39
+---------------+-------------+----------+
45
43
To get a summary of resource usage of all of the instances running on the host call:
48
$ nova host-describe devstack-grizzly
49
+------------------+----------------------------------+-----+-----------+---------+
50
| HOST | PROJECT | cpu | memory_mb | disk_gb |
51
+------------------+----------------------------------+-----+-----------+---------+
52
| devstack-grizzly | (total) | 2 | 4003 | 157 |
53
| devstack-grizzly | (used_now) | 3 | 5120 | 40 |
54
| devstack-grizzly | (used_max) | 3 | 4608 | 40 |
55
| devstack-grizzly | b70d90d65e464582b6b2161cf3603ced | 1 | 512 | 0 |
56
| devstack-grizzly | 66265572db174a7aa66eba661f58eb9e | 2 | 4096 | 40 |
57
+------------------+----------------------------------+-----+-----------+---------+
46
nova host-describe mystack-alpha
48
+---------------+----------------------------------+-----+-----------+---------+
49
| HOST | PROJECT | cpu | memory_mb | disk_gb |
50
+---------------+----------------------------------+-----+-----------+---------+
51
| mystack-alpha | (total) | 2 | 4003 | 157 |
52
| mystack-alpha | (used_now) | 3 | 5120 | 40 |
53
| mystack-alpha | (used_max) | 3 | 4608 | 40 |
54
| mystack-alpha | b70d90d65e464582b6b2161cf3603ced | 1 | 512 | 0 |
55
| mystack-alpha | 66265572db174a7aa66eba661f58eb9e | 2 | 4096 | 40 |
56
+---------------+----------------------------------+-----+-----------+---------+
60
60
This information will help explain how this host is used.
124
129
+----------------------------------+-----------+--------------+-----------+---------------+
127
**TODO** How to interpret this information to know when to scale?
132
### Change server size
134
In case an image size doesn't match your needs anymore you're able to resize it. First
135
list your available flavors.
139
+----+-----------+-----------+------+-----------+------+-------+-------------+
140
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor |
141
+----+-----------+-----------+------+-----------+------+-------+-------------+
142
| 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 |
143
| 2 | m1.small | 2048 | 10 | 20 | | 1 | 1.0 |
144
| 3 | m1.medium | 4096 | 10 | 40 | | 2 | 1.0 |
145
| 4 | m1.large | 8192 | 10 | 80 | | 4 | 1.0 |
146
| 5 | m1.xlarge | 16384 | 10 | 160 | | 8 | 1.0 |
147
+----+-----------+-----------+------+-----------+------+-------+-------------+
150
Now you can show the information for the server you want to resize with:
153
$ nova show 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5
154
+------------------------+----------------------------------------------------------+
156
+------------------------+----------------------------------------------------------+
157
| OS-DCF:diskConfig | MANUAL |
158
| OS-EXT-STS:power_state | 1 |
159
| OS-EXT-STS:task_state | None |
160
| OS-EXT-STS:vm_state | active |
161
| OS-EXT-SRV-ATTR:host | mystack-alpha |
165
| created | 2012-05-09T15:47:48Z |
166
| flavor | m1.small |
167
| hostId | de0c201e62be88c61aeb52f51d91e147acf6cf2012bb57892e528487 |
168
| id | 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 |
169
| image | maverick-image |
172
| name | myCirrosServer |
173
| private network | 172.16.101.6 |
175
| public network | 10.4.113.6 |
177
| tenant_id | e830c2fbb7aa4586adf16d61c9b7e482 |
178
| updated | 2012-05-09T15:47:59Z |
179
| user_id | de3f4e99637743c7b6d27faca4b800a9 |
180
+------------------------+----------------------------------------------------------+
183
Here in the example the flavor is `m1.small`. To resize it to `m1.medium` you need
184
the server's ID and the ID of the flavor:
187
$ nova resize 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 3
190
Now the `list` command shows the changed status:
194
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
195
| ID | Name | Status | Task State | Power State | Networks |
196
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
197
| 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 | myCirrosServer | RESIZE | None | Running | private=10.0.0.3 |
198
| 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | myInstanceFromVolume | ACTIVE | None | Running | private=10.0.0.4 |
199
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
202
Once this operation finished the status changes to `VERIFY_RESIZE`. You have to confirm
203
that this operation has been successful:
206
$ nova resize-confirm 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5
209
In case the resizing hasn't been successful you can revert it by executing:
212
$ nova resize-revert 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5
215
In both cases, the server status should go back to `ACTIVE`.
217
### Adding compute nodes
131
219
Adding compute nodes is straightforward. They are easily picked up by the existing
132
220
installation. Simply call:
135
juju add-unit nova-compute:
223
juju add-unit nova-compute
226
### Migrate instances to other nodes
228
OpenStack allows to migrate instances between nodes, e.g. in case of an overall
229
too high load on the current node. You alreade know the commands `list` and `show`
230
to retrieve information about your instance. To list the possible nodes
234
nova-manager service list
235
mystack-alpha nova-scheduler enabled :-) None
236
mystack-alpha nova-network enabled :-) None
237
mystack-alpha nova-compute enabled :-) None
238
mystack-bravo nova-compute enabled :-) None
239
mystack-charlie nova-compute enabled :-) None
242
Here we will choose `mystack-charlie` as migration target, `nova-compute`
243
is running on this system. First let's have a look if the node has
247
nova-manage service describe_resource mystack-charlie
249
HOST PROJECT cpu mem(mb) hdd
250
mystack-charlie(total) 16 32232 878
251
mystack-charlie(used_now) 13 21284 442
252
mystack-charlie(used_max) 13 21284 442
253
mystack-charlie p1 5 10240 150
254
mystack-charlie p2 5 10240 150
258
These values show the physical resources and their usage.
260
- The `cpu` column shows the number of cpu.
261
- The `mem(mb)` column is the total amount of memory (MB).
262
- The `hdd' column shows the total amount of space for NOVA-INST-DIR/instances (GB).
263
- 1st line shows total amount of resource physical server has.
264
- 2nd line shows current used resource.
265
- 3rd line shows maximum used resource.
266
- 4th line and under is used resource per project.
268
If those values show that our instance fits on that system we can
272
nova live-migration 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 mystack-charlie
274
Migration of 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 initiated.