Should not use name like RHEL and CentOS for your Azure Image to avoid launching VM from Marketplace

Microsoft announced Azure Image recently. Now you can create an image for your custom Virtual Machine.

You can use any name, but it would get a problem when you name like RHEL, CentOS and so on.

Now, here is my image named with RHEL.

$ az image list
Location Name ProvisioningState ResourceGroup
---------- ---------- ------------------- ---------------
japanwest rhel Succeeded RHEL-BASE

OK, let’s create from VM from this image. I found the command in this page.

$ az vm create -n testvm3  -g rhel-base -l japanwest --image rhel --storage-sku Standard_LRS --size Standard_A1 --authentication-type password --admin-password clouduser

Then, you will find the launched VM is not from your image but from the RHEL Marketplace image.

This is because some names are reserved as an alias. When your image name is same as one of alias, the “ — image <image_name>” option means you specify the Marketplace image alias. If you’d like to launch VM from your Image, please specify the resource ID, which can be retrieved by below command.

$ az image list --resource-group $ResourceGroup --query ‘[*].{Name:name,Id:id}’
Name Id
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — -
rhel /subscriptions/<UUID>/resourceGroups/<ResourceGroup>/providers/Microsoft.Compute/images/rhel

Beside, it appears these values are reserved as aliases.

  • Win2012R2Datacenter
  • Win2008R2SP1
  • Win2012Datacenter
  • UbuntuLTS
  • CentOS
  • openSUSE-Leap
  • RHEL
  • SLES
  • Debian
  • CoreOS

It’s safe to avoid use these names not to launch an unintended VM from Marketplace.