409 尝试将页面 Blob 恢复到以前的快照时发生冲突

409 Conflict when attempting to revert a Page Blob to a previous snapshot

此问题仅发生在 高级存储(SSD 支持的存储)中。这是在尝试将上次维护中损坏的 VHD 恢复到以前的快照时。

这是正在发送的请求(方法StartCopyFromBlob):

PUT https://contoso.blob.core.windows.net/vhds/OS.vhd HTTP/1.1
User-Agent: WA-Storage/4.3.0 (.NET CLR 4.0.30319.34209; Win32NT 6.2.9200.0)
x-ms-version: 2014-02-14
x-ms-copy-source: https://contoso.blob.core.windows.net/vhds/OS.vhd?snapshot=2015-06-04T09%3A00%3A02.0048291Z
x-ms-client-request-id: d09e9c18-07c4-4295-a09e-e6bbe23ea543
x-ms-date: Wed, 10 Jun 2015 21:43:25 GMT
Authorization: XXXXXXXXXXXXXXXXXXXXXXXX
Host: contoso.blob.core.windows.net
Content-Length: 0

这是回复:

HTTP/1.1 409 This operation is not permitted because the blob has snapshots.
Content-Length: 246
Content-Type: application/xml
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 88411d2c-001c-020d-00c6-a3ce5e000000
x-ms-version: 2014-02-14
Date: Wed, 10 Jun 2015 21:43:23 GMT

<?xml version="1.0" encoding="utf-8"?>
<Error><Code>SnapshotsPresent</Code><Message>This operation is not permitted because the blob has snapshots.
RequestId:88411d2c-001c-020d-00c6-a3ce5e000000
Time:2015-06-10T21:43:24.3527942Z</Message></Error>

起初,我认为它与具有关联租约的 blob 相关联(因为它已与我已删除的磁盘相关联)但 none 似乎相关联。

属性请求:

HEAD https://contoso.blob.core.windows.net/vhds/OS.vhd HTTP/1.1
User-Agent: WA-Storage/4.3.0 (.NET CLR 4.0.30319.34209; Win32NT 6.2.9200.0)
x-ms-version: 2014-02-14
x-ms-client-request-id: df75e42b-4733-4ec4-86fd-b073d7353d98
x-ms-date: Wed, 10 Jun 2015 21:47:53 GMT
Authorization: XXXXXXXXXXXXXXXXXXXXXXXX
Host: contoso.blob.core.windows.net

属性响应:

HTTP/1.1 200 OK
Content-Length: 136367309312
Content-Type: binary/octet-stream
Last-Modified: Mon, 08 Jun 2015 19:30:01 GMT
Accept-Ranges: bytes
ETag: "0x8D27038A5E2A5B0"
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-copy-id: 79998710-3eeb-4323-be69-349ec9bf5b68
x-ms-copy-source: XXXXXXXXXXXXXXXXXXXXXXXX
x-ms-copy-progress: 136367309312/136367309312
x-ms-copy-status: success
x-ms-copy-completion-time: Thu, 05 Mar 2015 17:05:45 GMT
x-ms-meta-PIRTag: 1
x-ms-lease-state: available
x-ms-lease-status: unlocked
x-ms-blob-type: PageBlob
x-ms-blob-sequence-number: 101028
x-ms-request-id: 782ffea7-001c-02c3-00c7-a3a811000000
x-ms-version: 2014-02-14
Date: Wed, 10 Jun 2015 21:47:51 GMT

我通过将快照恢复到另一个 blob 名称(并将我的 VM 恢复到与这个新位置关联的磁盘)解决了这个问题,但我仍然很好奇是否有人知道这个问题的解决方案。

已解决此问题。您现在可以将快照还原到基础 blob。变化完全在 Azure 服务端。您可以使用相同的 Azure 存储 SDK 来执行此操作(存储 REST API 版本 2014-02-14 或更高版本)。客户端无需更改。