VirtualBox

Changeset 21808 in vbox for trunk/src


Ignore:
Timestamp:
Jul 27, 2009 11:26:46 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50415
Message:

Main: rewrite snapshot documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r21783 r21808  
    44664466    <attribute name="currentSnapshot" type="ISnapshot" readonly="yes">
    44674467      <desc>
    4468         Current snapshot of this machine.
    4469         <note>
    4470           A @c null object is returned if the machine doesn't
    4471           have snapshots.
    4472         </note>
    4473         <see><link to="ISnapshot"/></see>
     4468        Current snapshot of this machine. This is @c null if the machine
     4469        currently has no snapshots. Otherwise, this is always the last snapshot
     4470        in the current implementation; see <link to="ISnapshot"/> for details.
    44744471      </desc>
    44754472    </attribute>
     
    65046501
    65056502        The taken snapshot is always based on the
    6506         <link to="IMachine::currentSnapshot">current
    6507           snapshot</link> of the associated virtual machine and becomes
    6508         a new current snapshot.
     6503        <link to="IMachine::currentSnapshot">current snapshot</link>
     6504        of the associated virtual machine and becomes a new current snapshot.
    65096505
    65106506        <note>
     
    80228018      machine.
    80238019
    8024       The <i>snapshot</i> stores all the information about a virtual
    8025       machine necessary to bring it to exactly the same state as it was at
    8026       the time of taking the snapshot. The snapshot includes:
     8020      Together with the differencing hard disks that are created
     8021      when a snapshot is taken, a machine can be brought back to
     8022      the exact state it was in when the snapshot was taken.
     8023
     8024      The ISnapshot interface has no methods, only attributes; snapshots
     8025      are controlled through methods of the <link to="IConsole" /> interface
     8026      which also manage the hard disk images associated with the snapshot.
     8027      The following operations exist:
    80278028
    80288029      <ul>
    8029         <li>all settings of the virtual machine (i.e. its hardware
    8030           configuration: RAM size, attached hard disks, etc.)
    8031         </li>
    8032         <li>the execution state of the virtual machine (memory contents,
    8033           CPU state, etc.).
    8034         </li>
     8030          <li><link to="IConsole::takeSnapshot"/>: creates a new snapshot
     8031              by creating new, empty differencing images for the machine's
     8032              hard disks and saving the VM settings and (if the VM is running)
     8033              the current VM state in the snapshot.
     8034
     8035              The differencing images will then receive all data written to
     8036              the machine's hard disks, while their parent (base) images
     8037              remain unmodified after the snapshot has been taken (see
     8038              <link to="IHardDisk" /> for details about differencing images).
     8039              This simplifies restoring a machine to the state of a snapshot:
     8040              only the differencing images need to be deleted.
     8041
     8042              The current machine state is not changed by taking a snapshot.
     8043              If the machine is running, it will resume execution after the
     8044              snapshot has been taken.
     8045          </li>
     8046
     8047          <li><link to="IConsole::discardCurrentState"/>: this goes back to
     8048              a previous snapshot. This resets the machine's state to that of
     8049              the previous snapshot by deleting the differencing image of each
     8050              of the machine's hard disks and setting the machine's settings
     8051              and state to the state that was saved in the snapshot (if any).
     8052
     8053              This destroys the machine's current state.
     8054          </li>
     8055
     8056          <li><link to="IConsole::discardSnapshot"/>: deletes a snapshot
     8057              without affecting the current machine state.
     8058
     8059              This does not change the machine, but instead frees the resources
     8060              allocated when the snapshot was taken: the settings and machine state
     8061              is deleted (if any), and the snapshot's differencing image for each
     8062              of the machine's hard disks gets merged with its parent image.
     8063
     8064              Neither the current machine state nor other snapshots are affected
     8065              by this operation, except that parent disk images will be modified
     8066              to contain the disk data associated with the snapshot being deleted.
     8067          </li>
     8068
     8069          <li><link to="IConsole::discardCurrentSnapshotAndState"/>:
     8070              this completely reverts the virtual machine to the state it was in
     8071              before the current snapshot has been taken. Effectively, this goes
     8072              back to the state before the current snapshot, which might be
     8073              an earlier snapshot.
     8074
     8075              The current state, as well as the current snapshot, are lost.
     8076          </li>
    80358077      </ul>
    80368078
    8037       Snapshots can be <i>offline</i> (taken when the VM is powered off)
    8038       or <i>online</i> (taken when the VM is running). The execution
    8039       state of the offline snapshot is called a <i>zero execution state</i>
    8040       (it doesn't actually contain any information about memory contents
    8041       or the CPU state, assuming that all hardware is just powered off).
    8042 
    8043       <h3>Snapshot branches</h3>
    8044 
    8045       Snapshots can be chained. Chained snapshots form a branch where
    8046       every next snapshot is based on the previous one. This chaining is
    8047       mostly related to hard disk branching (see <link to="IHardDisk"/>
    8048       description). This means that every time a new snapshot is created,
    8049       a new differencing hard disk is implicitly created for all normal
    8050       hard disks attached to the given virtual machine. This allows to
    8051       fully restore hard disk contents when the machine is later reverted
    8052       to a particular snapshot.
     8079      Each snapshot contains the settings of the virtual machine (hardware
     8080      configuration etc.). In addition, if the machine was running when the
     8081      snapshot was taken (<link to="IMachine::state"/> is <link to="MachineState_Running"/>),
     8082      the current VM state is saved in the snapshot (similarly to what happens
     8083      when a VM's state is saved). The snapshot is then said to
     8084      be <i>online</i> because when restoring it, the VM will be running.
     8085
     8086      If the machine is saved (<link to="MachineState_Saved"/>), the snapshot
     8087      receives a copy of the execution state file (<link to="IMachine::stateFilePath"/>).
     8088
     8089      Otherwise, if the machine was not running (<link to="MachineState_PoweredOff"/>
     8090      or <link to="MachineState_Aborted"/>), the snapshot is <i>offline</i>;
     8091      it then contains a so-called "zero execution state", representing a
     8092      machine that is powered off.
     8093
     8094      <h3>Snapshot branches and the "current" snapshot</h3>
     8095
     8096      Snapshots can be chained, whereby every next snapshot is based on the
     8097      previous one. This chaining is related to hard disk branching
     8098      (see the <link to="IHardDisk"/> description) in that every time
     8099      a new snapshot is created, a new differencing hard disk is implicitly
     8100      created for all normal hard disks attached to the machine.
     8101
     8102      Each virtual machine has a "current snapshot", identified by
     8103      <link to="IMachine::currentSnapshot"/>. Presently, this is always set
     8104      to the last snapshot in the chain. In a future version of VirtualBox,
     8105      it will be possible to reset a machine's current state to that of an
     8106      earlier snapshot without discarding the current state so that it will be
     8107      possible to create alternative snapshot paths in a snapshot tree.
    80538108
    80548109      In the current implementation, multiple snapshot branches within one
     
    80568111      and <link to="IConsole::takeSnapshot"/> operation adds a new
    80578112      snapshot to the top of that branch.
    8058 
    8059       Existing snapshots can be discarded using
    8060       <link to="IConsole::discardSnapshot"/>.
    8061 
    8062       <h3>Current snapshot</h3>
    8063 
    8064       Every virtual machine has a current snapshot, identified by
    8065       <link to="IMachine::currentSnapshot"/>. This snapshot is used as
    8066       a base for the <i>current machine state</i> (see below), to the effect
    8067       that all normal hard disks of the machine and its execution
    8068       state are based on this snapshot.
    8069 
    8070       In the current implementation, the current snapshot is always the
    8071       last taken snapshot (i.e. the head snapshot on the branch) and it
    8072       cannot be changed.
    8073 
    8074       The current snapshot is @c null if the machine doesn't have
    8075       snapshots at all; in this case the current machine state is just
    8076       current settings of this machine plus its current execution state.
    8077 
    8078       <h3>Current machine state</h3>
    8079 
    8080       The current machine state is what represented by IMachine instances got
    8081       directly from IVirtualBox
    8082       using <link
    8083       to="IVirtualBox::getMachine">getMachine()</link>, <link
    8084       to="IVirtualBox::findMachine">findMachine()</link>, etc. (as opposed
    8085       to instances returned by <link to="ISnapshot::machine"/>).  This state
    8086       is always used when the machine is <link to="IConsole::powerUp"> powered
    8087       on</link>.
    8088 
    8089       The current machine state also includes the current execution state.
    8090       If the machine is being currently executed
    8091       (<link to="IMachine::state"/> is <link to="MachineState_Running"/>
    8092       and above), its execution state is just what's happening now.
    8093       If it is powered off (<link to="MachineState_PoweredOff"/> or
    8094       <link to="MachineState_Aborted"/>), it has a zero execution state.
    8095       If the machine is saved (<link to="MachineState_Saved"/>), its
    8096       execution state is what saved in the execution state file
    8097       (<link to="IMachine::stateFilePath"/>).
    8098 
    8099       If the machine is in the saved state, then, next time it is powered
    8100       on, its execution state will be fully restored from the saved state
    8101       file and the execution will continue from the point where the state
    8102       was saved.
    8103 
    8104       Similarly to snapshots, the current machine state can be discarded
    8105       using <link to="IConsole::discardCurrentState"/>.
    8106 
    8107       <h3>Taking and discarding snapshots</h3>
    8108 
    8109       The table below briefly explains the meaning of every snapshot
    8110       operation:
    8111 
    8112       <table>
    8113         <tr><th>Operation</th><th>Meaning</th><th>Remarks</th></tr>
    8114 
    8115         <tr><td><link to="IConsole::takeSnapshot"/></td>
    8116 
    8117           <td>Save the current state of the virtual machine, including all
    8118             settings, contents of normal hard disks and the current modifications
    8119             to immutable hard disks (for online snapshots)</td>
    8120 
    8121           <td>The current state is not changed (the machine will continue
    8122             execution if it is being executed when the snapshot is
    8123             taken)</td></tr>
    8124 
    8125         <tr><td><link to="IConsole::discardSnapshot"/></td>
    8126 
    8127           <td>Forget the state of the virtual machine stored in the snapshot:
    8128             dismiss all saved settings and delete the saved execution state (for
    8129             online snapshots)</td>
    8130 
    8131           <td>Other snapshots (including child snapshots, if any) and the
    8132             current state are not directly affected</td></tr>
    8133 
    8134         <tr><td><link to="IConsole::discardCurrentState"/></td>
    8135 
    8136           <td>Restore the current state of the virtual machine from the state
    8137             stored in the current snapshot, including all settings and hard disk
    8138             contents</td>
    8139 
    8140           <td>The current state of the machine existed prior to this operation
    8141             is lost</td></tr>
    8142 
    8143         <tr><td><link to="IConsole::discardCurrentSnapshotAndState"/></td>
    8144 
    8145           <td>Completely revert the virtual machine to the state it was in
    8146             before the current snapshot has been taken</td>
    8147 
    8148           <td>The current state, as well as the current snapshot, are
    8149             lost</td></tr>
    8150 
    8151       </table>
    8152 
    81538113    </desc>
    81548114
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette