Resizing a server
This guide will walk you through the required steps to change the number of CPU cores and the amount of memory your server has access to, this is done by changing the server’s flavor.
Resize (or Server resize) is the ability to change the flavor of a server, thus allowing it to upscale or downscale according to user needs. A resize operation is a two-step process for the user:
- Initiate the resize.
- Either confirm (verify) success and release the old server, or declare a revert to release the new server and restart the old one.
Prerequisites
You need to have a server you wish to resize. Additionally, if you prefer to work with the OpenStack CLI, then make sure to properly enable it first.
Listing available flavors
Navigate to the server list.
Find the server you want to resize in the list, and on the right-hand side click on its menu button.
Click on Modify Server.
On this panel near the top, find the section called Flavor. This is the current flavor used by the server. Press on the dropdown menu to see all available flavors.
To list all available flavors you can simply run openstack flavor
list
, but that will return a very long unsorted list, instead we
recommend the following command:
openstack flavor list -c Name -f value | grep '[0-9]c[0-9]' | sort -V
The printout is a simple and clean list, sorted by the compute type, the number of cores and then by the amount of memory.
b.1c1gb
b.1c2gb
b.1c4gb
b.2c2gb
b.2c4gb
b.2c8gb
b.2c16gb
b.4c4gb
...
Initiating the resize
Choose a new flavor that you want your server to use instead.
A resize is only possible with flavors using the same prefix letter. Most commonly you will have a
b.
flavor, thus you must select anotherb.
flavor.
Once selected, the Resize button will appear.
Click on it to start the resize.
While the resize is ongoing you will see a spinning circle saying Resize is in progress.
To start the resize use the following command:
openstack server resize --flavor <new_flavor> <server_id>
While the resize is ongoing the server should have the
OS-EXT-STS:task_state
of resize_migrating
and the status
of
RESIZE
.
openstack server show -c OS-EXT-STS:task_state -c OS-EXT-STS:vm_state -c status <server_id>
+-----------------------+------------------+
| Field | Value |
+-----------------------+------------------+
| OS-EXT-STS:task_state | resize_migrating |
| OS-EXT-STS:vm_state | active |
| status | RESIZE |
+-----------------------+------------------+
You may proceed with the next step once your server status is
VERIFY_RESIZE
.
+-----------------------+---------------+
| Field | Value |
+-----------------------+---------------+
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | resized |
| status | VERIFY_RESIZE |
+-----------------------+---------------+
The resize process might take a minute or more. Cleura Cloud will now make a restore point in case the resize process fails. It would then restore your server to the state it was before the resize.
Confirming the resize
Your server is now using the new flavor you selected earlier, and you need to make sure the server is working as intended after the resize.
Once you are certain your server is working as intended, you should confirm the resize. If you do not confirm the resize, your server will automatically have the resize confirmed after 24 hours.
This is done by clicking the Confirm button.
If your server is not working as intended, or you simply regret the resize, instead click Cancel.
This is done by using the following command:
openstack server resize confirm <server_id>
Alternatively, if your server is not working as intended, revert the resize with the following command:
openstack server resize revert <server_id>
This concludes the process of resizing a server in Cleura Cloud.