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/virtual-machines/dedicated-hosts-how-to.md
+71-1Lines changed: 71 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -357,7 +357,7 @@ Move the VM to a dedicated host using the [portal](https://portal.azure.com).
357
357
1. At the top of the page, select **Start** to restart the VM.
358
358
359
359
360
-
## [CLI](#tab/cli)
360
+
###[CLI](#tab/cli)
361
361
362
362
Move the existing VM to a dedicated host using the CLI. The VM must be Stop/Deallocated using [az vm deallocate](/cli/azure/vm#az_vm_stop) in order to assign it to a dedicated host.
363
363
@@ -418,7 +418,77 @@ Start-AzVM `
418
418
419
419
---
420
420
421
+
## Move a VM from dedicated host to multi-tenant infrastructure
422
+
You can move a VM that is running on a dedicated host to multi-tenant infrastructure, but the VM must first be Stop\Deallocated.
423
+
424
+
- Make sure that your subscription have sufficient vCPU quota for the VM in the region where
425
+
- Your multi-tenant VM will be scheduled in the same region and zone as the dedicated host
426
+
427
+
428
+
### [Portal](#tab/portal)
429
+
430
+
Move a VM from dedicated host to multi-tenant infrastructure using the [portal](https://portal.azure.com).
431
+
432
+
1. Open the page for the VM.
433
+
1. Select **Stop** to stop\deallocate the VM.
434
+
1. Select **Configuration** from the left menu.
435
+
1. Select **XXXXX** under host group drop-down menu.
436
+
1. When you're done, select **Save** at the top of the page.
437
+
1. After the VM has been reconfigured as a multi-tenant VM, select **Overview** from the left menu.
438
+
1. At the top of the page, select **Start** to restart the VM.
439
+
440
+
441
+
### [CLI](#tab/cli)
442
+
443
+
Move a VM from dedicated host to multi-tenant infrastructure using the CLI. The VM must be Stop/Deallocated using [az vm deallocate](/cli/azure/vm#az_vm_stop) in order to assign it to reconfigure it as a multi-tenant VM.
444
+
445
+
Replace the values with your own information.
446
+
447
+
```azurecli-interactive
448
+
az vm deallocate -n myVM -g myResourceGroup
449
+
az vm update -n myVM -g myResourceGroup --set host.id=None
450
+
az vm start -n myVM -g myResourceGroup
451
+
```
452
+
453
+
454
+
### [PowerShell](#tab/powershell)
455
+
456
+
Move a VM from dedicated host to multi-tenant infrastructure using the PowerShell.
457
+
458
+
Replace the values of the variables with your own information.
421
459
460
+
```azurepowershell-interactive
461
+
$vmRGName = "moveoffhost"
462
+
$vmName = "myDHVM"
463
+
$dhRGName = "myDHResourceGroup"
464
+
$dhGroupName = "myHostGroup"
465
+
$dhName = "myHost"
466
+
467
+
$myDH = Get-AzHost `
468
+
-HostGroupName $dhGroupName `
469
+
-ResourceGroupName $dhRGName `
470
+
-Name $dhName
471
+
472
+
$myVM = Get-AzVM `
473
+
-ResourceGroupName $vmRGName `
474
+
-Name $vmName
475
+
476
+
Stop-AzVM `
477
+
-ResourceGroupName $vmRGName `
478
+
-Name $vmName -Force
479
+
480
+
Update-AzVM `
481
+
-ResourceGroupName $vmRGName `
482
+
-VM $myVM `
483
+
-HostId ''
484
+
485
+
Start-AzVM `
486
+
-ResourceGroupName $vmRGName `
487
+
-Name $vmName
488
+
```
489
+
490
+
491
+
---
422
492
## Check the status of the host
423
493
424
494
If you need to know how much capacity is still available on a how, you can check the status.
0 commit comments