Export (0) Print
Expand All
Expand Minimize

Disable-SCVMHost

Updated: September 27, 2012

Applies To: System Center 2012 - Virtual Machine Manager

Disable-SCVMHost

Places a virtual machine host into maintenance mode.

Syntax

Parameter Set: NoVMMigration
Disable-SCVMHost [-VMHost] <Host> [-JobVariable <String> ] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: InCluster
Disable-SCVMHost [-VMHost] <Host> [-JobVariable <String> ] [-MoveWithinCluster] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]




Detailed Description

The Disable-SCVMHost cmdlet places a virtual machine host that is managed by System Center Virtual Machine Manager (VMM) into maintenance mode so that you can perform maintenance tasks on the host such as applying security updates or replacing hardware.



You can use the Disable-SCVMHost cmdlet to put individual Hyper-V hosts, VMware ESX hosts, or Citrix XenServer hosts into maintenance mode. You can also use Disable-SCVMHost to put clustered hosts into maintenance mode.



To return the host to service, use the Enable-SCVMHost cmdlet.



HOW TO PUT HYPER-V HOSTS INTO MAINTENANCE MODE

If the host belongs to a cluster that supports live migration, you can choose either of the following methods:



Method 1: Migrate highly available virtual machines and save the other virtual machines. When the MoveWithinCluster parameter is used with Disable-SCVMHost, the cmdlet uses Live Migration to migrate all running highly available virtual machines to other hosts in the cluster. It places the running virtual machines that are not highly available into a saved state, which causes users to lose service. Then, it places the host into maintenance mode.



Method 2: Save all the virtual machines. Disable-SCVMHost places all the running virtual machines into a saved state, which causes users to lose service. Then, it places the host into maintenance mode.

If the host does not belong to a cluster, or if it belongs to a cluster that does not support live migration, Disable-SCVMHost places all of the running virtual machines into a saved state, which causes users to lose service. Then, it places the host into maintenance mode.



HOW DISABLE-SCVMHOST WORKS WITH VMWARE ESX HOSTS



When you place an ESX host into maintenance mode using Disable-SCVMHost, VMM sends a request to enter maintenance mode to the VMware cCenter Server that manages that host. The vCenter Server places the ESX host into maintenance mode.



NOTE: The system behavior of the virtual machines on the ESX Server host is determined by the configuration of the vCenter Server. For example, if the VMware Distributed Resources Scheduler is not configured, you might have to manually shut down all the virtual machines on the host. Or, you might have to move the virtual machines to another host to successfully place the ESX Server host into maintenance mode.



HOW TO PUT XENSERVER HOSTS INTO MAINTENANCE MODE

If the host belongs to a cluster that supports live migration, you can choose either of the following methods:



Method 1: Migrate highly available virtual machines and save the other virtual machines. When the MoveWithinCluster parameter is used with Disable-SCVMHost, the cmdlet uses XenServer Live Migration to migrate all running highly available virtual machines to other hosts in the cluster. It also places all the running virtual machines that are not highly available into a saved state, which causes users to lose service. Then, it places the host into maintenance mode.



Method 2: Save all the virtual machines. Disable-VMHost places all the running virtual machines into a saved state, which causes users to lose service. Then, it places the host into maintenance mode.

If the host does not belong to a cluster, or if it belongs to a cluster that does not support live migration, Disable-VMHost places all of the running virtual machines into a saved state, which causes users to lose service. Then, it places the host into maintenance mode.





HOST BEHAVIOR IN MAINTENANCE MODE



After you place a host into maintenance mode, the following actions are affected:

- Virtual machines cannot be created on the host.

- Virtual machines cannot be migrated to the host.

- The host is excluded from host ratings calculations performed during

virtual machine placement.

- The host status is not updated.



However, you can perform the following actions:

- Remove the host from VMM if you make sure that the host is available and

that its agent is in an appropriate state.

- Start or stop virtual machines on the host.

- Change the host properties.

- Migrate a virtual machine from the host to another host.

For more information about Disable-SCVMHost, type: "Get-Help Disable-SCVMHost -online".

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

-MoveWithinCluster

Indicates that all virtual machines currently deployed on a host that is a member of a host cluster will be migrated to another host in the same host cluster if that host is placed into maintenance mode.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of 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". See the examples for a specific cmdlet to determine how that cmdlet uses this parameter.


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.

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:

    - Patching stored virtual machines and templates.

    - Staging scripted virtual machine creation before you move the virtual

    machines into your production environment.

Examples

1: Place the specified host into maintenance mode and save all running virtual machines.

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



The second command places all running virtual machines that are deployed on the host stored in $VMHost into a saved state. Then it sets the host status to "In Maintenance Mode".


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

2: Use live migration to migrate all running highly available virtual machines on a cluster node that is in maintenance mode.

The first command gets the host object named VMHost02 and stores the object in the $VMHost variable.



The second command uses live migration to migrate all running highly available virtual machines on the host stored in $VMHost to another node in the cluster. It places other running virtual machines into a saved state and then sets the value for the host state property to "In Maintenance Mode".


PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost02"PS C:\> Disable-SCVMHost -VMHost $VMHost -MoveWithinCluster

Related topics

 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft