Skip to content

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:

    $ openstack server show --fit-width <VM name>
    
    This is shown on the line marked 'flavor'.

  • Select a new flavor for the available flavors:

    $ openstack flavor list
    

To resize the virtual machine, run:

$ openstack server resize --flavor <new_flavor_name> <VM name>

Check the virtual machine status using:

$ openstack server show --fit-width <VM name>

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:

lscpu

If the resize operation worked as expected, confirm with the following command:

$ openstack server resize confirm <VM name>

If you identified any issue in the resized virtual machine, the operation can be rolled back. Use the following command:

$ openstack server resize revert <VM name>

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.

Resize Instance in Website

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

Menu with Resize operations

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

Confirm resize menualt text

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