简体   繁体   English

Azure CLI Windows VM创建操作系统磁盘大小

[英]Azure CLI Windows VM creation os disk size

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. 我一直在尝试使用azure cli使用小于默认大小128GB的os磁盘创建Windows Server 2016 VM。 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 这导致使用托管磁盘创建VM,但是磁盘大小为127GB,并且在执行脚本时收到Resize错误

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? 是否可以为Windows VM创建小于128GB的OS磁盘?

We actually released a Windows Server Edition that uses a smaller disk instead of the default 128GB. 实际上,我们发布了使用较小磁盘而不是默认128GB的Windows Server Edition。 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 因此,如果要在Windows Server上部署较小的OS磁盘,则应使用映像名称中带有[smalldisk]的任何映像

在此处输入图片说明

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 如果部署到CLI或PowerShell,则可以使用以下文档导航可用图像并找到支持小磁盘的图像

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM