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
686 stars 230 forks source link

Convert disk image false #359

Closed bds-hanhvu closed 3 years ago

bds-hanhvu commented 3 years ago

Hello,

I am using windows-openstack-imaging-tools to generate image of Windows Server 2012 R2 for MAAS.

I have tried several times, but it always show "False" at "Convert virtual disk image" step.

I check the qemu-img.exe, and it does exist in .\bin\

Please tell me did i do anything wrong?

In the config file, i change some things like below:

# The destination of the generated image.
image_path=D:\imgpath\win2012-image.raw.tgz

# Select between VHD, VHDX, QCOW2, VMDK or RAW formats.
virtual_disk_format=RAW

# 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

# This parameter can be set to either BIOS or UEFI.
disk_layout=UEFI

# If set to true, MAAS Windows curtin hooks will be copied to the image root directory.
install_maas_hooks=True

# Select between tar, gz, zip formats or any combination between these.
compression_format="tar.gz"

image

bds-hanhvu commented 3 years ago

i can manually format VHDX to RAW by this command image

ader1990 commented 3 years ago

Hello,

The False output is being generated by other commands, and should not be taken into account, the generation went fine.

bds-hanhvu commented 3 years ago

Thank you! Im going to generate new image and try it on MAAS :D

pankajmalhotra commented 3 years ago

@hahnvu Sorry to ask this question under this section, but how are you uploading windows image to MAAS ?

As when I am uploading the .tgz image which I created this tool and uploading the custom windows 2016 using following command maas maas boot-resources create name=windows/win2016 architecture=amd64/generic filetype=ddtgz content@=/home/maas/build-output/win2016-image.raw.tgz

I am getting following error, screenshot attached.

Screenshot 2021-08-11 124807 Screenshot 2021-08-11 124827

bds-hanhvu commented 3 years ago

Hi @pankajmalhotra,

I use this command to upload image file to MAAS: maas admin boot-resources create name=windows/win2012r2 architecture=adm64/generic filetype=tgz title="Windows Server 2012" content@=/home/hanhvd/win-img-bios.raw.tgz

After uploaded, there will be a file named "root-tgz" in this directory: /var/snap/maas/common/maas/boot-resources/current/windows/amd64/generic/win2012r2/uploaded/

I tried to deploy that image and have the same problem as you. After i checked the error log, i noticed that the client requests the image name "root-dd" instead of "root-tgz". So i rename the image file, from "root-tgz" to "root-dd", and it works 🤣

I think you should try it. I install MAAS using snap, if you install by deb, the directory path maybe different.

pankajmalhotra commented 3 years ago

thanks alot @hahnvu