Unable to Create Empty Flexible VMSS for Existing VM Migration – Managed Disk Validation Error

Mohit Kumar (Capgemini America Inc) 0 Reputation points Microsoft External Staff
2026-06-23T11:01:28.05+00:00

While creating a Flexible VMSS (without a scaling profile) to later attach the existing VM, every deployment attempt fails with the following error:

{

  "error": {

    "code": "BadRequest",

    "message": "Virtual Machine Scale Set with orchestration mode 'Flexible' and a Virtual Machine profile must use managed disks."

  }

Troubleshooting Performed:

  • Azure Portal deployment
  • Azure CLI deployment (az vmss create)
  • ARM/REST API deployment
  • Deployment in multiple resource groups
  • Verified Managed Disk configuration
  • Verified VM eligibility for VMSS Flex attachment

Expected Behavior: An empty Flexible VMSS should be created successfully so that the existing VM can be attached afterward.

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets

Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.


1 answer

Sort by: Newest
  1. Manish Deshpande 8,215 Reputation points Microsoft External Staff Moderator
    2026-06-23T11:18:23.0766667+00:00

    Hello @Mohit Kumar (Capgemini America Inc)

    Thanks for the detailed write-up. The error is expected here — let me explain why and give you the exact steps.

    Why it happensaz vmss create (and the portal) build a VM scaling profile by default. On a Flexible scale set, any VM profile must reference managed disks — so when the profile is present (even partially, e.g. copied from an older Uniform/unmanaged-disk template with vhdContainers or storageUri), you get:

    "...orchestration mode 'Flexible' and a Virtual Machine profile must use managed disks."

    For your goal an empty Flex VMSS to attach an existing VM later you don't want a VM profile at all.

    Step 1 — Create the empty Flexible VMSS (no scaling profile) Omit all image/OS/admin/SKU parameters. That's what prevents the VM profile (and the error):

    az vmss create \
      --name myEmptyVmss \
      --resource-group myResourceGroup \
      --orchestration-mode Flexible \
      --platform-fault-domain-count 1
    

    I've set --platform-fault-domain-count 1 deliberately: attaching an existing VM to a scale set with fault domain count = 1 requires no downtime. (For a brand-new empty set with no attach-without-downtime requirement, up to 3 is also valid.)

    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-scaling-profile?tabs=portal#create-a-scale-set-without-a-scaling-profile

    Step 2 — Attach your existing VM

    az vm update \
      --resource-group myResourceGroup \
      --name myExistingVM \
      --set virtualMachineScaleSet.id="/subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.Compute/virtualMachineScaleSets/myEmptyVmss"
    

    Prerequisites for the attach to succeed (these are the common silent blockers):

    • Scale set is in Flexible orchestration mode with singlePlacementGroup = false
    • VM and scale set are in the same resource group
    • VM uses managed disks
    • VM is not in an Availability Set or Proximity Placement Group
    • Zonality matches — a regional (no-zone) VM attaches to a regional scale set; a zonal VM attaches only to a scale set spanning that same zone

    Note: attaching a VM does not automatically wire it to any load balancer. If the VM needs to receive load-balanced traffic, configure its NIC's backend pool manually afterward.

    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3

    Links :
    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-scaling-profile?tabs=portal#create-a-scale-set-without-a-scaling-profile
    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3
    https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-orchestration-modes

    Thanks,
    Manish.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.