1

私はAzureに格納された複数のVMをスピンアップするイメージを持っています。私は必要なリソースを作成するためのテンプレートを作成し、VM作成以外はすべてが成功します。私はエラーを取得するまでCreateOption.FromImageを使用してカスタムイメージからAzure VMを作成する

は約40分間の展開を実行します:CreateOption.AttachCreateOption.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.

テンプレートを使用して達成しようとしています:

  1. 目的地までの年齢
  2. サプライマスター
  3. コピーのコピーのための希望先マスタイメージ
  4. VM
  5. を作成
  6. 以下

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'))]" 
     } 
     ] 
    } 
    } 
} 
+0

イメージがsysprepされているかどうかを確認しますか? –

+0

+1フレッドハン。 Windowsイメージはsyspreppedする必要があり、Linuxイメージは適切に起動するためにプロビジョニングを解除する必要があります。 –

答えて

2

'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

VMを作成するためにsysprepped以外のイメージを使用している場合は、エラーが発生する可能性があるため、イメージがsyspreppedであることを確認してください。

enter image description here

Cannot attach an existing OS disk if the VM is created from a platform or user image.

あなたは(それが専門のディスクから仮想マシンを作成します)アタッチするcreateOptionを指定すると、SourceImageUriパラメータを指定しないでください。詳細は、this documentationから "-CreateOption"を確認してください。

関連する問題