2015年11月15日星期日

VMware Workstation 4 Snapshot

VMware Workstation 4

Features | Documentation | Knowledge Base | Discussion Forums
previous Prev   Contents   Last   Next next
Using the Snapshot
The snapshot feature is most useful when you want to preserve the state of the virtual machine so you can return to the same state repeatedly.
To simply save the current state of your virtual machine, then pick up work later with the virtual machine in the same state it was when you stopped, suspend the virtual machine. For details, see Using Suspend and Resume.
You can take a snapshot of a virtual machine at any time and revert to that snapshot at any time.
You can take a snapshot while a virtual machine is powered on, powered off or suspended. A snapshot preserves the virtual machine just as it was when you took the snapshot - the state of the data on all the virtual machine's disks and whether the virtual machine was powered on, powered off or suspended.
Note: If you are using a legacy virtual machine - a virtual machine created under VMware Workstation 3 and not upgraded to use the new VMware Workstation 4 virtual hardware - you must power off the virtual machine before taking a snapshot. For information on upgrading the virtual hardware, see Upgrading VMware Workstation.
When you revert to a snapshot, you discard all changes made to the virtual machine since you took the snapshot.
Use the Snapshot and Revert buttons on the Workstation toolbar to take a snapshot and revert to it later.
You can take a new snapshot at any time. When you do so, you replace the previous snapshot. You can have only one active snapshot at a time.
What Is Captured by the Snapshot?
The snapshot captures the entire state of the virtual machine at the time you take the snapshot. This includes:
  •  The state of all the virtual machine's disks.
  •  The contents of the virtual machine's memory.
  •  The virtual machine settings.
When you revert to the snapshot, you return all these items to the state they were in at the time you took the snapshot.
Note: In certain special purpose configurations, you may want to exclude one or more of the virtual machine's disks from the snapshot. To exclude a disk from the snapshot, choose EditVirtual Machine Settings, select the drive you want to exclude, then click Advanced. On the advanced settings screen, select Independent. You have the following options for an independent disk:
  •  Persistent - changes are immediately and permanently written to the disk. All changes to an independent disk in persistent mode remain, even when you revert to the snapshot.
  •  Nonpersistent - changes to the disk are discarded when you power off or revert to the snapshot.
Settings for the Snapshot
You can also specify what you want VMware Workstation to do with the snapshot any time the virtual machine is powered off. To do so, go to Edit > Virtual Machine Settings >Options > Snapshot and select one of the choices under When powering off.
Options when powering off include
  •  Don't change the snapshot - leaves the snapshot as it is.
  •  Revert to the snapshot - reverts to the snapshot so the virtual machine always starts in the same state; reverting to the snapshot discards changes.
  •  Update the snapshot- takes a new snapshot of the virtual machine state as it was just before you powered off; this replaces the previous snapshot.
  •  Ask me - always asks what you want to do with the snapshot when you power off.
If the virtual machine has no snapshot, you can disable the snapshot feature by selectingDisable snapshots. If you have a snapshot and want to disable the snapshot feature, first go to the VMware Workstation menu and choose Snapshot > Remove Snapshot. Then return to the Virtual Machine Control Panel and select Disable snapshots.
To lock the snapshot so no new snapshot can be taken, select Lock this snapshot.
Updating the Snapshot When You Change Virtual Machine Settings
When you change settings in the Virtual Machine Control Panel, you may want to update the snapshot so these new settings are in effect when you revert to the snapshot. The most convenient way to do so is to select Update the snapshot after changing settings at the bottom of the Virtual Machine Control Panel.
If this option is selected, when you click OK in the Virtual Machine Control Panel, VMware Workstation updates the snapshot of the virtual machine. To avoid updating the snapshot, click Cancel or deselect Update the snapshot after changing settings before you click OK.
Removing the Snapshot
You can remove the snapshot any time the virtual machine is powered off. Removing the snapshot does not destroy any data in the virtual machine. You keep all changes made since you took the snapshot, then permanently accumulate additional changes as you run the virtual machine. You cannot revert to a previous state because the snapshot no longer exists.
To remove the snapshot, shut down and power off the virtual machine. Then, on the VMware Workstation menu, choose Snapshot > Remove Snapshot.
Ways of Using the Snapshot
The following examples illustrate the most common ways you can use the snapshot.
No Snapshot
If you do not take a snapshot, your virtual machine runs the same way a physical computer does. All changes you make while you are working with a virtual machine are saved and you cannot return to an earlier state.
If you do not need to use the snapshot feature, it is best to run your virtual machine with no snapshot. This provides best performance. To be sure a virtual machine has no snapshot, choose Snapshot > Remove Snapshot.
Making Risky Changes
If you plan to make risky changes in a virtual machine (for example, testing new software or examining a virus), take a snapshot before you begin to make those risky changes. If you encounter a problem, click Revert to return the virtual machine to its state at the time you took the snapshot.
If the first action you take causes no problems and you want to protect the virtual machine in its new state, you can take a new snapshot. You can have only one snapshot at a given time. When you take the new snapshot, you replace your previous snapshot. You do not lose any data.
Starting a Virtual Machine Repeatedly in the Same State
You can configure the virtual machine to revert to the snapshot any time it is powered off. To do so, go to Edit > Virtual Machine Settings > Options > Snapshot. Under When powering off, select Revert to the snapshot. If you want the virtual machine to be suspended when you launch it, suspend the virtual machine before saving the snapshot. Similarly, if you want the virtual machine to be powered on or powered off when you launch it, be sure it is powered on or powered off when you take the snapshot.
The Snapshot and Legacy Disk Modes
If you are familiar with the disk modes used in earlier versions of VMware Workstation, you can use the snapshot to achieve equivalent results.
  •  Persistent mode - Do not take a snapshot.
  •  Undoable mode - Take a snapshot when you begin your working session. To discard all work done during the session, revert to the snapshot. To commit the work done during the session, take a new snapshot at the end of the working session. To keep the work done during a session without committing it, leave the original snapshot unchanged.
  •  Nonpersistent mode - Be sure the virtual machine is in the state you want it. Power off the virtual machine. Take a snapshot. Go to Edit > Virtual Machine Settings > Options >Snapshot. Under When powering off select Revert to snapshot.
