cloudbase / windows-imaging-tools

Tools to automate the creation of a Windows image for OpenStack, supporting KVM, Hyper-V, ESXi and more.
Apache License 2.0
680 stars 227 forks source link

Format of outputted image does not correspond format specified in config #376

Open DohouM opened 1 year ago

DohouM commented 1 year ago

Hello,

I am currently using windows-imaging-tools to create images for an Openstack infrastructure. However, I'm hitting a little quirk that proves to be annoying. I am trying to generate a MAAS image with a QCOW2 format, to prevent conversion from RAW to QCOW2 by the Nova service. However, the following lines in the script are preventing me from doing so : https://github.com/cloudbase/windows-imaging-tools/blob/58b91df9218cd2a353c5da65030feada246f5bbc/WinImageBuilder.psm1#L1919-L1953

Here's a snippet of my config :

...
# Select between VHD, VHDX, QCOW2, VMDK or RAW formats.
virtual_disk_format=QCOW2
# This parameter allows to choose between MAAS, KVM, VMware and Hyper-V specific images.
# For HYPER-V, cloudbase-init will be installed and the generated image should be in vhd or vhdx format.
# For MAAS, in addition to cloudbase-init, the curtin tools are installed
# and the generated image should be in raw.tgz format.
# For KVM, in addition to cloudbase-init, the VirtIO drivers are installed
# and the generated image should be in qcow2 format.
image_type=MAAS
...

A possible solution to this specific problem would be to add a new parameter, called force_virtual_disk_format, which would bypass this implicit conversion.

Thanks in advance for your response !