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: