gpt4 book ai didi

windows - 使用 azure CLI 2.0 从自己创建的自定义镜像创建 Windows 虚拟机时出现问题

转载 作者:行者123 更新时间:2023-12-03 04:26:20 24 4
gpt4 key购买 nike

我是 azure 新手,我想从我刚刚使用以下步骤创建的镜像创建新的 Windows 2012 虚拟机。

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

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 到虚拟机并运行 sysprep 脚本以使虚拟机处于通用状态。当虚拟机处于停止状态时,我运行以下 cmd 来解除分配,使虚拟机状态为通用状态并经过验证虚拟机的状态是虚拟机通用的

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

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

我检查了该图像是否在我的资源组中

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

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

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 虚拟机镜像和创建虚拟机的指南或文档,请建议我

最佳答案

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

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

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

关于windows - 使用 azure CLI 2.0 从自己创建的自定义镜像创建 Windows 虚拟机时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42965752/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com