在 Azure 管理控制台中,在虚拟机 > 磁盘下,我看到 2 个磁盘都表示它们已附加到虚拟机。但是,这些虚拟机已被删除。此外,磁盘 blob vhd 已被删除。所以现在我剩下 2 个无法删除的幽灵磁盘。我不确定留下这些有什么影响,我想删除它们。当我尝试使用 remove-azuredisk 删除它们时,出现错误。我知道人们引用 BreakLease.ps1 脚本来破坏 VHD 的租约以删除 VHD,但在我的情况下没有 VHD。BreakLease.ps1 脚本似乎只接受 URI 作为参数,但我没有 URI,因为这不是 VHD/blob。
有没有人对如何摆脱这些孤立的磁盘对象有任何想法?
谢谢!
PS C:\> get-azuredisk | where-object {$_.diskname -like "*memb*"} | select diskname
VERBOSE: 2:35:33 PM - Begin Operation: Get-AzureDisk
VERBOSE: 2:35:34 PM - Completed Operation: Get-AzureDisk
DiskName
--------
coco2008memb3-coco2008memb3-0-201307022204430928
coco2008memb5-coco2008memb5-0-201307022204540471
PS C:\> get-azuredisk | where-object {$_.diskname -like "*memb*"} | remove-azuredisk
VERBOSE: 2:35:56 PM - Begin Operation: Get-AzureDisk
VERBOSE: 2:35:57 PM - Completed Operation: Get-AzureDisk
VERBOSE: 2:35:57 PM - Begin Operation: Remove-AzureDisk
remove-azuredisk : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 400. Service
Management Error Code: BadRequest. Message: A disk with name coco2008memb3-coco2008memb3-0-201307022204430928 is
currently in use by virtual machine coco2008memb3 running within hosted service coco2008memb3, deployment
coco2008memb3.. Operation Tracking ID: 8a8ab4956d5948ec9c23ec047259d086."
At line:1 char:61
+ get-azuredisk | where-object {$_.diskname -like "*memb*"} | remove-azuredisk
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Remove-AzureDisk], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.RemoveAzureDiskCommand
VERBOSE: 2:35:58 PM - Begin Operation: Remove-AzureDisk
remove-azuredisk : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 400. Service
Management Error Code: BadRequest. Message: A disk with name coco2008memb5-coco2008memb5-0-201307022204540471 is
currently in use by virtual machine coco2008memb5 running within hosted service coco2008memb5, deployment
coco2008memb5.. Operation Tracking ID: 69471c6e365e4dbca7ab714dfaddbe98."
At line:1 char:61
+ get-azuredisk | where-object {$_.diskname -like "*memb*"} | remove-azuredisk
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Remove-AzureDisk], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.IaaS.RemoveAzureDiskCommand