Resizing is a process by which an Openstack Cloud VM is moved from one flavor to a larger flavor while retaining characteristics such as the IP address and installed Operating System.
This can also have the side effect of migrating a VM from one hardware type to another where a different flavor type is selected
Warning - This process is non reversible.
Warning - Resizing to a flavor that has no available capacity will result in an error. Be aware when resizing to large flavors - please consult with cloud team first if uncertain (cloud-support@stfc.ac.uk)
Warning - It is not currently possible to Resize VMs with attached GPUs. This is due to the GPU being effectively ‘hard linked’ to the Virtual Machine via PCI passthrough.
Warning - There are some potential issues with this process that may lead to data loss if not mitigated, see recommended action below.
Before We Start - Recommended Actions
If you run into any problems, or have feedback or suggestions for improvements to this document please submit a ticket to cloud-support@stfc.ac.uk
Shutting down your VM should not be necessary but does make use of a simpler process to perform the resize operation. This may lead to better results.
Due to a currently unresolved bug we strongly recommend that users snapshot any VM they need to resize before attempting the process. See the following document for guidance on this process:
Once snapshotted the section below on recovering from a failed resize will instruct you on how to use your snapshot to rebuild your VM in the event of a failure to resize.
In some cases snapshotting is not practical, usually where VMs have particularly large storage footprints or are using RAM particularly heavily. In this case it’s likely the snapshot process will just hang.
Where snapshotting is not practical we recommend architecting your services in such a way that you don’t rely on individual VMs and that your VMs are easily rebuilt in the event of issues. This can be achieved through the use of configuration management and/or designing services in a highly available manner for example.
Resizing a VM - Web Interface
Note - This process is only possible on openstack.stfc.ac.uk, our Openstack Horizon web interface. Resizing is not currently possible through the internally accessible cloud.stfc.ac.uk interface.
Take action as per the recommended actions above. We strongly recommend that, where practical, you snapshot your VM before commencing with the procedure detailed below.
Log into openstack.stfc.ac.uk and find your VM.
See the screenshot below to find the ‘Resize’ button in the dropdown to the right of your VM.
This will open a pop up menu (see below) where you can select the new flavor you want to resize to. Note that the flavor must be larger in all aspects - CPU, RAM, and Storage - you will receive an error should you select a smaller flavor.
Once you have selected a flavor please click the Resize button to begin the process.
After some time a ‘Confirm Resize/Migrate’ option will appear. At this point feel free to test your VM and if it’s working you can click the button to complete the process.
Openstack Command Line
See the following document for general guidance on getting started with the openstack command line:
Get the server ID for the VM you want to resize
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.
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 UUID. Note that there is a
--help
flag for this openstack command, as with all others.
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. The
watch -n 10
is optional and you can periodically rerun the rest of the command manually instead.
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 to complete the process if you are satisfied that the resize has completed successfully.
jward@SCLT302:~$ openstack server resize confirm 2081193e-0fa1-488d-96c9-d09575cd89cd
If you test the machine and note any issues you can revert the process at this point by using the following command instead.
jward@SCLT302:~$ openstack server resize revert 2081193e-0fa1-488d-96c9-d09575cd89cd