@@ -66,7 +66,7 @@ Get-AzProximityPlacementGroup -ResourceId $ppg.Id |
66
66
Format-Table -Property VirtualMachines -Wrap
67
67
```
68
68
69
- ## Move an existing VM into a proximity placement group
69
+ ### Move an existing VM into a proximity placement group
70
70
71
71
You can also add an existing VM to a proximity placement group. You need to stop\deallocate the VM first, then update the VM and restart.
72
72
@@ -78,7 +78,7 @@ Update-AzVM -VM $vm -ResourceGroupName $vm.ResourceGroupName -ProximityPlacement
78
78
Restart-AzVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName
79
79
```
80
80
81
- ## Move an existing VM out of a proximity placement group
81
+ ### Move an existing VM out of a proximity placement group
82
82
83
83
To remove a VM from a proximity placement group, you need to stop\deallocate the VM first, then update the VM and restart.
84
84
@@ -120,6 +120,7 @@ foreach ($vmId in $vmIDs){
120
120
```
121
121
122
122
### Move an existing availability set out of a proximity placement group
123
+
123
124
``` azurepowershell-interactive
124
125
$resourceGroup = "myResourceGroup"
125
126
$avSetName = "myAvailabilitySet"
@@ -149,19 +150,23 @@ To add or remove an existing scale set to a proximity placement group, you first
149
150
150
151
### Move an existing scale set into a proximity placement group
151
152
153
+ ``` azurepowershell-interactive
152
154
$ppg = Get-AzProximityPlacementGroup -ResourceGroupName myPPG -Name myPPG
153
155
$vmss = Get-AzVmss -ResourceGroupName myVMSSResourceGroup -VMScaleSetName myScaleSet
154
156
Stop-AzVmss -VMScaleSetName $vmss.Name -ResourceGroupName $vmss.ResourceGroupName
155
157
Update-AzVmss -VMScaleSetName $vmss.Name -ResourceGroupName $vmss.ResourceGroupName -ProximityPlacementGroupId $ppg.Id
156
158
Restart-AzVmss -VMScaleSetName $vmss.Name -ResourceGroupName $vmss.ResourceGroupName
159
+ ```
157
160
158
161
### Move an existing scale set out of a proximity placement group
159
162
163
+ ``` azurepowershell-interactive
160
164
$vmss = Get-AzVmss -ResourceGroupName myVMSSResourceGroup -VMScaleSetName myScaleSet
161
165
Stop-AzVmss -VMScaleSetName $vmss.Name -ResourceGroupName $vmss.ResourceGroupName
162
166
$vmss.ProximityPlacementGroup = ""
163
167
Update-AzVmss -VirtualMachineScaleSet $vmss -VMScaleSetName $vmss.Name -ResourceGroupName $vmss.ResourceGroupName
164
168
Restart-AzVmss -VMScaleSetName $vmss.Name -ResourceGroupName $vmss.ResourceGroupName
169
+ ```
165
170
166
171
## Next steps
167
172
0 commit comments