Add-ClusterVirtualMachineRole

Add-ClusterVirtualMachineRole

Creates a clustered virtual machine, that is, a virtual machine that can be failed over if necessary to a different server in the failover cluster.

Syntax

Parameter Set: InputObject
Add-ClusterVirtualMachineRole [[-VMName] <String> ] [-Cluster <String> ] [-InputObject <PSObject> ] [-Name <String> ] [-VirtualMachine <String> ] [-VMId <Guid> ] [ <CommonParameters>]

Detailed Description

The Add-ClusterVirtualMachineRole cmdlet creates a clustered virtual machine, that is, a virtual machine that can be failed over if necessary to a different server in the failover cluster.

By creating clustered virtual machines, you can consolidate multiple servers on one physical server without causing that server to become a single point of failure. Instead, if that server, or cluster node, fails or requires scheduled maintenance, then another node begins to run the virtual machines instead through a process known as failover. The virtual hard disk (VHD) file for the clustered virtual machine must be on the clustered disk used by that virtual machine.

Note: This cmdlet cannot be run remotely without Credential Security Service Provider (CredSSP) authentication on the server computer.

Parameters

-Cluster<String>

Specifies the name of the cluster on which to run this cmdlet. If the input for this parameter is . or it is omitted, then the cmdlet runs on the local cluster.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InputObject<PSObject>

Specifies the cluster on which to create the highly available virtual machine.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the highly available virtual machine to create.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMId<Guid>

Specifies the virtual machine identifier (ID).

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-VMName<String>

Specifies the name of the virtual machine to make highly available. Use either the VirtualMachine parameter or the VMName parameter to specify the name of the virtual machine.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-VirtualMachine<String>

Specifies the name of the virtual machine to make highly available. Use either the VirtualMachine parameter or the VMName parameter to specify the name of the virtual machine.

Aliases

vm

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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.

  • Microsoft.FailoverClusters.PowerShell.Cluster

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.FailoverClusters.PowerShell.ClusterGroup

Examples

Example 1

This example configures VM1 as a clustered virtual machine, and assigns a default name.

PS C:\> Add-ClusterVirtualMachineRole -VirtualMachine VM1

Example 2

This example configures VM1 as a clustered virtual machine, and assigns the name MainServer1.

PS C:\> Add-ClusterVirtualMachineRole -VirtualMachine VM1 -Name "MainServer1"

Example 3

This example queries for virtual machines matching the wildcard characters *print* and configures them as clustered virtual machines.

PS C:\> Get-VM –Name *print* | Add-ClusterVirtualMachineRole

Move-ClusterVirtualMachineRole

Update-ClusterVirtualMachineConfiguration

Get-VM