Red Hat Bugzilla – Bug 876817
virsh should make it easier to filter snapshots by type
Last modified: 2013-02-21 02:26:38 EST
As we add more snapshot capabilities, it becomes more important to have 'virsh snapshot-info' tell details about whether a snapshot is internal or external, and to have 'virsh snapshot-list' gain new filtering flags (such as --external) to quickly see which snapshots have which properties. This will involve backporting this upstream series: https://www.redhat.com/archives/libvir-list/2012-November/msg00688.html
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-November/msg00191.html
verify this bug with : libvirt-0.10.2-10.el6.x86_64 qemu-kvm-rhev-0.12.1.2-2.337.el6.x86_64 1) start qcow2 domain then [root@intel-q9400-4-7 ~]# virsh snapshot-create-as bug active-internal Domain snapshot active-internal created [root@intel-q9400-4-7 ~]# virsh snapshot-create-as bug active-external --memspec /tmp/bug Domain snapshot active-external created [root@intel-q9400-4-7 ~]# virsh snapshot-create-as bug active-disk-only --disk-only Domain snapshot active-disk-only created 2) destroy domain then [root@intel-q9400-4-7 ~]# virsh snapshot-create-as bug inactive-disk-only --disk-only Domain snapshot inactive-disk-only created [root@intel-q9400-4-7 ~]# virsh snapshot-create-as bug inactive-internal Domain snapshot inactive-internal created 3) check snapshot-list # virsh snapshot-list bug Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot active-external 2012-11-27 17:23:59 +0800 running active-internal 2012-11-27 17:22:26 +0800 running inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff inactive-internal 2012-11-27 17:25:06 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --active Name Creation Time State ------------------------------------------------------------ active-external 2012-11-27 17:23:59 +0800 running active-internal 2012-11-27 17:22:26 +0800 running [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --inactive Name Creation Time State ------------------------------------------------------------ inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff inactive-internal 2012-11-27 17:25:06 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --external Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot active-external 2012-11-27 17:23:59 +0800 running inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --internal Name Creation Time State ------------------------------------------------------------ active-internal 2012-11-27 17:22:26 +0800 running inactive-internal 2012-11-27 17:25:06 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --disk-only Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --active --inactive Name Creation Time State ------------------------------------------------------------ active-external 2012-11-27 17:23:59 +0800 running active-internal 2012-11-27 17:22:26 +0800 running inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff inactive-internal 2012-11-27 17:25:06 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --active --disk-only Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot active-external 2012-11-27 17:23:59 +0800 running active-internal 2012-11-27 17:22:26 +0800 running [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --active --internal Name Creation Time State ------------------------------------------------------------ active-internal 2012-11-27 17:22:26 +0800 running [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --active --external Name Creation Time State ------------------------------------------------------------ active-external 2012-11-27 17:23:59 +0800 running [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --inactive --disk-only Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff inactive-internal 2012-11-27 17:25:06 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --inactive --internal Name Creation Time State ------------------------------------------------------------ inactive-internal 2012-11-27 17:25:06 +0800 shutoff [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --inactive --external Name Creation Time State ------------------------------------------------------------ inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff
add some cases : [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --disk-only --internal Name Creation Time State ------------------------------------------------------------ [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --disk-only --external Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot [root@intel-q9400-4-7 ~]# virsh snapshot-list bug --internal --external Name Creation Time State ------------------------------------------------------------ active-disk-only 2012-11-27 17:24:11 +0800 disk-snapshot active-external 2012-11-27 17:23:59 +0800 running active-internal 2012-11-27 17:22:26 +0800 running inactive-disk-only 2012-11-27 17:24:57 +0800 shutoff inactive-internal 2012-11-27 17:25:06 +0800 shutoff
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0276.html