Resizing a Virtual Machine
If the flavor of a virtual machine needs to be changed, such as adding more memory or vCPUs, this can be done using the resize operation.
Using resize, you can select a new flavor for your virtual machine. This is an offline operation, meaning that the virtual machine will be shutdown, configured with the new flavor properties and booted again. Depending on the size of the virtual machine size, this operation can take several minutes.
Note
It's only recommended to increase the size of the virtual machine, ie. from a smaller to a larger flavor.
Resizing a VM from the command line
Before resizing,
-
Check the current size of the VM using:
This is shown on the line marked 'flavor'. -
Select a new flavor for the available flavors:
To resize the virtual machine, run:
Check the virtual machine status using:
During the operation, the virtual machine status will display "RESIZE". This can take several minutes. When it finishes, the status will change to "VERIFY_RESIZE".
Log in to the virtual machine and confirm that the resize operations have worked.
For example:
If the resize operation worked as expected, confirm with the following command:
If you identified any issue in the resized virtual machine, the operation can be rolled back. Use the following command:
Resizing a VM using the website
Log into the openstack website and select the project where the virtual machine is located. Then select Project, Compute and then Instances in the Menu on the left.
Once you have the list of VMs, click on the arrow in the actions menu for the VM and click on RESIZE_INSTANCE A pop up menu will appear, select the flavor you would like to use and click resize
Depending of the VM size, the resize operation may take up to 8 hours Once it is completed the machine will change the state to VERIFY_RESIZE
Connect to the virtual machine and confirm that the resize operations have worked.
If the resize operation worked as expected, click on CONFIRM_RESIZE If you identified any issue in the resized virtual machine, click on REVERT