Add the ability to change Data Volume size after it has been created.
CloudStack controls volume size via disk offerings. This allows the CloudStack admin to choose what he/she wants to make available to end-users. As such, volume resize will be allowed between disk offerings with the same storage tag. for example, if an admin has defined a 5GB and a 10GB disk offering, a user can upgrade from the 5GB to the 10GB. If the admin has made a custom-sized disk offering available, then resize will work simply by specifying a new, larger size. Additionally, a data volume can be moved from a static disk offering to a custom disk offering with the size specified. This model allows those who may be billing by certain volume sizes/disk offerings to stick to that model, while allowing flexibility to migrate to whatever custom size necessary.
Functionality was originally written for the KVM hypervisor, with focus on qcow2 and CLVM online resize. We are planning on seeing if Wido wants to write RBD support into LibvirtComputingResource. Initially Xen supports volume resize with VM shut down, tested with local storage, and we will need support from Xen developers who are more familiar with SR capabilities to enhance this. We will also need to see about any changes necessary for the upcoming storage refactor, the idea is we can get this in and it will give us a functionality basis to work off of for the refactor.
The new call is 'resizeVolume', and the parameters are:
parameter |
description |
required |
---|---|---|
id |
data volume id |
true |
size |
new size in gigabytes (if custom disk offering) |
false |
diskofferingid |
disk offering to migrate volume to (if not currently custom offering) |
false |
shrinkok |
required boolean value, signing off confirmation on volume shrink (dangerous if admin doesn't know what they're doing) |
false |