Repair-SCVirtualMachine

Repair-SCVirtualMachine

Repairs a virtual machine in a failed state.

構文

Parameter Set: Agent
Repair-SCVirtualMachine [-VM] <VM> -Agent [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: Dismiss
Repair-SCVirtualMachine [-VM] <VM> -Dismiss [-Force] [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: MigrateDBOnlyVM
Repair-SCVirtualMachine -MigrateDBOnlyVM -VMHost <Microsoft.SystemCenter.VirtualMachineManager.Host> [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [ <CommonParameters>]

Parameter Set: Retry
Repair-SCVirtualMachine [-VM] <VM> -Retry [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

Parameter Set: Undo
Repair-SCVirtualMachine [-VM] <VM> -Undo [-JobVariable <String> ] [-OnBehalfOfUser <System.String> ] [-OnBehalfOfUserRole <Microsoft.SystemCenter.VirtualMachineManager.UserRole> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [ <CommonParameters>]

詳細説明

The Repair-SCVirtualMachine cmdlet repairs a virtual machine in a failed state that is on a host managed by Virtual Machine Manager (VMM). A virtual machine can be in one of four types of failed state:

-- Creation Failed
-- Migration Failed
-- Update Failed
-- Deletion Failed

You can use this command to repair a failure as follows:

-- Retry. Attempts to perform the failed job again.

-- Undo. Attempts to undo any changes made to the virtual machine and restore it to a healthy state. For example, if a Move-SCVirtualMachine job fails, using the Undo parameter attempts to move the virtual machine back to its previous host.

-- Dismiss. Dismisses the failed job and refreshes the virtual machine based on its current state. If you manually fix a failure (for example, by manually moving the .vhd and .vmc files to a new host after a failed Move-SCVirtialMachine attempt), you can use the Dismiss parameter to refresh the data for the virtual machine in the VMM database. However, using the Dismiss option might return the object to the failed state.

When you run Repair-SCVirtualMachine, you can specify only one type of action at a time.

You can run Repair-SCVirtualMachine to repair an in-guest agent for a virtual machine that is part of a service by using the Agent parameter.

パラメーター

-Agent

Indicates that the VMM in-guest agent should be repaired or upgraded, as applicable.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Dismiss

Dismisses the error on an object or an update notification on a service instance.

After an error is dismissed, the object is refreshed. If the error reappears, refreshing does not solve the problem and you must fix the error.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Force

Forces the operation to complete.

For example:

- Remove-SCSCVMHost -Force

Forces the removal of a host object from the VMM database.

- Stop-SCVirtualMachine -Force

Stops a virtual machine.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-MigrateDBOnlyVM

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUser<System.String>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-OnBehalfOfUserRole<Microsoft.SystemCenter.VirtualMachineManager.UserRole>

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Retry

Retries the last task that failed on a VMM object in an attempt to complete the task successfully.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Undo

Cancels the last job run on a VMM object and reverses any changes that were made. This parameter is available only if the most recent job failed.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VM<VM>

Specifies a virtual machine object.

エイリアス

none

必須?

true

位置は?

1

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-VMHost<Microsoft.SystemCenter.VirtualMachineManager.Host>

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • VirtualMachine

  • This cmdlet requires a virtual machine object, which can be retrieved by using the Get-SCVirtualMachine cmdlet.

Example 1: Repair a failed migration task by retrying the migration task

The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable. This example assumes that the task that you want to repair by using the Retry parameter is an attempt to move the virtual machine from one host to another.

The second command repairs the virtual machine object stored in $VM by restarting the previous failed migration task.

PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Repair-SCVirtualMachine -VM $VM -Retry

Example 2: Repair or upgrade the VMM In-guest agent on a specified virtual machine that is part of a service

The first command gets the virtual machine object named ServiceVM01, and then stores the object in the $VM variable. This example assumes that the virtual machine is part of a service.

The second command gets a credential object, which must be a local administrator on the virtual machine to be repaired, and then stores the object in the $Creds variable.

The third command repairs the in-guest agent on the virtual machine object stored in $VM.

PS C:\> $VM = Get-SCVirtualMachine -Name "ServiceVM01"
PS C:\> $Creds = Get-Credential
PS C:\> Repair-SCVirtualMachine -VM $VM -Credential $Creds -Agent

関連トピック

Get-SCVirtualMachine

Move-SCVirtualMachine

New-SCVirtualMachine

Read-SCVirtualMachine

Register-SCVirtualMachine

Remove-SCVirtualMachine

Reset-SCVirtualMachine

Resume-SCVirtualMachine

Set-SCVirtualMachine

Start-SCVirtualMachine

Stop-SCVirtualMachine

Suspend-SCVirtualMachine