PowerShell Logo Small

Move-ClusterVirtualMachineRole



This is the built-in help made by Microsoft for the command 'Move-ClusterVirtualMachineRole', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Moves the ownership of a clustered virtual machine to a different node.

SYNTAX


Move-ClusterVirtualMachineRole [[-Name] <String>] [[-Node] <String>] [-Cancel] [-Cluster <String>] [-IgnoreLocked] [-InputObject <PSObject>] [-MigrationType
<NativeGroupHelp.VmMigrationType>] [-VMId <Guid>] [-Wait <Int32>] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Move-ClusterVirtualMachineRole cmdlet moves the ownership of a clustered virtual machine to a different node.


This cmdlet is used to live migrate a clustered virtual machine. For quick migration, use Move-ClusterGroup after using Get-ClusterResource and Set-ClusterParameter to set
the OfflineAction parameter of the virtual machine resource to save state, or a value of 1.


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



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?LinkId=321048
Add-ClusterVirtualMachineRole
Update-ClusterVirtualMachineConfiguration

REMARKS

<

Examples


Example 1

PS C:\>Move-ClusterVirtualMachineRole –Name "Virtual Machine1" -Node node2
Name OwnerNode State
---- --------- -----
Virtual Machine1 node2 Online



This example performs a live migration of the clustered virtual machine named Virtual Machine1 to the node named node2. The Windows PowerShell® prompt does not return until
the action is complete.




Example 2

PS C:\>Get-ClusterGroup –Name "Virtual Machine1" | Move-ClusterVirtualMachineRole -Node node2 -Wait 0
Name OwnerNode State
---- --------- -----
Virtual Machine1 node2 Online



This example performs a live migration of clustered virtual machine named Virtual Machine1 to the node named node2. The Windows PowerShell® prompt returns as soon as the
action has been initiated.




Example 3

PS C:\>Move-ClusterVirtualMachineRole –Name "Virtual Machine1" -Cancel
Name OwnerNode State
---- --------- -----
Virtual Machine1 node1 Online



This example cancels the live migration in progress for the clustered virtual machine named Virtual Machine1.




Example 4

PS C:\>$groups = Get-ClusterNode –Name node1 | Get-ClusterGroup | Where-Object –FilterScript {$_ | Get-ClusterResource | Where-Object –FilterScript {$_.ResourceType -Like
"Virtual Machine"}}



PS C:\>ForEach-Object -InputObject ($group in $groups) -Process { $group | Move-ClusterVirtualMachineRole -Node node2 }
Name OwnerNode State
---- --------- -----
Virtual Machine1 node2 Online
Virtual Machine2 node2 Online
Virtual Machine3 node2 Online



This example performs a live migration of all clustered virtual machines that are currently owned by the node named node1 to the node named node2. The migration of each
virtual machine should complete before the next migration is started. Use this cmdlet before performing maintenance on the specified node.