私はAzureに格納された複数のVMをスピンアップするイメージを持っています。私は必要なリソースを作成するためのテンプレートを作成し、VM作成以外はすべてが成功します。私はエラーを取得するまでCreateOption.FromImageを使用してカスタムイメージからAzure VMを作成する
は約40分間の展開を実行します:CreateOption.Attach
にCreateOption.FromImage
を変更
'OS Provisioning for VM 'vmName' 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
はすぐに私に次のエラーを与える:私は何
Cannot attach an existing OS disk if the VM is created from a platform or user image.
テンプレートを使用して達成しようとしています:
- 目的地までの年齢
- サプライマスター
- コピーのコピーのための希望先マスタイメージ
- VM を作成
- 以下
VMにコピーを添付は、VMの部分であります私が使用しているテンプレートが展開します
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines",
"name": "[parameters('vmName')]",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "VirtualMachine"
},
"dependsOn": [
"[concat('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
],
"properties": {
"osProfile": {
"computerName": "[parameters('vmName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"hardwareProfile": {
"vmSize": "[variables('vmSize')]"
},
"storageProfile": {
"osDisk": {
"name": "[parameters('OSDiskName')]",
"osType": "windows",
"caching": "ReadWrite",
"createOption": "FromImage",
"image": {
"uri": "[concat('https://', parameters('storageAccountName'), '.blob.core.windows.net/', parameters('sourceStorageContainerName'), '/', parameters('sourceVHDName'), '.vhd')]"
},
"vhd": {
"uri": "[concat('https://', parameters('storageAccountName'), '.blob.core.windows.net/', parameters('vhdStorageContainerName'), '/', parameters('OSDiskName'), '.vhd')]"
}
}
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('nicName'))]"
}
]
}
}
}
イメージがsysprepされているかどうかを確認しますか? –
+1フレッドハン。 Windowsイメージはsyspreppedする必要があり、Linuxイメージは適切に起動するためにプロビジョニングを解除する必要があります。 –