適用場景
當(dāng)客戶刪除使用托盤磁盤的虛擬機,嘗試使用該 OS 磁盤再次創(chuàng)建虛擬機的時候,發(fā)現(xiàn)沒有“創(chuàng)建 VM”的按鈕。
Note
本文僅適用于使用托管磁盤的虛擬機
解決方案
首先,我們需要通過 PowShell 來查看該托盤磁盤的信息。
PowerShell復(fù)制
#查詢托盤磁盤信息PS C:\windows\system32>Get-AzureRmDisk-ResourceGroupName"<資源組名稱>"-DiskName"<托盤磁盤名稱>"ResourceGroupName? : 資源組名稱AccountType? ? ? ? : StandardLRSTimeCreated? ? ? ? :7/20/201712:30:31PMOsType? ? ? ? ? ? :? ? ? ? <-這里空白代表缺失了 OsTypeCreationData? ? ? : Microsoft.Azure.Management.Compute.Models.CreationDataDiskSizeGB? ? ? ? : 磁盤大小EncryptionSettings :OwnerId? ? ? ? ? ? :ProvisioningState? : SucceededId? ? ? ? ? ? ? ? : /subscriptions/訂閱 ID/resourceGroups/資源組名稱/providers/Microsoft.Compute/disks/托盤磁盤名稱Name? ? ? ? ? ? ? : 托盤磁盤名稱Type? ? ? ? ? ? ? : Microsoft.Compute/disksLocation? ? ? ? ? : chinaeastTags? ? ? ? ? ? ? : {}
缺失 OsType 的托管磁盤會被視作是數(shù)據(jù)磁盤,所以在該磁盤頁面下,沒有 “創(chuàng)建 VM“ 的按鈕。
手動更新該托管磁盤的 OsType 來賦予正確的鍵值。
PowerShell復(fù)制
#將托盤磁盤信息賦予給變量PS C:\windows\system32>$Disk=Get-AzureRmDisk-ResourceGroupName"<資源組名稱>"-DiskName"<托盤磁盤名稱>"#查詢托盤磁盤信息確認無誤PS C:\windows\system32>$DiskResourceGroupName? : 資源組名稱AccountType? ? ? ? : StandardLRSTimeCreated? ? ? ? :7/20/201712:30:31PMOsType? ? ? ? ? ? :? ? ? ? <-這里空白代表缺失了 OsTypeCreationData? ? ? : Microsoft.Azure.Management.Compute.Models.CreationDataDiskSizeGB? ? ? ? : 磁盤大小EncryptionSettings :OwnerId? ? ? ? ? ? :ProvisioningState? : SucceededId? ? ? ? ? ? ? ? : /subscriptions/訂閱 ID/resourceGroups/資源組名稱/providers/Microsoft.Compute/disks/托盤磁盤名稱Name? ? ? ? ? ? ? : 托盤磁盤名稱Type? ? ? ? ? ? ? : Microsoft.Compute/disksLocation? ? ? ? ? : chinaeastTags? ? ? ? ? ? ? : {}#輸入托盤磁盤的 OsTypePS C:\windows\system32>$Disk.OsType ="Linux"<-根據(jù)虛擬機 OS 類型選擇 Windows 或者 Linux#手動更新托盤磁盤的信息PS C:\windows\system32>Update-AzureRmDisk-ResourceGroupName"<資源組名稱>"-DiskName"<托盤磁盤名稱>"-Disk$DiskAccountType? ? ? ? : StandardLRSTimeCreated? ? ? ? :7/20/20178:30:31PMOsType? ? ? ? ? ? : LinuxCreationData? ? ? : Microsoft.Azure.Management.Compute.Models.CreationDataDiskSizeGB? ? ? ? : 磁盤大小EncryptionSettings :OwnerId? ? ? ? ? ? :ProvisioningState? : SucceededId? ? ? ? ? ? ? ? : /subscriptions/訂閱 ID/resourceGroups/資源組名稱/providers/Microsoft.Compute/disks/托盤磁盤名稱Name? ? ? ? ? ? ? : 托盤磁盤名稱Type? ? ? ? ? ? ? : Microsoft.Compute/disksLocation? ? ? ? ? : chinaeastTags? ? ? ? ? ? ? :
在Azure 門戶上重新查看該托盤磁盤的信息,可以看到 “創(chuàng)建 VM” 的按鈕了? ? ? ? 立即訪問http://market.azure.cn
