Name
VMBeginReplay
Description
$err = VMBeginReplay($vmHandle, $snapshotHandle, $options,
$propertyListHandle);
This function replays a recording of a virtual machine.
Parameters
- vmHandle
-
Identifies a virtual machine. Call VMOpen() to create a virtual
machine handle.
- snapshotHandle
-
snapshot handle that represents the recording.
- options
-
Must be VIX_VMPOWEROP_NORMAL or VIX_VMPOWEROP_LAUNCH_GUI.
- propertyListHandle
-
Must be VIX_INVALID_HANDLE.
Return Value
$err. The error code returned by the operation. For returned values, see Topics > Error Codes.
Remarks
- This function only works on a virtual machine that is not already
recording or replaying.
- Use of this function with a non-recording snapshot returns
VIX_E_INVALID_ARG.
- To display playback of the recording with the Workstation user interface,
powerOnOptions must have the VIX_VMPOWEROP_LAUNCH_GUI flag. If there is an
existing instance of the Workstation user interface, the virtual machine will
power on in a new tab within that instance. Otherwise, a new instance of
Workstation will open, and the virtual machine will power on there.
- Guest commands are not allowed while the virtual machine is replaying a
recording.
- Once the recording has finished, the virtual machine will automatically "go live";
it will resume normal execution from the last state that is part of the recording.
- The property VIX_PROPERTY_SNAPSHOT_IS_REPLAYABLE can be used to determine if a
snapshot is a recording.
Side Effects
None.
Requirements
use VMware::Vix::Simple;
use VMware::Vix::API::Constants;
since VMware Workstation 6.5
Example
my $err;
my $snapshotHandle;
my $vmHandle;
# find the appropriate snapshot handle to replay
# start the replay with the UI open
$err = VMBeginReplay($vmHandle, $snapshotHandle, VIX_VMPOWEROP_LAUNCH_GUI, VIX_INVALID_HANDLE);
die "VMBeginReplay() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;
# wait for some activity to happen, then stop replaying
$err = VMEndReplay($vmHandle, 0, VIX_INVALID_HANDLE);
die "VMEndReplay() failed, $err ", GetErrorText($err), "\n" if $err != VIX_OK;