<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div><div><div>hi,</div><div>i am getting this error below when i try to create a storage volume:</div><div><br></div><div>    libvirt.virStoragePool.CreateXML(storagepoolobject,xmldesc,0)</div><div>AttributeError: class virStoragePool has no attribute 'CreateXML'</div><div><br></div><div>my code is:</div><div>xmldesc="xml description of storage volume which i got from sudo virsh vol-dumpxml"</div><div><br></div><div>#get a storage pool object to use in creating a volume</div><div>storagepoolobject=libvirt.virConnect.storagePoolLookupByName(conn,'poolname')</div><div><br></div><div>#now try to create the volume using the above storage pool object</div><div>libvirt.virStoragePool.CreateXML(storagepoolobject,xmldesc,0)</div><div><br></div><div><br></div><div>from python:</div><div>-bash-4.1$ python</div><div>>>> import
 libvirt<br></div><div><br></div><div>>>> dir(libvirt.virStoragePool)</div><div>['UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', '__init__', '__module__', 'autostart', 'build', 'connect', 'create', 'createXML', 'createXMLFrom', 'delete', 'destroy', 'info', 'isActive', 'isPersistent', 'listVolumes', 'name', 'numOfVolumes', 'refresh', 'setAutostart', 'storageVolLookupByName', 'undefine']</div><div><br></div><div>>>> help(libvirt.virStoragePool.createXML)</div><div>Help on method createXML in module libvirt:</div><div><br></div><div>createXML(self, xmldesc, flags) unbound libvirt.virStoragePool method</div><div>    Create a storage volume within a pool based</div><div>    on an XML description. Not all pools support</div><div>    creation of volumes</div><div><br></div><div>from the libvirt.org
 documentation:</div><div>http://libvirt.org/html/libvirt-libvirt.html#virStorageVolCreateXML</div><div>virStorageVolPtr<span class="Apple-tab-span" style="white-space:pre"> </span>virStorageVolCreateXML<span class="Apple-tab-span" style="white-space:pre">      </span>(virStoragePoolPtr pool, </div><div><span class="Apple-tab-span" style="white-space:pre">                                               </span> const char * xmldesc, </div><div><span class="Apple-tab-span" style="white-space:pre">                                         </span> unsigned int flags)</div><div>Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes</div><div>pool:<span class="Apple-tab-span" style="white-space:pre"> </span>pointer to storage pool</div><div>xmldesc:<span class="Apple-tab-span" style="white-space:pre">      </span>description of volume to create</div><div>flags:<span class="Apple-tab-span" style="white-space:pre">        </span>extra flags; not used yet, so callers should always pass
 0</div><div>Returns:<span class="Apple-tab-span" style="white-space:pre">        </span>the storage volume, or NULL on error</div><div><br></div></div></div></div></body></html>