Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to convert vhdx file in raw format during create-windows-online-cloud-image.ps1 process #387

Open
reckful666 opened this issue Dec 18, 2023 · 6 comments

Comments

@reckful666
Copy link

Hi,

I try to generate windows 11 Pro image for openstack platform.

I already tried to generate a qcow2 image with create-windows-online-cloud-image.ps1 script but the server creation with this image failed in openstack. (too many attempts)

Now, I try to generate a raw file with the create-windows-online-cloud-image.ps1 script, but at the end process, it fails too

18/12/2023 15:10:06 - Could not retrieve VM runtime logs
18/12/2023 15:10:07 - Could not retrieve VM runtime logs
18/12/2023 15:10:08 - Could not retrieve VM runtime logs
18/12/2023 15:10:09 - Could not retrieve VM runtime logs
18/12/2023 15:10:10 - Could not retrieve VM runtime logs
18/12/2023 15:10:11 - Shrinking VHD to minimum size
18/12/2023 15:10:11 - Initial VHD size is: 30 GB
18/12/2023 15:10:17 - Current partition size: 29.998046875 GB
18/12/2023 15:10:17 - New partition size: 21 GB
18/12/2023 15:10:17 - Size increased: 22548578304
18/12/2023 15:10:19 - Final disk size: 21.001953125 GB
18/12/2023 15:10:22 - Converting VHD to RAW
18/12/2023 15:10:22 - Convert Virtual Disk: C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx...
18/12/2023 15:10:22 - Converting virtual disk image from C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx to C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw...
AVERTISSEMENT : Failed to run: C:\Users\micka\windows-openstack-imaging-tools\bin\qemu-img.exe convert -O raw C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw
AVERTISSEMENT : Failed to run: C:\Users\micka\windows-openstack-imaging-tools\bin\qemu-img.exe convert -O raw C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw
AVERTISSEMENT : Failed to run: C:\Users\micka\windows-openstack-imaging-tools\bin\qemu-img.exe convert -O raw C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw
18/12/2023 15:10:35 - Failed to run: C:\Users\micka\windows-openstack-imaging-tools\bin\qemu-img.exe convert -O raw C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw
Failed to run: C:\Users\micka\windows-openstack-imaging-tools\bin\qemu-img.exe convert -O raw C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw
Au caractère C:\Users\micka\windows-openstack-imaging-tools\WinImageBuilder.psm1:1068 : 13
+             Throw ("Failed to run: " + ($Command -Join " "))
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Failed to run: ...11_Pro_23H2.raw:String) [], RuntimeException
    + FullyQualifiedErrorId : Failed to run: C:\Users\micka\windows-openstack-imaging-tools\bin\qemu-img.exe convert -O raw C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.raw

Thanks for the help

@reckful666
Copy link
Author

When I try to execute the qemu-img convert command manually :

error while writing sector 0: Input/output error

@ader1990
Copy link
Member

Hello,

You should still have C:\Users\micka\windows-openstack-imaging-tools\Windows_11_Pro_23H2.vhdx.
If you need to convert it to .raw file, make sure you have enough free space, as the raw image type needs its exact size free: Final disk size: 21.001953125 GB

@reckful666
Copy link
Author

Thank you very much, I will try to upload it to openstack and create instance with it.

@reckful666
Copy link
Author

It seems to work well ! But I can't connect to the instance, I don't find the good password for admin account.
I tried the password in UnattendTemplate.xml file and config file.

@ader1990
Copy link
Member

Hello,

I think this blog post might give some clarity on how the password part works: https://cloudbase.it/openstack-windows-admin-password/

Thanks.

@reckful666
Copy link
Author

Thanks a lot again, the nova get-password works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants