Please help! How create volume with libvirt API for python?
conn = libvirt.open(qemu:///system)
vol = libvirt.virStoragePool(conn)
conf_file = 'disk.xml'
f = open(conf_file)
xml = f.read()
pool = "default"
vol.createXML(pool,xml)
xml file disk.xml:
<volume>
<name>name.img</name>
<key>/var/lib/libvirt/images/name.img</key>
<source>
</source>
<capacity>21474836480</capacity>
<allocation>21474840576</allocation>
<target>
<path>/var/lib/libvirt/images/name.img</path>
<format type='raw'/>
</target>
</volume>
This script not work :-(
Thanks for help!