如何删除包含租用blob的Azure存储帐户?

Fer*_*eia 153 vhd azure azure-storage

我正在使用Windows Azure持久虚拟机.最后,我删除了虚拟机(成功)并尝试删除关联的存储帐户.

删除存储帐户的请求失败.

在删除存储帐户时,在预览门户(manage.windowsazure.com)上出现此错误:

Failed to delete Storage account 'portalvhdscwtwycpsxxxxx'

Details:

Storage account portalvhdscwtwycpsxxxxx has 1 container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account.
Run Code Online (Sandbox Code Playgroud)

在以前的门户网站(windows.azure.com)上,我收到此错误:

Submit Failed

Storage account portalvhdscwtwycpsxxxxx has 1 container(s) which have an active image and/or disk artifacts. Ensure those artifacts are removed from the image repository before deleting this storage account.
Run Code Online (Sandbox Code Playgroud)

尝试在Azure存储资源管理器上删除blob本身(30GB VHD)我收到此错误:

There is currently a lease on the blob and no lease ID was specified in the request.
Run Code Online (Sandbox Code Playgroud)

所以我的评估是这个blob是租用的(由之前的,现在删除的虚拟机),我不能删除它,除非我可以得到这个租约ID.

问题是:如何删除此Blob,从而删除存储帐户?

Fer*_*eia 330

解决方案的关键是容器具有活动磁盘工件的消息以及从存储库中删除它的建议.

从blob存储库中删除磁盘映像的过程是:

之后,可以删除存储帐户.

笔记:

  • 即使您已经删除了所有虚拟机并且它显示0,这也适用; 磁盘选项卡下仍会有工件.
  • 磁盘与已删除的VM异步分离,删除VM后可能需要几分钟才能清除此字段.

另请参阅:无法删除VHD,"blob上目前有租约......"


dim*_*mid 16

不幸的是,阿隆索的回答并没有为我工作,因为存储是"孤儿",因为我删除存储之前删除其虚拟机.我找不到从门户网站上执行此操作的方法,因此我安装了azure-cli,并在身份验证后运行以下命令:

azure storage account delete <my-account>
Run Code Online (Sandbox Code Playgroud)

这失败了,错误消息包含罪魁祸首的名字,例如:

error: Storage account <my-account> has some active image(s) and/or disk(s), e.g. <my-image>. Ensure these image(s) and/or disk(s) are removed before deleting this storage

然后我删除了有问题的图像

azure vm disk delete <my-image>

并再次尝试删除存储,这次成功.

azure storage account delete <my-account>

  • 有完全相同的问题.我有一堆孤立的磁盘和图像,你无法在门户网站中删除.如果我四个月前才找到这个答案! (2认同)

小智 12

不幸的是,有些虚拟机被删除但是磁盘显示连接到blob的VM(30GB VHD),导致删除.此外,还有一种情况是使用Azure存储资源管理器,您可以找到无法删除的orfan但租用的VHD blob,并且预览门户上没有引用.

  • 我等了3个月......我应该继续等待时间问题吗? (4认同)
  • 他的答案在所有情况下都不正确.我目前有三(3)个"磁盘"列在"虚拟机 - >磁盘"一节下,无法删除(因此无法删除blob).我不知道如何摆脱它们,因为我所知道的唯一现有方法是使用门户网站.https://kieselmediagroup.blob.core.windows.net/misc/2012-08-21_1019.png (3认同)
  • 请参阅@Fernando Correia的上述答案,这是正确的答案. (2认同)

小智 8

转到虚拟机,然后单击光盘.标记光盘并选择底部的删除光盘.您现在可以选择是要保留还是删除相应的vhd.

首先必须通过虚拟机删除光盘,不要通过存储删除.


Nic*_*ier 5

您可以使用Iaas Management Studio:中断租约,删除blob,然后删除孤立的图像.


小智 5

在我的情况下,由于vmimages,无法删除存储.

使用power shell命令

get-azurevmimage | Where-Object -Property Category -in -Value"user"

列出所有图像要删除所有图像,请使用以下脚本:

get-azurevmimage | Where-Object -Property Category -in -Value "user" |   
foreach {
        echo "remove $($_.ImageName)"
        Remove-AzureVMImage –ImageName $($_.ImageName)
        }
Run Code Online (Sandbox Code Playgroud)