Resizing VMs
It may happen that a virtual machine needs more resources, for example additional storage or more RAM.
In OpenStack you can select existing Flavors or create new, custom flavors with our MyEngineers®.
Resizing vCPUs and RAM
Resizing in Horizon
- Log in to Horizon.
- Switch to the Instance Overview. (Compute > Instances)
- Open the dropdown menu of the desired machine.
- Select Resize Instance.
- In New Flavor choose the desired flavor.
- Click Resize.
- Wait until the operation is finished.
- Confirm resize/migration.
- The machine will be automatically powered on again.
- After it boots, verify with
df -hthat the size increase has been applied. - If the disk was not enlarged, you can adjust the partition with parted/fdisk or restart the VM if a downtime is planned.
Resizing VM storage
CPU and RAM are automatically adjusted when resizing a VM. The storage size is only increased when it is SSD storage.
If you use Ceph volumes as VM storage, additional steps are required (see below).
Resizing Ceph and SSD Volumes
When expanding a volume no restart is required. However, you must manually adjust the partition size and the filesystem.
If a VM still shows the old storage size after its volumes have been expanded, you need to make the following changes.
Manual changes to partitions/filesystems
Before manually adjusting partitions and filesystems you should always create a current snapshot.
-
Check available disks
You can list the disks of a VM, for example, withlsblk: -
Adjust the partition(s) with
gdiskpshows the partition tableddeletes an existing partitionncreates a new partition with maximum sizewwrites the changes
-
Reload the partition table and enlarge the filesystem
-
Verify the successful resize
The partitions should now display the new sizes.
Resizing via the OpenStack CLI
Since a newer API version, resizing can also be performed directly through the OpenStack CLI – also without shutting down the VM: