편집

다음을 통해 공유


Move-ClusterVirtualMachineRole

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

Syntax

Default (Default)

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

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.

Examples

Example 1

Move-ClusterVirtualMachineRole -Name "Virtual Machine1" -Node node2

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

Example 2

Get-ClusterGroup -Name "Virtual Machine1" | Move-ClusterVirtualMachineRole -Node node2 -Wait 0

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

Move-ClusterVirtualMachineRole -Name "Virtual Machine1" -Cancel

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

Example 4

$vmGroups = Get-ClusterNode -Name node1 |
    Get-ClusterGroup |
    Where-Object -FilterScript {
        Get-ClusterResource -InputObject $_ |
            Where-Object ResourceType -Like "Virtual Machine"
    }
ForEach-Object -InputObject $vmGroups -Process { $_ | Move-ClusterVirtualMachineRole -Node node2 }

This example queries a specific cluster node, node1, to find the currently owned groups. The example further filters the owned groups where there resource type is a virtual machine cluster resource. The filtered groups are stored in the $vmGroups variable. For each cluster group in the variable, the command will perform a live migration of all clustered virtual machines to the node named node2. The migration of each virtual machine will complete before the next migration is started.

Parameters

-Cancel

Specifies that an in-progress live migration of the virtual machine be canceled.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Cluster

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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IgnoreLocked

Specifies that locked groups are ignored when running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specifies the clustered virtual machine to move.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-MigrationType

Specifies the type of migration to perform for the virtual machine. The options are as follows:

  • Live: Transparently migrates the virtual machine without a dropped network connection or perceived downtime.

  • Quick: Rapidly migrates a running virtual machine with minimal downtime.

  • Shutdown: Performs an orderly shutdown of the operating system (waiting for all processes to close) on the virtual machine, and then migrates the virtual machine.

  • ShutdownForce: Shuts down the operating system on the virtual machine without waiting for slower processes to finish, and then migrates the virtual machine.

  • TurnOff: Turns off the virtual machine without shutting down the operating system first, then migrates the virtual machine. This is the same as turning off the power, which means that data loss may occur.

Parameter properties

Type:VmMigrationType
Default value:None
Accepted values:TurnOff, Quick, Shutdown, ShutdownForce, Live
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the clustered virtual machine to move.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Node

Specifies the name of the cluster node to which to move the virtual machine.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VMId

Specifies the virtual machine identifier (ID).

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Wait

Specifies the time in seconds to wait for the cmdlet. If the Wait parameter isn't specified, then the cmdlet waits for completion. If -Wait 0 is specified, then the call is initiated and the cmdlet returns without waiting.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.FailoverClusters.PowerShell.ClusterGroup

Outputs

Microsoft.FailoverClusters.PowerShell.ClusterGroup