Create volume wit libvirt API for Python

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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!


[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux