New Question

Revision history [back]

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:

  • The repo will configure Cloudbase-init to set a random user password by default, so you will need to do one of the following:
    • change said config value before building the image
    • set up an SSH key for access when creating a VM from the image
    • manually update the password on a created VM the fact using: - az vm user update -g $RG_NAME -n $VM_NAME -u $ADMIN_USERNAME -p $ADMIN_PASSWORD
  • You may explicitly choose the version of the Cloudbase-Init installation MSI you'd like to have installed in the image before building it. (though I'd recommend you just leave the default of 1.1.4)
  • 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?

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:

  • The repo will configure Cloudbase-init to set a random user password by default, so you will need to do one of the following:
    • change said config value before building the image
    • set up an SSH key for access when creating a VM from the image
    • manually update the password on a created VM after the fact using: - az vm user update -g $RG_NAME -n $VM_NAME -u $ADMIN_USERNAME -p $ADMIN_PASSWORD
  • You may explicitly choose the version of the Cloudbase-Init installation MSI you'd like to have installed in the image before building it. (though I'd recommend you just leave the default of 1.1.4)
  • 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?

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:

  • The repo will configure You may update any Cloudbase-init to set a random user password by default, so you will need to do one of the following:
    • change said config value before building the image
    • set up an SSH key for access when creating a VM from the image
    • manually update the password on a created VM after the fact using: - az vm user update -g $RG_NAME -n $VM_NAME -u $ADMIN_USERNAME -p $ADMIN_PASSWORD
    configuration options before running the Packer image build.
  • You may explicitly choose the version of the Cloudbase-Init installation MSI you'd like to have installed in the image before building it. (though I'd recommend you just leave the default of 1.1.4)
  • 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 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.

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:

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.