【发布时间】:2016-06-25 13:57:13
【问题描述】:
如何使用 PowerShell 打破 Blob 存储中项目的租约?
尝试在当前图片上上传内容时,我收到以下信息:
Add-AzureRmVhd : The remote server returned an error: (412) There is currently a lease on the blob and no lease ID was specified in the request..
At line:1 char:1
+ Add-AzureRmVhd -Destination $osDiskUri -LocalFilePath $localFileName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureRmVhd], StorageException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.StorageServices.AddAzureVhdCommand
【问题讨论】:
-
我最近回答了一个类似的问题,here,关于无法解除租约。这通常是由于磁盘对象仍然存在,与相关的 vhd 页面 blob 相关(并具有租约)。在我的回答中,我展示了在哪里可以找到磁盘列表(在旧门户和新门户中)。如果是这种情况,您可能会通过 PowerShell 以及门户网站删除 Disk 对象。
-
谢谢。在我的情况下,在 PowerShell 中简单地释放租约,将新的 VHD 上传到相同的确切文件名,然后启动 VM 备份会容易得多。
-
This script 推荐的 here 对我不起作用。我安装了Storage Explorer。 Rt.Clicked 容器“Break Lease”。它奏效了....
标签: azure azure-storage azure-blob-storage azure-powershell