Search code examples
linuxazurevirtual-machinearm64vhd

Create Azure ARM64 image from VHD


When creating a new ARM64 VM based on a VHD containg an ARM64 Linux image, the VM creation REST API fails with

Cannot create a VM of size 'Standard_D2pls_v5' because this VM size only supports a CPU Architecture of 'Arm64', but an image or disk with CPU Architecture 'x64' was given. Please check that the CPU Architecture of the image or disk is compatible with that of the VM size.

What must be done to avoid this? Is there a special field to set in the VHD footer or should some special parameter be passed at image or VM creation?


Solution

  • I hit this issue creating a FreeBSD arm64 Azure image and talking with Azure support, they said I had to use a Compute Gallery to publish an arm64 image.

    So the steps look like this:

    1. Upload the image
    2. Create the image definition
    3. Create a Compute Gallery if you do not already have one
    4. Add a new version to the Compute Gallery using the image definition from step 2
    5. Launch a VM from this Compute Gallery

    HTH