Hello Jaco,
The error message you're seeing indicates that Azure Local is attempting to reference a Gallery Image named Ubuntu-2404, but it doesn't exist or is not correctly registered in the local image gallery. To resolve this, you need to register the VHD-based image as a custom gallery image in your Azure Local environment. Ensure the VHD is generalized using cloud-init or waagent -deprovision+user. Follow think doc- https://learn.microsoft.com/en-us/azure/azure-local/manage/virtual-machine-image-linux-sysprep?view=azloc-2504
Create an image definition. Follow this doc- https://learn.microsoft.com/en-us/azure/virtual-machines/image-version?tabs=cli%2Ccli2#create-an-image
az azstackhci image-definition create \
--resource-group <your-rg> \
--gallery-name <your-gallery-name> \
--image-definition-name Ubuntu-2404 \
--publisher Canonical \
--offer UbuntuServer \
--sku 24_04-lts \
--os-type Linux \
--hyperv-generation V2
Create a gallery image version using the VHD you uploaded, follow this document- https://learn.microsoft.com/en-us/cli/azure/stack-hci-vm/image?view=azure-cli-latest
az azstackhci image-version create \
--resource-group <your-rg> \
--gallery-name <your-gallery-name> \
--image-definition-name Ubuntu-2404 \
--image-version 1.0.0 \
--location MocLocation \
--os-vhd-uri <path-to-your-vhd> \
--storage-account <your-storage-account>
Verify that the image version is available and then try to create the VM again, explicitly referencing this image version.