Enable-SCVMHost

Restores a virtual machine host in maintenance mode to full service.

Syntax

Enable-SCVMHost
      [-VMHost] <Host>
      [-RunAsynchronously]
      [-PROTipID <Guid>]
      [-JobVariable <String>]
      [<CommonParameters>]

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.

Examples

Example 1: Restore the specified host to service

PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01"
PS C:\> Enable-SCVMHost -VMHost $VMHost

The first command gets host object named VMHost01, and then stores the object in the $VMHost variable.

The second 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 sets the host status to its current state.

Parameters

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMHost

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, see the Add-SCVMHost cmdlet.

Type:Host
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Host

This cmdlet returns a Host object.

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.