Difference between revisions of "Virsh snapshot-list"

From wikieduonline
Jump to navigation Jump to search
(Created page with "<pre> virsh snapshot-list domain [{--parent | --roots | --tree}] [{[--from] snapshot | --current} [--descendants]] [--metadata] [--no-metadata] [--leaves] [--no-leaves] [--ina...")
 
Tags: Mobile web edit, Mobile edit
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<pre>
+
 
virsh snapshot-list domain [{--parent | --roots | --tree}] [{[--from] snapshot | --current} [--descendants]] [--metadata] [--no-metadata] [--leaves] [--no-leaves] [--inactive] [--active] [--disk-only] [--internal] [--external]
+
[[virsh]] snapshot-list domain [{--parent | --roots | --tree}] [{[--from] snapshot | --current} [--descendants]] [--metadata] [--no-metadata] [--leaves] [--no-leaves] [--inactive] [--active] [--disk-only] [--internal] [--external] <ref>https://linux.die.net/man/1/virsh</ref>
</pre><ref>https://linux.die.net/man/1/virsh</ref>
 
  
  
Line 19: Line 18:
 
</pre>
 
</pre>
  
<pre>
+
virsh snapshot-list VM_MACHINE_NAME
$ virsh snapshot-list VM_MACHINE_NAME --current
+
Name                Creation Time            State
Name                Creation Time            State
+
------------------------------------------------------------
------------------------------------------------------------
+
 
error: Domain snapshot not found: the domain does not have a current snapshot
+
virsh snapshot-list VM_MACHINE_NAME --current
error: Domain snapshot not found: the domain does not have a current snapshot
+
Name                Creation Time            State
</pre>
+
------------------------------------------------------------
 +
error: Domain snapshot not found: the domain does not have a current snapshot
 +
error: Domain snapshot not found: the domain does not have a current snapshot
  
 
Snapshot-list for all VMs:
 
Snapshot-list for all VMs:
Line 43: Line 44:
 
* <code>virsh snapshot-list VM_MACHINE_NAME --internal</code>
 
* <code>virsh snapshot-list VM_MACHINE_NAME --internal</code>
 
* <code>virsh snapshot-list VM_MACHINE_NAME --external</code>
 
* <code>virsh snapshot-list VM_MACHINE_NAME --external</code>
 +
 +
 +
== Related commands ==
 +
* <code>[[virsh dumpxml]]</code>
 +
* <code>[[virsh list]]</code>
 +
* <code>[[virsh snapshot-create-as]]</code>
 +
* <code>[[virsh snapshot-info]]</code>
 +
* <code>[[virsh snapshot-revert]]</code>
  
 
== See also ==
 
== See also ==
* <code>[[virsh list]]</code>
+
* {{virsh}}
 +
* {{virsh snapshot}}
 
* [[Virsh/KVM virsh Snapshots]]: <code>[[Virsh/virsh snapshot-info|virsh snapshot-info]]</code>
 
* [[Virsh/KVM virsh Snapshots]]: <code>[[Virsh/virsh snapshot-info|virsh snapshot-info]]</code>
* <code>[[Virsh/virsh snapshot-create-as|virsh snapshot-create-as]]</code> and <code>[[Virsh/virsh snapshot-create-as|virsh snapshot-create-as]] --no-metadata</code>
+
* <code>[[virsh domblklist]] VM_NAME --details</code>
* <code>[[virsh domblklist]] --details</code>
 
 
* <code>[[virsh dumpxml]]</code>
 
* <code>[[virsh dumpxml]]</code>
* [[Virsh/Create Live backups|Create Live backups]]
+
* [[Create Live backups]]
  
  
 
[[Category:Linux]]
 
[[Category:Linux]]
 
[[Category:KVM]]
 
[[Category:KVM]]

Latest revision as of 12:10, 13 April 2021

virsh snapshot-list domain [{--parent | --roots | --tree}] [{[--from] snapshot | --current} [--descendants]] [--metadata] [--no-metadata] [--leaves] [--no-leaves] [--inactive] [--active] [--disk-only] [--internal] [--external] [1]


List snapshots for a domain, will list active, inactive and disk-only snapshots:

virsh snapshot-list VM_MACHINE_NAME 
 Name                 Creation Time             State
------------------------------------------------------------
 Snapshot_name           2019-01-27 11:47:48 +0400 shutoff
$ virsh snapshot-list VM_MACHINE_NAME
Name                 Creation Time             State
------------------------------------------------------------

MY_Snapshot_name            2018-04-29 15:53:07 +0530 running
virsh snapshot-list VM_MACHINE_NAME
Name                 Creation Time             State
------------------------------------------------------------
virsh snapshot-list VM_MACHINE_NAME --current
Name                 Creation Time             State
------------------------------------------------------------
error: Domain snapshot not found: the domain does not have a current snapshot
error: Domain snapshot not found: the domain does not have a current snapshot

Snapshot-list for all VMs:

for VM_NAME in `virsh list --name`; do virsh snapshot-list $VM_NAME; done



To filter by state when snapshot was taken use:

  • virsh snapshot-list VM_MACHINE_NAME --active
  • virsh snapshot-list VM_MACHINE_NAME --inactive
  • virsh snapshot-list VM_MACHINE_NAME --disk-only

To filter by storage snapshot type use: --internal or --external (virsh snapshot-info can be also used)

  • virsh snapshot-list VM_MACHINE_NAME --internal
  • virsh snapshot-list VM_MACHINE_NAME --external


Related commands[edit]

See also[edit]

  • https://linux.die.net/man/1/virsh
  • Advertising: