Resize a VM

You can change the size of an instance by changing its flavor.

Warning

This is not reversible! Rebuilding Instances can result in loss of data. You should always refer to Creating Snapshots from Instance to backup your data.

Note

This rebuilds the instance and therefore results in a restart

Web Interface

  1. Log-in to the STFC cloud (https://openstack.stfc.ac.uk/)

  2. In the Web Interface, Go to ComputeInstances

  3. Shut down the Instance and create a snapshot to prevent data loss.

  4. Click the drop-down menu on the right-hand side (in Actions column) and select RESIZE INSTANCE

  1. Select the new flavor from the drop-down menu in the pop-up. Click on the RESIZE button.

Command-line

Note

See Using OpenStack Command-line Interface on how to set-up the command line client.

  1. Get the serverID (the VM to resize) and flavorID

$ openstack server list
+--------------------------------------+--------------------------+---------+----------------------------------------+---------------------------------------------------------+--------------+
| ID                                   | Name                     | Status  | Networks                               | Image                                                   | Flavor       |
+--------------------------------------+--------------------------+---------+----------------------------------------+---------------------------------------------------------+--------------+
| b5acb398-76b4-48fe-9b9a-d480636fdfd9 | test-rebuild             | SHUTOFF | Internal=172.16.101.195                | ubuntu-focal-20.04-gui                                  | c3.small     |
+--------------------------------------+--------------------------+---------+----------------------------------------+---------------------------------------------------------+--------------+
$ openstack flavor list
+--------------------------------------+--------------+--------+------+-----------+-------+-----------+
| ID                                   | Name         |    RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+--------------+--------+------+-----------+-------+-----------+
| 6cf0813c-1ba2-4999-b7eb-34d71a2a4199 | c3.medium    |   8192 |   40 |         0 |     4 | True      |
+--------------------------------------+--------------+--------+------+-----------+-------+-----------+
  1. Run

openstack server resize --flavor <falvor-id> <server-id>

Example

$ openstack server resize --flavor 6cf0813c-1ba2-4999-b7eb-34d71a2a4199 b5acb398-76b4-48fe-9b9a-d480636fdfd9