[root@10k03 ~]# ls -lh /opt/Images/*sys_disk3
-rw-------. 1 qemu qemu 194K 3月 20 23:27 /opt/Images/00d76a58-9637-
-rw-------. 1 qemu qemu 704K 3月 20 23:52 /opt/Images/8d582c1c-355a-
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import libvirt
import libvirt_qemu
import json
import sys
name = sys.argv[1]
print name
conn = libvirt.open()
dom = conn.lookupByName(name)
xml = """
<domainsnapshot>
<name>sysdisk_by_xml</name>
<description>By xml</description>
<disks>
<disk name='vda' snapshot='external'>
</disk>
</disks>
</domainsnapshot>
"""
flags = 0
flags |= libvirt.VIR_DOMAIN_SNAPSHOT_
flags |= libvirt.VIR_DOMAIN_SNAPSHOT_
ret = dom.snapshotCreateXML(xmlDesc=
[root@10k03 ~]# ls -lh /opt/Images/*sysdisk_by_xml
-rw-------. 1 qemu qemu 194K 3月 20 23:52 /opt/Images/00d76a58-9637-
-rw-------. 1 qemu qemu 1.2M 3月 21 00:03 /opt/Images/8d582c1c-355a-