Forum Discussion
VHD to Archive Storage
I had read somewhere that with azcopy if it came from a page blob the new copy would still be a page blob and that there wasn't a switch in azcopy to change from page to block blob or vice versa.
However, I didn't verify that so I may have to test it
It may be possible to perform the following using AZcopy v10:
https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
...you can sync a Blob container down to a local file system:
# If you're using Azure Active Directory authentication the sastoken is not required .\azcopy sync "https://account.blob.core.windows.net/mycontainer1" "C:\local\path" --recursive=true
- John TwohigMar 04, 2019Iron Contributor
Darrick
Good suggestion but that didn't work.
The Azcopy documentation says "AzCopy v10 by default uploads data into block blobs. However, if a source file has vhd extension, AzCopy v10 will by default upload it to a page blob."
The documentation doesn't seem to be correct. I removed the vhd extension and used Azcopy but it kept it as a page blob.
- davlunMay 01, 2019Copper Contributor
Did you ever figure out a solution for this? (you are right, not the only one thinking about something like this)
David
- CristianoRosaSep 26, 2019Copper Contributor
This is how I have implemented a similar scenario.
Scenario:
Copy vhd file from one subscription to another and in the destination subscription the vhd file must be placed in the archive tier.
Considerations:
- VHD file is supposed to be page blob.
- Archive tier is supported for block blobs (page blob cannot be changed to Archive tier) and at the object level only.
- We want to Archive the vhd file in the destination subscription, so we have to copy the vhd file as block blob and then change the tier to Archive.
- However in case we ever need to restore the vhd file which was copied as block blob, we have to convert the vhd file back to page blob first and then mount it as a disk (because we cannot mount a vhd file block blob as a disk to a VM).Steps:
1) First I have copied the vhd file from source subscription to destination subscription as block blob (parameter --blob-type=blockblob) with AzCopy v10.
azcopy copy "https://<source-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>?<source-storage-account-SAS-token>" "https://<destination-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>?<destination-storage-account-SAS-token>" --blob-type=blockblob2) I configured the Lifecycle Management to automatically switch files in a given container to the Archive tier. Note that the policy only executes once per day.For details on how to manage the Azure Blob storage lifecycle check this:
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__docs.microsoft.com_en-2Dus_azure_storage_blobs_storage-2Dlifecycle-2Dmanagement-2Dconcepts%26d%3DDwMFAg%26c%3DeIGjsITfXP_y-DLLX0uEHXJvU8nOHrUK8IrwNKOtkVU%26r%3DyxFqvV4vPK-LMxtxhaS7m0ZuFJNpKajTRwtmu_RWLY4%26m%3DN1AqBkCaW9oCFkG3hixSw4vCLBmRlvXdMhcFNNw9O30%26s%3D92xdOWrBP5H4_qo1q_AGUO-MQKH6DbfLy_2hxAhP1LA%26e%3D&data=02%7C01%7CCristiano.Araujo%40microsoft.com%7C9ca95a22de69494d22b308d740d2bc1e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637049146170653072&sdata=m8NVVJibnOIqN8pYUh9XHMq9WNrFKSnhpIfTwaS3Gds%3D&reserved=0
3) In case we need to restore the vhd file which was copied as block blob, these are the steps:
- Change the tier from Archive to Hot for example.
- Convert the vhd file back to page blob with below command (parameter --blob-type=pageblob).
- Mount it as a disk to a VM.
azcopy copy "https://<source-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>?<source-storage-account-SAS-token>" "https://<destination-storage-account-name>.blob.core.windows.net/<container-name>/<blob-path>?<destination-storage-account-SAS-token>" --blob-type=pageblob