<div>
                    <br>
                </div>
                <div><div><span style="color: rgb(51, 51, 51); font-family: arial; font-variant-ligatures: normal; orphans: 2; widows: 2; font-size: 24px;">My negligence。</span></div><div><span style="color: rgb(51, 51, 51); font-family: arial; font-variant-ligatures: normal; orphans: 2; widows: 2; font-size: 24px;"><br></span></div><div>-- </div><div>James Iter</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">在 2018年3月22日 星期四,下午11:02,Dominik Psenner 写道:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div><div>I believe that Your mail went to the wrong recipient. As far as I'm </div><div>concerned it should have been sent to the libvirt-users mailing list, </div><div>shouldn't it?</div><div><br></div><div><br></div><div>On 2018-03-22 15:55, James Iter wrote:</div><blockquote type="cite"><div><div>Thank your reply.</div><div>I found the method.</div><div>Now, I sharing to you.</div><div>When create snapshot, just add ’no’ value to the ’snapshot’ option with —diskspec.</div><div>As below:</div><div><br></div><div>``` bash</div><div>snapshot-create-as 8x0lbzvS --name sys_disk --disk-only --quiesce --atomic --diskspec "vda,snapshot=external" --diskspec "vdb,snapshot=no"</div><div>```</div><div><br></div><div><br></div><div>--</div><div>James Iter</div><div><br></div><div><br></div><div>在 2018年3月21日 星期三,下午6:24,Dominik Psenner 写道:</div><div><br></div><blockquote type="cite"><div><div>(shameless plug)</div><div>  </div><div>To do automated daily backups of a few machines I wrote a small toolset to get the job done and make it as less a hassle as you can get. The source is on github <a href="https://github.com/dpsenner/libvirt-administration-tools/">https://github.com/dpsenner/libvirt-administration-tools/</a>. Use it if you find it useful.</div><div>  </div><div>Note that I have yet not tested it with multiple disks but the tool uses the output of `virsh dombklst`. In theory that should snapshot all disks of a guest machine.</div><div>  </div><div>Cheers</div><div>On Tue, 20 Mar 2018, 19:54 James Iter, <james.iter.cn@gmail.com (<a href="mailto:james.iter.cn@gmail.com">mailto:james.iter.cn@gmail.com</a>)> wrote:</div><blockquote type="cite"><div><div>  </div><div>Hi, dear friends.</div><div>My guest has two disks, vda and vdb. both are qcow2 local file.</div><div>When guest running state.</div><div>I want to take the vda snapshot of guest(just vda, no include vdb). but I met libvirt do snapshot for all disks of guest.</div><div>  </div><div>About methods as follow:</div><div>1、</div><div>``` bash</div><div>virsh</div><div>snapshot-create-as 8x0lbzvS --name sys_disk3 --disk-only --diskspec "vda,snapshot=external"</div><div>```</div><div>``` result</div><div>  </div><div>[root@10k03 ~]# ls -lh /opt/Images/*sys_disk3</div><div>  </div><div>  </div><div>-rw-------. 1 qemu qemu 194K 3月  20 23:27 /opt/Images/00d76a58-9637-4402-9739-21afd1246e06.sys_disk3</div><div>  </div><div>  </div><div>-rw-------. 1 qemu qemu 704K 3月  20 23:52 /opt/Images/8d582c1c-355a-4297-9434-2f2f562c77df.sys_disk3</div><div>  </div><div>  </div><div>```</div><div>  </div><div>2、</div><div>``` python</div><div>  </div><div>#!/usr/bin/env python</div><div>  </div><div>  </div><div># -*- coding: utf-8 -*-</div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>import libvirt</div><div>  </div><div>  </div><div>import libvirt_qemu</div><div>  </div><div>  </div><div>import json</div><div>  </div><div>  </div><div>import sys</div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>name = sys.argv[1]</div><div>  </div><div>  </div><div>print name</div><div>  </div><div>  </div><div>conn = libvirt.open()</div><div>  </div><div>  </div><div>dom = conn.lookupByName(name)</div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>xml = """</div><div>  </div><div>  </div><div><domainsnapshot></div><div>  </div><div>  </div><div><name>sysdisk_by_xml</name></div><div>  </div><div>  </div><div><description>By xml</description></div><div>  </div><div>  </div><div><disks></div><div>  </div><div>  </div><div><disk name='vda' snapshot='external'></div><div>  </div><div>  </div><div></disk></div><div>  </div><div>  </div><div></disks></div><div>  </div><div>  </div><div></domainsnapshot></div><div>  </div><div>  </div><div>"""</div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>flags = 0</div><div>  </div><div>  </div><div>flags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</div><div>  </div><div>  </div><div>flags |= libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE</div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>  </div><div>ret = dom.snapshotCreateXML(xmlDesc=xml, flags=flags)</div><div>  </div><div>  </div><div>```</div><div>``` result</div><div>  </div><div>[root@10k03 ~]# ls -lh /opt/Images/*sysdisk_by_xml</div><div>  </div><div>  </div><div>-rw-------. 1 qemu qemu 194K 3月  20 23:52 /opt/Images/00d76a58-9637-4402-9739-21afd1246e06.sysdisk_by_xml</div><div>  </div><div>  </div><div>-rw-------. 1 qemu qemu 1.2M 3月  21 00:03 /opt/Images/8d582c1c-355a-4297-9434-2f2f562c77df.sysdisk_by_xml</div><div>  </div><div>  </div><div>```</div><div>。</div><div>  </div><div>  </div><div>Then, I searched by google. see your page(<a href="https://www.redhat.com/archives/libvirt-users/2013-June/msg00102.html">https://www.redhat.com/archives/libvirt-users/2013-June/msg00102.html</a>).</div><div>  </div><div>Now, I want to ask you, have you found the method?</div><div>  </div><div>  </div><div>--</div><div>James Iter</div><div>  </div><div>  </div><div>_______________________________________________</div><div>libvirt-users mailing list</div><div>libvirt-users@redhat.com (<a href="mailto:libvirt-users@redhat.com">mailto:libvirt-users@redhat.com</a>)</div><div><a href="https://www.redhat.com/mailman/listinfo/libvirt-users">https://www.redhat.com/mailman/listinfo/libvirt-users</a></div></div></blockquote></div></blockquote></div></blockquote></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>