从使用Azure CLI 2.0自己创建的自定义映像创建Windows虚拟机中的问题 [英] Issue in Creating windows virtual machine from customized Image created myself using azure CLI 2.0

查看:136
本文介绍了从使用Azure CLI 2.0自己创建的自定义映像创建Windows虚拟机中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是天蓝色的新手,我想使用以下步骤从刚创建的映像中创建新的Windows 2012虚拟机.

I am new to azure and I wanted to create new windows 2012 virtual machine from the image i just created using following steps.

1)使用以下azure cli 2.0 cmd创建了w2k12虚拟机

1) Created w2k12 virtual machine using following azure cli 2.0 cmd

az vm create -n W2k12-host -g Naresh-test --image MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest --vnet-name Naresh-test-vnet-子网默认--admin-username Administrator1 --admin-password R @ ckware1234 --authentication-type 密码-存储帐户nareshteststorage-使用非托管磁盘 --nsg Naresh-test-nsg

az vm create -n W2k12-host -g Naresh-test --image MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest --vnet-name Naresh-test-vnet --subnet default --admin-username Administrator1 --admin-password R@ckware1234 --authentication-type password --storage-account nareshteststorage --use-unmanaged-disk --nsg Naresh-test-nsg

成功创建虚拟机后,将RDP发送到vm&运行sysprep脚本以使vm通用化.当vm处于停止状态时,我运行以下cmd进行释放,使vm的状态通用化&验证了vm的状态是vm-genralized

once the virtual machine is successfully created ,RDP to the vm & ran the sysprep script to make the vm as generalized .When vm was in stopped state then i ran the following cmd to deallocate , make the vm state as generalized & verified the state of the vm is vm-genralized

az vm释放--resource-group Naresh-test --name W2k12-host

az vm deallocate --resource-group Naresh-test --name W2k12-host

az vm泛化--resource-group Naresh-test --name W2k12-host

az vm generalize --resource-group Naresh-test --name W2k12-host

我检查了该图片在我的资源组中

[root @ Az-test-cli〜]#az图片列表位置名称
ProvisioningState资源组 ---------- --------------------------- ------------- ------ --------------- centralus W2k12-自动化主机图像成功完成NARESH-TEST

[root@Az-test-cli ~]# az image list Location Name
ProvisioningState ResourceGroup ---------- --------------------------- ------------------- --------------- centralus W2k12-Automation-host-image Succeeded NARESH-TEST

当我尝试使用以下cmd运行az vm create

when I tried to run the az vm create using following cmd

az vm create -n Test-w2k12 -g Naresh-test --image W2k12-自动化-主机映像--vnet名称Naresh-test-vnet-子网 默认--admin-username Administrator1 --admin-password R @ ckware1234 --authentication-type密码--nsg Naresh-test-nsg --debug --verbose

az vm create -n Test-w2k12 -g Naresh-test --image W2k12-Automation-host-image --vnet-name Naresh-test-vnet --subnet default --admin-username Administrator1 --admin-password R@ckware1234 --authentication-type password --nsg Naresh-test-nsg --debug --verbose

我收到以下错误

At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details. {
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "OSProvisioningTimedOut",
        "message": "OS Provisioning for VM 'Test-w2k12' did not finish in the allotted time. However, the VM guest agent was detected running. This suggests the guest OS has not been properly prepared to be used as a VM image (with CreateOption=FromImage). To resolve this issue, either use the VHD as is with CreateOption=Attach or prepare it properly for use as an image:\r\n * Instructions for Windows: https://azure.microsoft.com/documentation/articles/virtual-machines-windows-upload-image/ 
      }
    ]
  }
}  Correlation ID: 2fa53bea-4aab-46d3-b989-972607754bb7

我不确定是否缺少任何其他步骤,如果我们还有其他指南或文档来说明如何使用azure cli 2.0创建Windows虚拟机映像和使用自定义映像创建vm,请建议我

I am not sure am I missing any other steps , please suggested me if we have any other guide or document for the windows virtual machine image creation and vm creation using the customized image using azure cli 2.0

推荐答案

虚拟机"Test-w2k12"的操作系统置备未完成 时间.但是,检测到VM guest虚拟机代理正在运行.这表明 来宾操作系统尚未正确准备好用作VM映像

OS Provisioning for VM 'Test-w2k12' did not finish in the allotted time. However, the VM guest agent was detected running. This suggests the guest OS has not been properly prepared to be used as a VM image

如果您使用未经过系统准备的映像(或不正确概括虚拟机)来创建VM,则可能会导致错误,因此请确保已对系统进行映像.

If you are using the image that is not sysprepped (or not correct generalize the VM) to create VM, it could cause the error, so please make sure your image is sysprepped.

有关通用化Windows虚拟机的更多信息,请参考此

More information about Generalize a Windows virtual machine, please refer to this link.

这篇关于从使用Azure CLI 2.0自己创建的自定义映像创建Windows虚拟机中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