Note: In earlier versions of VMware Workstation, disk modes had to be set individually for each disk. The snapshot introduced in VMware Workstation 4 applies by default to the entire virtual machine, including all disks attached to the virtual machine.
The Snapshot and Repeatable Resume
The repeatable resume feature in earlier versions of Workstation allowed you to resume a suspended virtual machine repeatedly in the same state. You can use the snapshot to accomplish the same thing. Run the virtual machine, be sure it is in the state you want it, then suspend it. Take a snapshot. Go to Edit > Virtual Machine Settings > Options > Snapshot. Under When powering off, select Revert to the snapshot.
The Snapshot and Legacy Virtual Machines
If you are using a legacy virtual machine - a virtual machine created under VMware Workstation 3 and not upgraded to use the new VMware Workstation 4 virtual hardware - and you have disks in undoable or nonpersistent mode, you have a snapshot. If you have persistent disks, you have no snapshot. You have the following options:
  •  Persistent mode - You have no snapshot. You may take a snapshot any time the virtual machine is powered off.
  •  Undoable mode - You have a snapshot. You may update or remove the snapshot any time the virtual machine is powered off.
  •  Nonpersistent mode - You have a snapshot. In addition, in the Virtual Machine Control Panel, the virtual machine is set to revert to the snapshot every time it is powered off. You may update or remove the snapshot any time the virtual machine is powered off. You may also change the settings in the Virtual Machine Control Panel any time the virtual machine is powered off.
The Snapshot and the Virtual Machine's Hard Disks
When a snapshot exists and the virtual machine saves data to disk, that data is written to a set of redo-log files. These files have .REDO as part of the filename and are stored in the virtual machine's working directory.
Newly saved data continues to accumulate in the redo-log files until you take an action that affects the snapshot.
  •  Remove the snapshot - When you remove the snapshot, the changes accumulated in the redo-log files are written permanently to the base disks., either the virtual disk files or the physical disks, depending on your virtual machine's hard disk configuration. This is similar to committing changes to a disk in VMware Workstation 3.
  •  Revert to the snapshot - When you revert to the snapshot, the contents of the redo-log files are discarded. Any additional changes are, once again, accumulated in the redo-log files. This is similar to discarding changes to a disk in VMware Workstation 3.
  •  Take a snapshot - If you take a snapshot when the virtual machine already has a snapshot, changes stored in the redo-log files are written permanently to the base disk. Then any subsequent changes are, once again, accumulated in the redo-log files.
The Snapshot and Other Activity in the Virtual Machine
When you take a snapshot, be aware of other activity going on in the virtual machine and the likely impact of reverting to the snapshot. In general, it is best to take the snapshot when no applications in the virtual machine are communicating with other computers.
The potential for problems is greatest if the virtual machine is communicating with another computer, especially in a production environment.
Consider a case in which you take a snapshot while the virtual machine is downloading a file from a server on the network. After you take the snapshot, the virtual machine continues downloading the file, communicating its progress to the server. If you revert to the snapshot, communications between the virtual machine and the server are confused and the file transfer fails.

Or consider a case in which you take a snapshot while an application in the virtual machine is sending a transaction to a database on a separate machine. If you revert to the snapshot - especially if you revert after the transaction starts but before it has been committed - the database is likely to be confused.

没有评论:

发表评论