You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/backup/backup-azure-vm-backup-faq.md
+1-8Lines changed: 1 addition & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,16 +105,9 @@ You can use the restore disk option if you want to:
105
105
106
106
Yes, you can use backups taken before disks were migrated from unmanaged to managed.
107
107
108
-
- By default, a restore VM job creates an unmanaged VM.
109
-
- However, you can restore disks and use them to create a managed VM.
110
-
111
108
### How do I restore a VM to a restore point before the VM was migrated to managed disks?
112
109
113
-
By default, a restore VM job creates a VM with unmanaged disks. To create a VM with managed disks:
114
-
115
-
1.[Restore to unmanaged disks](tutorial-restore-disk.md#restore-a-vm-disk).
116
-
2.[Convert the restored disks to managed disks](tutorial-restore-disk.md#convert-the-restored-disk-to-a-managed-disk).
117
-
3.[Create a VM with managed disks](tutorial-restore-disk.md#create-a-vm-from-the-restored-disk).
110
+
The restore process remains the same. If the recovery point is of a point-in-time when VM had unmanaged disks, you can [restore disks as unmanaged](tutorial-restore-disk.md#unmanaged-disks-restore). If the VM had managed disks then, you can [restore disks as managed disks](tutorial-restore-disk.md#managed-disk-restore). Then you can [create a VM from those disks](tutorial-restore-disk.md#create-a-vm-from-the-restored-disk).
118
111
119
112
[Learn more](backup-azure-vms-automation.md#restore-an-azure-vm) about doing this in PowerShell.
To restore your disk from the recovery point, you first create an Azure storage account. This storage account is used to store the restored disk. In additional steps, the restored disk is used to create a VM.
55
+
> [!IMPORTANT]
56
+
> It is very strongly recommended to use Az CLI version 2.0.74 or later to get all the benefits of a quick restore including managed disk restore. It is best if user always uses the latest version.
57
+
58
+
### Managed disk restore
59
+
60
+
If the backed up VM has managed disks and if the intent is to restore managed disks from the recovery point, you first provide an Azure storage account. This storage account is used to store the VM configuration and the deployment template that can be later used to deploy the VM from the restored disks. Then, you also provide a target resource group for the managed disks to be restored into.
61
+
62
+
1. To create a storage account, use [az storage account create](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-create). The storage account name must be all lowercase, and be globally unique. Replace *mystorageaccount* with your own unique name:
63
+
64
+
```azurecli-interactive
65
+
az storage account create \
66
+
--resource-group myResourceGroup \
67
+
--name mystorageaccount \
68
+
--sku Standard_LRS
69
+
```
70
+
71
+
2. Restore the disk from your recovery point with [az backup restore restore-disks](https://docs.microsoft.com/cli/azure/backup/restore?view=azure-cli-latest#az-backup-restore-restore-disks). Replace *mystorageaccount* with the name of the storage account you created in the preceding command. Replace *myRecoveryPointName* with the recovery point name you obtained in the output from the previous [az backup recoverypoint list](https://docs.microsoft.com/cli/azure/backup/recoverypoint?view=azure-cli-latest#az-backup-recoverypoint-list) command. ***Also provide the target resource group to which the managed disks are restored into***.
72
+
73
+
```azurecli-interactive
74
+
az backup restore restore-disks \
75
+
--resource-group myResourceGroup \
76
+
--vault-name myRecoveryServicesVault \
77
+
--container-name myVM \
78
+
--item-name myVM \
79
+
--storage-account mystorageaccount \
80
+
--rp-name myRecoveryPointName
81
+
--target-resource-group targetRG
82
+
```
83
+
84
+
> [!WARNING]
85
+
> If target-resource-group is not provided then the managed disks will be restored as unmanaged disks to the given storage account. This will have significant consequences to the restore time since the time taken to restore the disks entirely depends on the given storage account.
86
+
87
+
### Unmanaged disks restore
88
+
89
+
If the backed up VM has unmanaged disks and if the intent is to restore disks from the recovery point, you first provide an Azure storage account. This storage account is used to store the VM configuration and the deployment template that can be later used to deploy the VM from the restored disks. By default, the unmanaged disks will be restored to their original storage accounts. If user wishes to restore all unmanaged disks to one single place, then the given storage account can also be used as a staging location for those disks too.
90
+
91
+
In additional steps, the restored disk is used to create a VM.
56
92
57
93
1. To create a storage account, use [az storage account create](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-create). The storage account name must be all lowercase, and be globally unique. Replace *mystorageaccount* with your own unique name:
58
94
@@ -75,6 +111,19 @@ To restore your disk from the recovery point, you first create an Azure storage
75
111
--rp-name myRecoveryPointName
76
112
```
77
113
114
+
As mentioned above, the unmanaged disks will be restored to their original storage account. This provides the best restore performance. But if all unmanaged disks need to be restored to given storage account, then use the relevant flag as shown below.
115
+
116
+
```azurecli-interactive
117
+
az backup restore restore-disks \
118
+
--resource-group myResourceGroup \
119
+
--vault-name myRecoveryServicesVault \
120
+
--container-name myVM \
121
+
--item-name myVM \
122
+
--storage-account mystorageaccount \
123
+
--rp-name myRecoveryPointName
124
+
--restore-to-staging-storage-account
125
+
```
126
+
78
127
## Monitor the restore job
79
128
80
129
To monitor the status of restore job, use [az backup job list](https://docs.microsoft.com/cli/azure/backup/job?view=azure-cli-latest#az-backup-job-list):
When the *Status* of the restore job reports *Completed*, the disk has been restored to the storage account.
148
+
When the *Status* of the restore job reports *Completed*, the necessary information (VM configuration and the deployment template) has been restored to the storage account.
100
149
101
-
## Convert the restored disk to a Managed Disk
150
+
## Create a VM from the restored disk
102
151
103
-
The restore job creates an unmanaged disk. In order to create a VM from the disk, it must first be converted to a managed disk.
152
+
The final step is to create a VM from the restored disks. You can use the deployment template downloaded to the given storage account to create the VM.
104
153
105
-
1. Obtain the connection information for your storage account with [az storage account show-connection-string](https://docs.microsoft.com/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-show-connection-string). Replace *mystorageaccount* with the name of your storage account as follows:
154
+
### Fetch the Job details
106
155
107
-
```azurecli-interactive
108
-
export AZURE_STORAGE_CONNECTION_STRING=$( az storage account show-connection-string \
109
-
--resource-group myResourceGroup \
110
-
--output tsv \
111
-
--name mystorageaccount )
112
-
```
156
+
The resultant job details give the template URI that can be queried and deployed. Use the job show command to get more details for the triggered restored job.
113
157
114
-
2. Your unmanaged disk is secured in the storage account. The following commands get information about your unmanaged disk and create a variable named *uri* that is used in the next step when you create the Managed Disk.
158
+
```azurecli-interactive
159
+
az backup job show \
160
+
-v myRecoveryServicesVault \
161
+
-g myResourceGroup \
162
+
-n 1fc2d55d-f0dc-4ca6-ad48-aca0fe5d0414
163
+
```
115
164
116
-
```azurecli-interactive
117
-
container=$(az storage container list --query [0].name -o tsv)
118
-
blob=$(az storage blob list --container-name $container --query [0].name -o tsv)
The output of this query will give all details but we are interested only in the storage account contents. We can use the [query capability](https://docs.microsoft.com/cli/azure/query-azure-cli?view=azure-cli-latest) of Azure CLI to fetch the relevant details
121
166
122
-
3. Now you can create a Managed Disk from your recovered disk with [az disk create](https://docs.microsoft.com/cli/azure/disk?view=azure-cli-latest#az-disk-create). The *uri* variable from the preceding step is used as the source for your Managed Disk.
4. As you now have a Managed Disk from your restored disk, clean up the unmanaged disk and storage account with [az storage account delete](/cli/azure/storage/account?view=azure-cli-latest#az-storage-account-delete). Replace *mystorageaccount* with the name of your storage account as follows:
188
+
The template is not directly accessible since it is under a customer's storage account and the given container. We need the complete URL (along with a temporary SAS token) to access this template.
132
189
133
-
```azurecli-interactive
134
-
az storage account delete \
135
-
--resource-group myResourceGroup \
136
-
--name mystorageaccount
137
-
```
190
+
First, extract the template blob Uri from job details
2. To confirm that your VM has been created from your recovered disk, list the VMs in your resource group with [az vm list](/cli/azure/vm?view=azure-cli-latest#az-vm-list) as follows:
208
+
So, the template name from the above example will be ```azuredeploy1fc2d55d-f0dc-4ca6-ad48-aca0519c0232.json``` and the container name is ```myVM-daa1931199fd4a22ae601f46d8812276```
154
209
155
-
```azurecli-interactive
156
-
az vm list --resource-group myResourceGroup --output table
157
-
```
210
+
Now get the SAS token for this container and template as detailed [here](https://docs.microsoft.com/azure/azure-resource-manager/templates/secure-template-with-sas-token?tabs=azure-cli#provide-sas-token-during-deployment)
Now deploy the template to create the VM as explained [here](https://docs.microsoft.com/azure/azure-resource-manager/templates/deploy-cli).
235
+
236
+
```azurecli-interactive
237
+
az group deployment create \
238
+
--resource-group ExampleGroup \
239
+
--template-uri $url?$token
240
+
```
241
+
242
+
To confirm that your VM has been created from your recovered disk, list the VMs in your resource group with [az vm list](/cli/azure/vm?view=azure-cli-latest#az-vm-list) as follows:
243
+
244
+
```azurecli-interactive
245
+
az vm list --resource-group myResourceGroup --output table
0 commit comments