...
Get the server ID for the VM you want to resize
Code Block | ||
---|---|---|
| ||
jward@SCLT302:~$ openstack server list
+--------------------------------------+-------------+--------+-------------------------+-------------------------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+-------------+--------+-------------------------+-------------------------+----------+
| 2081193e-0fa1-488d-96c9-d09575cd89cd | Resize Test | ACTIVE | Internal=172.16.112.125 | scientificlinux-7-nogui | l3.nano |
+--------------------------------------+-------------+--------+-------------------------+-------------------------+----------+ |
Get the flavor ID for the target flavor you want to resize to. Note that the flavor must be larger in all aspects - CPU, RAM, and Storage - you should receive an error should you select a smaller flavor for use in the next step. The
--sort-column
flag can be useful here.
Code Block | ||
---|---|---|
| ||
jward@SCLT302:~$ openstack flavor list --sort-column VCPUs
+--------------------------------------+-------------+--------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+-------------+--------+------+-----------+-------+-----------+
| 9ac55db3-da5a-41c0-8310-5700db30eb30 | l3.nano | 8192 | 50 | 0 | 2 | True |
| 300f36c7-603d-4c69-80d1-1dc610c309b8 | l3.micro | 16384 | 100 | 0 | 4 | True |
| 6dcd1f3e-bd1d-43b9-9668-8e07735fb550 | l3.tiny | 30720 | 200 | 0 | 8 | True |
| eb971b0d-c346-449f-b847-e0446132881e | l2.tiny | 30720 | 200 | 0 | 8 | True |
| db52ac2a-e74a-4295-a121-d1cde14cc884 | g-a100.x1hm | 204800 | 1600 | 0 | 12 | False |
| 287460a2-b111-41b5-b464-1159bd19c935 | l2.xsmall | 61440 | 400 | 0 | 16 | True |
| e86db4f3-716f-476f-80a0-a883cba35e51 | l3.xsmall | 61440 | 400 | 0 | 16 | True |
| 28d9bca0-064f-45ad-ac49-470ab5ebbcd4 | le3.small | 125952 | 100 | 700 | 30 | True |
| 56786106-b241-4d27-893f-c81c8d57bd05 | l2.small | 125952 | 800 | 0 | 30 | True |
| 5fb2e47d-c76a-4781-9723-177eef5f9b36 | l3.small | 125952 | 800 | 0 | 30 | True |
| 79dc0b4d-df3f-482d-83ba-8a5747cf5423 | le2.small | 125952 | 100 | 700 | 30 | True |
| 30e59608-0764-4e09-99e3-aabac36c91af | le2.medium | 250880 | 100 | 1500 | 60 | True |
| a840beb4-ea6e-490d-a532-f159b46e15ec | le3.medium | 250880 | 100 | 1500 | 60 | True |
| ca49af18-c7bc-4f2c-8e6a-e8ff6fca2719 | l3.medium | 250880 | 1600 | 0 | 60 | True |
| d798a374-002e-4257-bdac-324723e8f0b5 | l2.medium | 250880 | 1600 | 0 | 60 | True |
| 0d2555d9-23dc-4b40-a2f4-d03281d58719 | le3.large | 501760 | 100 | 3100 | 124 | True |
| 2747dd70-8358-4732-b463-48df00367689 | l3.large | 501760 | 3200 | 0 | 124 | True |
| 42622a7d-e0a2-420f-8eb3-b68993704e7f | le2.large | 501760 | 100 | 3100 | 124 | True |
| a92c93eb-a44a-443f-93d1-59b92249a7ba | l2.large | 501760 | 3200 | 0 | 124 | True |
+--------------------------------------+-------------+--------+------+-----------+-------+-----------+ |
Run the following command to resize the VM to the flavor you want, using it’s UUIDreplacing the UUID and flavor to match your VM’s details. Note that there is a
--help
flag for this openstack command, as with all others.
Code Block |
---|
jward@SCLT302:~$ openstack server resize --flavor l3.tiny 2081193e-0fa1-488d-96c9-d09575cd89cd |
You can monitor the progress of the resize using the following command, again replacing the UUID. The
watch -n 10
is optional and you can periodically rerun the rest of the command manually instead.
Code Block |
---|
jward@SCLT302:~$ watch -n 10 openstack server show 2081193e-0fa1-488d-96c9-d09575cd89cd |
After a short while the VM state should change to
VERIFY_RESIZE
, at this point you can check the machine and run the following command with your VM’s UUID to complete the process if you are satisfied that the resize has completed successfully.
Code Block |
---|
jward@SCLT302:~$ openstack server resize confirm 2081193e-0fa1-488d-96c9-d09575cd89cd |
Note |
---|
If you test the machine and note any issues you can revert the process at this point by using the following command with your VM’s UUID instead. |
Code Block |
---|
jward@SCLT302:~$ openstack server resize revert 2081193e-0fa1-488d-96c9-d09575cd89cd |
...