Forum Discussion
VHD to Archive Storage
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.
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://docs.microsoft.com/en-us/azure/storage/blobs/storage-lifecycle-management-concepts
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
- dgwbdlundSep 28, 2019Copper Contributor
Thanks for the write up! I could not find a solution originally, so went a more traditional backup, but will need to do this again toward the end of the year. I am going to give this a shot in the next few weeks...
- John TwohigMay 01, 2019Iron Contributor
Not really a good one. I thought the best thing to do was to copy the files to a container in a storage account in Azure and then change the container to the archive tier. It is not as simple a process as I wanted. There are more steps and more chances for error.
I have been on vacation so I haven't moved our archive yet. We are still using our normal backup process.