Azure VM Restore Job Progress

If you’ve ever had to restore af VM in Azure, you might have looked around for some information regarding the progress of the job. It’s pretty much standard for backup products, to show how far the job is, ETA etc, but not yet in Azure. There is however a way to check this, with quite accurate data.

When you restore a VM, the disks are transferred to a storage account – even when you use Managed Disks. In this storage account, you can browse to the blobs, and if you check the metadata, you will see something like this:


And if you copy the data:

<VhdTransferStatus_V2015_01 xmlns:i=”” xmlns=””>
<DetailedErrorCode i:nil=”true” />
<m_DetailedErrorCode i:nil=”true” />
<m_IcCheckerDataBlobsCheckPointData i:nil=”true” />
<m_IcrementalIcChecker16KBChecksumBlobsCheckPoint i:nil=”true” />
<m_IcrementalIcChecker4MBChecksumBlobsCheckPoint i:nil=”true” />
<m_IcrementalIcCheckerDataBlobsCheckPoint i:nil=”true” />
<m_SnapshotTime>4/11/2018 1:39:30 AM</m_SnapshotTime>

Here you can see how many 16KB blocks has been transferred (m_Num16KBBlockTransferred), and the percentage of the complete transfer (m_PercentageCompleted). In this case I know 960 GB of the disk is used, so by doing a few calculations, I can confirm that the percentage is somewhat accurate. It’s good enough for me, at least until we can get the information directly in the backup jobs 😉

You can also use PowerShell to get this data:

[powershell]$resourceGroupName = "resource group name"
$storageAccName = "storage account name"
$vhdContainer = "vhd container name"
$storageAcc = Get-AzureRMStorageAccount -Name $storageAccName -ResourceGroupName $resourceGroupName
[XML]$metadata = (Get-AzureStorageBlob -Container $vhdContainer -Context $storageAcc.Context)[1].ICloudBlob.Metadata.Values

In the above code, I have 2 blobs, but only wanted a status for the 2nd one – and I reference this by using [1] in the Get-AzureStorageBlob line.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s