Enable-SCVMHost
Enable-SCVMHost
Restores a virtual machine host in maintenance mode to full service.
Syntax
Parameter Set: Default
Enable-SCVMHost [-VMHost] <Host> [-JobVariable <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]
Detailed Description
The Enable-SCVMHost cmdlet restores a virtual machine host in maintenance mode to full service as a host managed by Virtual Machine Manager (VMM).
Enable-SCVMHost supports any type of host managed by VMM, including Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.
When you use Enable-SCVMHost to restore a host to full service, VMM automatically restores some capabilities but requires you to perform certain actions manually.
VMM automatically re-enables the following items:
-- Creation of virtual machines on the host.
-- Migration of virtual machines to the host.
-- Host ratings for the host.
VMM also automatically refreshes the host to its current state.
You must manually restart any virtual machines that are in a saved state on a standalone host. For hosts that are a node in a host cluster, you must manually restart the virtual machines and manually move any migrated virtual machines back to this node that you migrated to another node when you placed the host into maintenance mode.
Parameters
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PROTipID<Guid]>
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMHost<Host>
Specifies a virtual machine host object. VMM supports Hyper-V hosts, VMware ESX hosts, and Citrix XenServer hosts.
For more information about each type of host, type Get-Help Add-SCVMHost -detailed
.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
- Host
- Host[]
Notes
A host that you put into temporary maintenance mode is different from a host that you designate as a maintenance host. A maintenance host is a host that you dedicate for virtual machine maintenance tasks, such as the following tasks:
-- Patching stored virtual machines and templates.
-- Staging scripted virtual machine creation before you move the virtual machines into your production environment.
Examples
Example 1: Restore the specified host to service
The first command gets host object named VMHost01, and then stores the object in the $VMHost variable.
The second command unblocks virtual machine creation operations on the host stored in $VMHost, and includes the host in host ratings during placement. It also takes the host status out of In Maintenance Mode so that the next host refresh job will set the host status to its current state.
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01"
PS C:\> Enable-SCVMHost -VMHost $VMHost