0

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?

4

1 回答 1

2

我们实际上发布了一个使用较小磁盘而不是默认的 128GB 磁盘的 Windows Server 版本。托管磁盘无法调整大小,只能向上调整。因此,如果您想在 Windows Server 上部署较小的 OS 磁盘,您应该使用镜像名称中带有 [smalldisk] 的任何镜像

在此处输入图像描述

如果部署到 CLI 或 PowerShell,您可以使用以下文档导航可用映像并找到支持小磁盘的映像

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

于 2019-06-18T21:17:13.200 回答