Restore-SCVMCheckpoint
Restore-SCVMCheckpoint
Restores a virtual machine to a specified checkpoint.
Syntax
Parameter Set: Default
Restore-SCVMCheckpoint -VMCheckpoint <VMCheckpoint> [-JobVariable <String> ] [-PROTipID <Guid> ] [-RunAsynchronously] [ <CommonParameters>]
Detailed Description
The Restore-SCVMCheckpoint restores a virtual machine to a specified checkpoint. 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.
Parameters
-JobVariable<String>
Specifies that job progress is tracked and stored in the variable named by this parameter.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PROTipID<Guid>
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-VMCheckpoint<VMCheckpoint>
Specifies a VMM virtual machine checkpoint object.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
True (ByValue) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
- VMCheckpoint
Notes
- 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.
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.
PS C:\> Get-SCVMCheckpoint -VM "VM01" -MostRecent | Restore-SCVMCheckpoint
2: Restore a virtual machine to the specified checkpoint.
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.
PS C:\> $Checkpoints = Get-VMCheckpoint -VM "VM02"
PS C:\> Restore-VMCheckpoint –VMCheckpoint $Checkpoints[$Checkpoints.count - 2]
3: View the hardware profile of the last restored checkpoint on a virtual machine.
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.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM02"
PS C:\> $VM.LastRestoredVMCheckpoint.CheckpointHWProfile