Sys::Virt::DomainSnapshot3pm
Represent & manage a libvirt guest domain
Overview
The "Sys::Virt::DomainSnapshot" module represents a guest domain managed by the virtual machine monitor.
Methods
- my $str = $domss->
get_name() -
Return the name of the snapshot
- my $xml = $domss->get_xml_description($flags)
-
Returns an XML document containing a complete description of the domain snapshot's configuration. The
$flagsparameter accepts the following constants- Sys::Virt::DomainSnapshot::XML_SECURE
-
Include security sensitive information in the XML dump, such as passwords.
- $domss->delete($flags)
-
Deletes this snapshot object & its data. The optional
$flagsparameter controls what should be deleted via the"Sys::Virt::DomainSnapshot::DELETE_*"constants.
- $domss->revert_to($flags)
-
Revert the domain to the state associated with this snapshot. The optional
$flagscontrol the state of the VM after the revert via the"Sys::Virt::DomainSnapshot::REVERT_*"constants.
- $parentss = $domss->
get_parent(); -
Return the parent of the snapshot, if any
- $res = $domss->
is_current() -
Returns a true value if this is the current snapshot. False otherwise.
- $res = $domss->
has_metadata() -
Returns a true value if this snapshot has metadata associated with it.
- $count = $domss->
num_of_child_snapshots() -
Return the number of saved snapshots which are children of this snapshot
- @names = $domss->
list_child_snapshot_names() -
List the names of all saved snapshots which are children of this snapshot . The names can be used with the
"lookup_snapshot_by_name"
- @snapshots = $domss->
list_child_snapshots() -
Return a list of all snapshots that are children of this snapshot. The elements in the returned list are instances of the Sys::Virt::DomainSnapshot class. This method requires O(n) RPC calls, so the
"list_all_children"method is recommended as a more efficient alternative.
- my @snapshots = $domss->list_all_children($flags)
-
Return a list of all domain snapshots that are children of this snapshot. The elements in the returned list are instances of the Sys::Virt::DomainSnapshot class. The
$flagsparameter can be used to filter the list of return domain snapshots.
Constants
Snapshot creation
The following constants are useful when creating snapshots
Sys::Virt::DomainSnapshot::CREATE_CURRENT
|
Set the defined snapshot to be the current snapshot |
|---|---|
Sys::Virt::DomainSnapshot::CREATE_DISK_ONLY
|
Only snapshot the disk, not the memory state |
Sys::Virt::DomainSnapshot::CREATE_HALT
|
Stop the guest after creating the snapshot |
Sys::Virt::DomainSnapshot::CREATE_NO_METADATA
|
Do not save any metadata for the snapshot |
Sys::Virt::DomainSnapshot::CREATE_REDEFINE
|
Replace/set the metadata with the snapshot |
Sys::Virt::DomainSnapshot::CREATE_QUIESCE
|
Quiesce the guest disks while taking the snapshot |
Sys::Virt::DomainSnapshot::CREATE_REUSE_EXT
|
Reuse the existing snapshot data files (if any) |
Sys::Virt::DomainSnapshot::CREATE_ATOMIC
|
Create multiple disk snapshots atomically |
Sys::Virt::DomainSnapshot::CREATE_LIVE
|
Create snapshot while the guest is running |
Sys::Virt::DomainSnapshot::CREATE_VALIDATE
|
Validate the XML document against the schema |
Snapshot deletion
The following constants are useful when deleting snapshots
Sys::Virt::DomainSnapshot::DELETE_CHILDREN
|
Recursively delete any child snapshots |
|---|---|
Sys::Virt::DomainSnapshot::DELETE_CHILDREN_ONLY
|
Only delete the child snapshots |
Sys::Virt::DomainSnapshot::DELETE_METADATA_ONLY
|
Only delete the snapshot metadata |
Snapshot list
The following constants are useful when listing snapshots
- Sys::Virt::DomainSnapshot::LIST_METADATA
-
Only list snapshots which have metadata
- Sys::Virt::DomainSnapshot::LIST_ROOTS
-
Only list snapshots which are root nodes in the tree
- Sys::Virt::DomainSnapshot::LIST_DESCENDANTS
-
Only list snapshots which are descendants of the current snapshot
- Sys::Virt::DomainSnapshot::LIST_LEAVES
-
Only list leaf nodes in the snapshot tree
- Sys::Virt::DomainSnapshot::LIST_NO_LEAVES
-
Only list non-leaf nodes in the snapshot tree
- Sys::Virt::DomainSnapshot::LIST_NO_METADATA
-
Only list snapshots without metadata
- Sys::Virt::DomainSnapshot::LIST_ACTIVE
-
Only list snapshots taken while the guest was running
- Sys::Virt::DomainSnapshot::LIST_INACTIVE
-
Only list snapshots taken while the guest was inactive
- Sys::Virt::DomainSnapshot::LIST_EXTERNAL
-
Only list snapshots stored in external disk images
- Sys::Virt::DomainSnapshot::LIST_INTERNAL
-
Only list snapshots stored in internal disk images
- Sys::Virt::DomainSnapshot::LIST_DISK_ONLY
-
Only list snapshots taken while the guest was running, which did not include memory state.
- Sys::Virt::DomainSnapshot::LIST_TOPOLOGICAL
-
Sort list in topological order wrt to parent/child relationships.
Snapshot revert
The following constants are useful when reverting snapshots
Sys::Virt::DomainSnapshot::REVERT_PAUSED
|
Leave the guest CPUs paused after reverting to the snapshot state |
|---|---|
Sys::Virt::DomainSnapshot::REVERT_RUNNING
|
Start the guest CPUs after reverting to the snapshot state |
Sys::Virt::DomainSnapshot::REVERT_FORCE
|
Force the snapshot to revert, even if it is risky to do so |
Sys::Virt::DomainSnapshot::REVERT_RESET_NVRAM
|
Reset the firmware NVRAM state from its original template |
Releases
9 releases since Debian 6.0 (Squeeze); the text changed 8 times.