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. RBD support is planned. 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. VMware support was also submitted and applied. 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.
We need to create a matrix here describing which formats support what. KVM supports resize for CLVM (grow/shrink) and QCOW2 (grow) online, Xen SRs support offline grow/shrink, VMware supports online grow.
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 |
XS only support volume size grow
XS doesn't support volume size shrink