0
votes

I've been trying to create a Windows Server 2016 VM with an os disk that is less than the default of size 128GB using the azure cli. Below is a sample of what I've executed with simplified parameter names

az vm create  --name 'dWeb02-vm' --resource-group 'dev-rg' --admin-password 'ComplexPassword' --admin-username 'dwebadm' --availability-set 'dev-as' --image 'Win2016Datacenter' --location 'northeurope' --nics 'dev-nic' --size 'Standard_B1ms' --os-disk-size-gb '32' --storage-sku 'StandardSSD_LRS' 

This results in a VM being created with a managed disk but the size of the disk is 127GB and I get a Resize error on script execution

Deployment error

Deployment failed. Correlation ID: 0c0f1476-8464-444e-91e1-52de3631a64f. {
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "ResizeDiskError",
        "message": "Resource with id THE RESOURCE ID."
      }
    ]
  }
}

Is it possible to create an OS disk that is less than 128GB for a windows VM?

1

1 Answers

2
votes

We actually released a Windows Server Edition that uses a smaller disk instead of the default 128GB. Managed disks cannot be resized down, only up. So if you want to deploy a smaller OS disk on Windows Server you should use any of the images with [smalldisk] in the image name

enter image description here

If deploying to CLI or PowerShell you can use the following doc to navigate the available images and find the ones that support small disk

https://docs.microsoft.com/en-us/azure/virtual-machines/windows/cli-ps-findimage#navigate-the-images