-
Notifications
You must be signed in to change notification settings - Fork 177
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
Cannot deploy image after successful build. Is this an issue in windows packer template file. #278
Comments
Hi! Can you open a pull request so that we can more easily see the changes you made here? Thanks! |
Fixed some typos post which able to build the image:
The installation finished but OS failed to come up with below errors: |
Hello Everyone! Please note that Windows images are not tar.gz. They are DD images and need to be imported accordingly in MAAS. Please see the README file for an example also this:
|
@alanbach : I created dd image from the template in the repo, still after deploying getting the same error: 'Unable to mount root fs on unknown block' |
I was able to successfully build image and tested successful deployment on a proxmox VM. Attaching the modified packer file in txt format as github allow limited file extensions for upload. But I think there is some issue on baremetal servers. My two dedicated servers wont go past windows logo. probably bios setting but I doubt it. I have uefi boot enabled, secure boot disabled, and disabled TPM on server and everything works fine in VM. but different story on a baremetal. |
@alanbach You can upload successfully but you will run into error "This does not look like a tar archive" while deployment. Hence the whole thread. |
@MggMuggins Updated the main thread with a notepad file. rename it and rebuild the image and try deployment then. |
@iamtinu : I uploaded the image using below command: maas admin boot-resources create name='windows/win2k19' title='Windows Server 2019' architecture='amd64/generic' filetype='ddtgz' content@=/home/devops/windows2019.dd.tar.gz and I'm using KVM with maas latest version to commission the machine, but got same error. |
I cant test on KVM I am using another proxmox server and two baremetal servers. worked for me. |
Did it work for you on baremetal ? Since I also tried on baremetal, operating system got installed but failed to come up : |
on baremetal my OS installs. that specific error is related to uefi I think. check TPM disabled, CSM disabled, uefi on and correct boot partition is marked as second boot option after setting network boot as first. I think you already installed OS just boot problem. in your previous logs I can also see PERC H755 Front so ensure drivers for the disk controller (PERC H755 Front) are loaded. Check with: If the drivers for PERC H755 are missing, rebuild the initramfs: Missing Bootloader or EFI Files. The EFI partition (/dev/sda1) was wiped and likely not re-populated with GRUB/bootloader files. |
This issue is stale because it has been open for 30 days with no activity. |
Hi everyone. In my case (baremetal), using the built-in packer windows template script resulted in a failed deployment in maas, it didn't even start to download the image and just gave the error This does not look like a tar archive. After replacing the template script with the one in the .txt file above, recreating the image, uploading it to maas and retrying the deployment it actually downloaded the image this time, but then I got these and a failed deployment again:
|
Hello @tdtmusic2 Looking at the above logs, the deployment is failing due to curtin directory missing in the image. I do see your image was uploaded as a dd image which is correct, however the missing curtin directory usually means the build process was never fully completed. Would you please re-run the build process, increase the timeout from the default 1 hour and watch the process closely to see if you get errors / interruptions at any stage? |
Hello. This is the output from the building process, it seems fine to me since it reports success but maybe I'm missing something:
|
Thank you @tdtmusic2! This build looks clean however there are circumstances where deleting and re-importing an image in MAAS does not actually refresh the images cached on Rack Controllers if the same name was used. Do you mind deleting the image, then uploading it using a different name (name= parameter)? Add a suffix of some sort to make it unique then try the deployment again. |
Hi Alan. Did that, but unfortunatelly it's the same result, not sure if the logs are identical but here's the output:
|
Hello @tdtmusic2 This error is a different issue! It looks like for some reason the image is missing cloud-base-init:
Note that Internet connectivity is needed for the build process to be able to download all the needed artifacts. If the build VM does have internet, I recommend either watching the build process in |
Hello. I actually needed to set headless to true so I can get a vnc port to connect to, so I did just that. The Windows setup starts, completes the first phase, reboots, then does the preparing devices thing and reboots again. And then it boots all the way into Windows, Administratot login. A powershell instance starts and downloads some things, then a sysprep prompt shows up, with "Processing generalize phase Sysprep plugins" and after that the vm shuts down. Everything seems fine to me for this part. Also in the terminal all seems good. Here are some screenshots of the process. |
Hello @tdtmusic2 These actually look pretty clean. Do you want to delete the old image from MAAS and upload this new one and re-test? Please do use a different name (name=windowssever2022v2 or something like that) to make sure the image is actually replaced on the Rack Controllers. Generally it is always a good practice to use unique names in the images. Also the dd slowness at the end is a normal behavior. Another question: From the logs, this seems to be Windows Server 2022 (please correct me if I am wrong). What ISO did you use for this? (Just curious) |
I did that but unfortunatelly it ended prettty much the same way, Failed to find cloudbase-init install destination. You're right, it's a Windows Server 2022, the iso is the official one from Microsoft's evaluation site. I'll try a different version, like 2019, to see if it's the same result. Later edit: Exactly the same error with a 2025 version. |
No idea what could've caused this but trying on a different physical server worked, I already tested all versions of Windows Server since 2016. There is one small issue though, MaaS remains in Deploying (Rebooting) status sometimes and after a while it goes into Failed deployment, even if the OS is installed and running fine for a while. I don't think this breaks anything but I don't think it should happen. Can you please give me some more details about "Also the dd slowness at the end is a normal behavior."? |
Hello @tdtmusic2 Glad to hear finally some progress! Regarding the machines getting into failed deployed even though the actual deployment was fine, I'd say check the cloud-init logs they should have hints as to why the post process failed. Another Question: Is the machine hostname, IP address etc correctly set? dd slowness is about the deployment progress you mentioned that goes initially really fast and gets sluggish at the 98%-100%. That is normal and is not an indication of anything being wrong. |
You mean the deployed server? Yes, it has the correct hostname and ip, MaaS takes care of those and never had issues. |
The default template file for windows creates a successful build on an ubuntu 24 VM but the build image gives error that:
tar: This does not look like a tar archive
So I figured the error tar This does not look like a tar archive indicates that the downloaded image is not in the expected format (likely not a valid .tar.gz or .tgz archive).
Broken Pipe: The Cannot write to ‘-’ (Broken pipe) error occurs because tar exited prematurely due to the invalid archive format, breaking the data stream to dd.
Filesystem Not Found:
After the failure, no partitions or filesystems are found on /dev/sda, causing the deployment to fail entirely.
I modified default packer file to make a new image file and successfully deployed on a raid filesystem. Can be deployed on other disk layouts too.
Changes :
Filename Updated:
Changed the output filename to .tar.gz for better compatibility with MAAS.
tar.gz Compression:
Updated the post-processor section to compress the output using tar -czf, which produces a .tar.gz file MAAS can decompress
Dynamic Filesystem Mounting:
The mount command now dynamically attempts to mount common filesystem types (ntfs, ext4, vfat) for adding curtin hooks.
Added Output Sync:
Added explicit sync commands to ensure file operations are flushed before moving to the next step.
below is the changed file for successful image building and successful deployment.
windows.pkr.hcl.txt
uploaded instead of pasting code : rename .txt to windows.pkr.hcl. Recreate the image and reupload using
maas yourprofile boot-resources create
name='windows/windows-server'
title='Windows Server 2016'
architecture='amd64/generic'
filetype='ddtgz'
content@=2016.dd.tar.gz
update : dont change filetype while uploading image from ddtgz to tgz
Thank You
The text was updated successfully, but these errors were encountered: