lumenrain
lumenrain

Reputation: 23

Downloading Azure portal OS .vhd as a backup

I am new to Azure and cloud computing in general. I am about to resize my Linux VM OS disk using: Update-AzureDisk –DiskName "" -Label "ResiZedOS" -ResizedSizeInGB

But before that, I want to make sure that I don't lose my data for whatever reason. Therefore, I need a backup of my current OS Disk that I am about to expand.

Now, I read a little about the backup services provided by Azure. But can't I just download the OS .vhd file to my local computer and, if needed, upload back and reattach to the VM?

Am I getting this right? And if I am, could that be done while the VM is running?

The VM is classic deployed Ubuntu.

Upvotes: 1

Views: 1018

Answers (3)

Shui shengbao
Shui shengbao

Reputation: 19223

According to your scenario, you could use Azcopy to copy the VHD to another storage account. The data transfer between Azure data center, it cost you only a few minutes. You could use the backup VHD to recreate a new VM.

You could use the following commands.

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer1 /Dest:https://myaccount.blob.core.windows.net/mycontainer2 /SourceKey:key /DestKey:key /Pattern:abc.txt

Example

AzCopy /Source:https://t5portalvhdsx2463gvmvrz7.blob.core.windows.net/vhds /Dest:https://61portalvhdsbkv71y4r29cs.blob.core.windows.net/vhds /SourceKey:VK8LDCaAudknX9LCGPlpemHzB9FXMKZBJxAY2i8YwWAtUWFti3PKW9iNnFvlGX0TN/csvPkUDbnL22cdro5LPQ== /DestKey:fWjwkegnh7lL84GJIpeAEaLaL5uh+upNXvI4tqgtUa8mw71cJuxv4W1vbzJtSabaj+Cg2E06OSUCIX1BmMH/jg== /Pattern:shui-shui-2017-02-02.vhd

You could get source key and dest key on Azure Portal.

enter image description here

You could download Azcopy from the link.

Note:When you copy VHD, you should stop VM.

Upvotes: 1

Zhaoxing Lu
Zhaoxing Lu

Reputation: 6467

Rather than downloading the whole VHD for backup purpose (which is very slow and needs to be done after shutting down the VM for data consistency), I'd suggest you to snapshot the VHD blob since the operation can be done on a running VM and completed immediately.

Upvotes: 0

Tomasz Tuczapski
Tomasz Tuczapski

Reputation: 329

You can simply download VM's OS disk and then upload it back to Azure if something goes wrong. But you can't do this while VM is running. You will have to stop it first.

Upvotes: 0

Related Questions