簡體   English   中英

使用 ARM 模板和 JSON 在 Azure 中創建 VM 時出現“DiskImageNotReady”錯誤

[英]"DiskImageNotReady" error when creating VM in Azure using ARM template and JSON

我正在嘗試使用 ARM 模板部署 3 個 azure Ubuntu vm。 它們被部署為更大的資源組、存儲帳戶、SQL 服務器等基礎設施部署的一部分。除了 VM 創建之外,一切都運行良好。 在使用單個 VM 進行測試期間,腳本可以正常工作,但使用 3 時出現以下錯誤 -

    New-AzureRmResourceGroupDeployment : 16:52:57 - Resource Microsoft.Compute/virtualMachines 'xxxV3Monitor1' failed with message '{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "DiskImageNotReady",
        "message": "Disk image https://xxxxxx.blob.core.windows.net/rootvhd/v1ubuntudocker.vhd is in Pending state. Please retry when image is ready."
      }

似乎我們正在使用的自定義根 VHD 映像由於處於“待處理”狀態而失敗,我認為這是對文件的某種鎖定,因為它正用於創建其他 VM 之一?

非常感謝任何幫助。 謝謝。

我假設您在從中創建 VM 之前移動 VM 映像。 如果是這樣,請在移動之后和啟動部署腳本之前嘗試此代碼:($blob1 是您調用 Start-AzureStorageBlobCopy 命令的變量)

### Retrieve the current status of the copy operation ###
$status = $blob1 | Get-AzureStorageBlobCopyState 

### Print out status ### 
$status 

### Loop until complete ###                                    
While($status.Status -eq "Pending"){
  $status = $blob1 | Get-AzureStorageBlobCopyState 
  Start-Sleep -s 60
  ### Print out status ###
  $status
}

這將循環每分鍾更新狀態。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM