Skip to content

Commit f30704c

Browse files
authored
fixes and clarification to Step 6 and 7
Fixed a code issue in step 6 and added the container mapping...as this variable is used in a later step corrected Step 7 script to include OSType as a variable and to have ResourceGroupID filled.
1 parent d1dbe11 commit f30704c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

articles/site-recovery/hyper-v-azure-powershell-resource-manager.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,14 @@ Before you start, note that the storage account specified should be in the same
127127
$protectionContainer = Get-AsrProtectionContainer
128128
3. Associate the protection container with the replication policy, as follows:
129129
130-
$Policy = Get-AsrPolicy -FriendlyName $PolicyName
131-
$associationJob = New-AsrProtectionContainerMapping -Name $mappingName -Policy $Policy -PrimaryProtectionContainer $protectionContainer[0]
132-
130+
$Policy = Get-AsrPolicy -FriendlyName $PolicyName
131+
$associationJob = New-AsrProtectionContainerMapping -Name $mappingName -Policy $Policy -PrimaryProtectionContainer $protectionContainer[0]
133132
4. Wait for the association job to complete successfully.
134133
134+
5. Retrieve the protection container mapping.
135+
136+
$ProtectionContainerMapping = Get-ASRProtectionContainerMapping -ProtectionContainer $protectionContainer
137+
135138
## Step 7: Enable VM protection
136139
137140
1. Retrieve the protectable item that corresponds to the VM you want to protect, as follows:
@@ -140,8 +143,8 @@ Before you start, note that the storage account specified should be in the same
140143
$ProtectableItem = Get-AsrProtectableItem -ProtectionContainer $protectionContainer -FriendlyName $VMFriendlyName
141144
2. Protect the VM. If the VM you are protecting has more than one disk attached to it, specify the operating system disk by using the *OSDiskName* parameter.
142145
143-
$Ostype = "Windows" # "Windows" or "Linux"
144-
$DRjob = New-AsrReplicationProtectedItem -ProtectableItem $VM -Name $VM.Name -ProtectionContainerMapping $ProtectionContainerMapping -RecoveryAzureStorageAccountId $StorageAccountID -OSDiskName $OSDiskNameList[$i] -OS Windows -RecoveryResourceGroupId
146+
$OSType = "Windows" # "Windows" or "Linux"
147+
$DRjob = New-AsrReplicationProtectedItem -ProtectableItem $VM -Name $VM.Name -ProtectionContainerMapping $ProtectionContainerMapping -RecoveryAzureStorageAccountId $StorageAccountID -OSDiskName $OSDiskNameList[$i] -OS $OSType -RecoveryResourceGroupId $ResourceGroupID
145148
146149
3. Wait for the VMs to reach a protected state after the initial replication. This can take a while, depending on factors such as the amount of data to be replicated, and the available upstream bandwidth to Azure. When a protected state is in place, the job State and StateDescription are updated as follows:
147150

0 commit comments

Comments
 (0)