Add differencing vhdx resize support in Hyper-V Driver¶
Differencing VHDX images can be resized, unlike differencing VHD images. Even so, the Nova Hyper-V driver currently does not support this.
This feature is required for resizing existing instances which use CoW VHDX images and also in order to resize the root disk image when spawning a new instance.
Currently, when using the Hyper-V Nova Driver and differencing (CoW) VHDX images for the instances, the differencing image will not get resized according to the flavor size. Instead, the VM root image will keep having the same size as the base image used when spawning a new instance.
Also, when trying to resize such an instance, not only that the disk image will not get resized, but this will actually raise an exception as currently the method which gets the internal maximum size of a vhd/vhdx does not support differencing images.
The solution is simply passing the desired size when creating a new differencing vhdx image. Not passing it will result in the new disk having the same size as the base image.
Also, it is required that the method which gets the internal maximum size of a vhdx to lookup the parent disk and return the according size instead of raising an exception.
Data model impact¶
REST API impact¶
Other end user impact¶
Other deployer impact¶
- Primary assignee:
Add a “size” argument to the create_differencing_vhd method.
Adapt the vmops module to specify the new size only if resize is required when booting a new instance using CoW vhdx images.
Lookup for the parent image and get the according size when getting the maximum internal size of a vhdx.
Adapt the vhdutils according methods in order to have the same method signatures and keep consistency.
Testing this feature will be covered by the Hyper-V CI.
Official VHDX format specs: http://www.microsoft.com/en-us/download/details.aspx?id=34750