Hello, and thanks for running Cloudbase-init!
The error would indicate that Azure did not set up any metadata sources for the VM, as it will only do so for VM images which have been both sysprep'd and generalized, so my current suspicion is that there was some misstep in the image building process.
I can confirm that Cloudbase-init successfully boots and sets up SSH/WinRM on Server 2022 on Azure with a freshly-built image, so I'm not sure what might have caused your exact issue.
Seeing as through the process of building Azure VM images is finicky and prone to issues, I recommend you try to automate as many steps of it as possible, and preferably directly on Azure instead of doing it locally and uploading a VHD.
You may find an unofficial set of Packer configurations in this repository maintained by a colleague of mine.
After installing Packer and the Azure az
CLI on your host machine, please follow the instructions shown in the README of the /packer
directory to build the image directly on Azure.
Some notes:
- You may update any Cloudbase-init configuration options before running the Packer image build.
- You may explicitly choose the version of the Cloudbase-init MSI or event a custom URL for the MSI you'd like to have installed in the image before building it. (though I'd recommend you use the current release)
- You may also change the base Windows image Packer should use, though I recommend only using official Server 2019/2022 images provided by Microsoft as a base.
- Packer uses Azure Vaults and some other resources not usually accessible by Service Principal accounts, so either create or update your account to allow for 'Microsoft.KeyVault/vaults/write' capabilities
- There's also a handy script to create a test VM from the image in the same repo.
Please let us know if you were able to successfully build/run your image.
Additionally, for posterity, could you please provide full details on your broken image like the build versions of Windows and Cloudbase-init, as well as exactly how you installed and configured Cloudbase-init within the image?
EDIT: removed note on inject_user_pass
setting, since the Cloudbase-init config in the linked repository has now been changed to always inject the password.