Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Add-ClusterVirtualMachineRole

Windows Server 2012 R2 and Windows 8.1

Updated: October 17, 2013

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

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.

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
Name                       OwnerNode                            State 
----                       ---------                            ----- 
Virtual Machine            node1                              Offline 

Example 2

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


PS C:\> Add-ClusterVirtualMachineRole -VirtualMachine VM1 -Name "MainServer1"
Name                       OwnerNode                            State 
----                       ---------                            ----- 
MainServer1                 node1                              Offline 

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
Report file location: C:\Windows\cluster\Reports\Highly Available Virtual Machine 0ce88dce-eb6b-4c17-a512-d13bdbe5fcba on2011.11.28 At 15.37.33.mht 
 
Name                                    OwnerNode                               State 
----                                    ---------                               ----- 
print-VM1                               node1                                   Online 

Related topics

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.