2
votes

I want to copy a 12GB page blob from one storage account to another. At the moment, both sides are "public container". But it doesn't work: HTTP/1.1 409 The blob type is invalid for this operation.

Copying it the same way but within the same storage account works without errors.

What am I missing?

Thanks!

//EDIT: This is how I'm trying to copy blob.dat from account1 to account2 (casablanca lib):

http_client client(L"https://account2.blob.core.windows.net");

http_request request(methods::PUT);

request.headers().add(L"Authorization", L"SharedKey account2:*************************************");
request.headers().add(L"x-ms-copy-source", L"http://account1.blob.core.windows.net/dir/blob.dat");
request.headers().add(L"x-ms-date", L"Sat, 23 Nov 2013 16:50:00 GMT"); // I'm keeping this updated
request.headers().add(L"x-ms-version", L"2012-02-12");

request.set_request_uri(L"/dir/blob.dat");

auto ret = client.request(request).then([](http_response response)
{
    std::wcout << response.status_code() << std::endl << response.to_string() << std::endl;
});

The storage accounts were created a few days ago, so no restrictions apply. Also, the destination dir is empty (account2 /dir/blob.dat is not existing).

//EDIT2: I did more testing and found out this: Uploading a new page blob (few MB) then copying it to another storage account worked! Then I tried to rename the 12GB page blob which I wasn't able to copy (renamed from mydisk.vhd to test.dat) and suddenly the copy to another storage worked as well! But the next problem is: After renaming the test.dat back to mydisk.vhd in the destination storage account, I cannot create a disk from it (error like "not a valid vhd file"). But the copy is already done (x-ms-copy-status: success). What could be the problem now? (Oh I forgot: the source mydisk.vhd lease status was "unlocked" before copying)

//EDIT3: Well, it seems that the problem has solved itself... even with the original mydisk.vhd I wasn't able to create a disk again (invalid vhd). I don't know why as I didnt alter it, but I created it on the xbox one launch day, it was all quite slow so maybe something went wrong there. Now, as I created a new VM, I can copy the .vhd over to another storage without problems (after deleting the disk).

1
Is any one of the storage accounts in question created before 7th June 2012?Gaurav Mantri
Also please check if a blob by the same name already exist in the target storage account. Read comments from Matthew in this thread: stackoverflow.com/questions/14152087/….Gaurav Mantri
And... please edit your question to show how you're initiating the blob copy. Without those details, it's pretty difficult to help you.David Makogon
Thank you. I have edited my post to answer all questions.stxacc

1 Answers