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.

Problem description

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.

Proposed change

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


Security impact


Notifications impact


Other end user impact


Performance Impact


Other deployer impact


Developer impact




Primary assignee:


Work Items

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.

Documentation Impact