Restore-SCVMCheckpoint

Restores a virtual machine to a specified checkpoint. 

Description

The Restore-SCVMCheckpoint restores a virtual machine to a specified checkpiont. A virtual machine checkpoint is a point-in-time "snapshot" of a virtual machine. You can use the checkpoint to revert a virtual machine to a previous state.

If the restore operation is successful, the Restore-VMCheckpoint cmdlet returns (displays) the checkpoint object. If the operation fails, the cmdlet returns an error message. 

Restoring a virtual machine to an earlier checkpoint discards all changes made to the virtual machine since the most recent checkpoint was created. However, all checkpoints, including those made after the checkpoint to which you restore a virtual machine, remain available. Therefore, a good practice is to create a new checkpoint before you restore the virtual machine to ensure that the current state of the virtual machine is available after the restore operation. 

For more information about Restore-SCVMCheckpoint, type: "Get-Help Restore-SCVMCheckpoint -online".

Parameters

VMCheckpoint

Required? true
Accept Pipeline Input? true (ByValue)
Position? named
Specifies a VMM virtual machine checkpoint object.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 
Requires a VMM checkpoint object, which can be retrieved by using the Get-SCVMCheckpoint cmdlet.

Examples

1: Restore a virtual machine to its most recent checkpoint.
PS C:\> Get-SCVMCheckpoint -VM "VM01" -MostRecent | Restore-SCVMCheckpoint 
This command gets the most recent checkpoint object for virtual machine VM01 and restores VM01 to the state that it was in at the time its most recent checkpoint was created.
2: Restore a virtual machine to the specified checkpoint.
PS C:\> $Checkpoints = Get-VMCheckpoint -VM "VM02"
PS C:\> Restore-VMCheckpoint –VMCheckpoint $Checkpoints[$Checkpoints.count - 2]
The first command gets all checkpoint objects for virtual machine VM02 and stores the objects in the $Checkpoints object array. 

The second command restores VM02 to the second-from-last checkpoint (this example assumes you have at least 2 checkpoints). VMM retains the checkpoints created after the checkpoint that you restore to, enabling you to restore the virtual machine to a later checkpoint. To restore a virtual machine to its most recent checkpoint, see Example 1.
3: View the hardware profile of the last restored checkpoint on a virtual machine.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM02"
PS C:\> $VM.LastRestoredVMCheckpoint.CheckpointHWProfile
The first command gets the virtual machine object named VM02 and stores the object in the $VM variable.This example assumes that the virtual machine has been restored to one of its checkpoints.

The second command displays information about the hardware profile of the last restored checkpoint on VM02.

See Also