<html><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:10pt"><div><span>i figured out the problem, i had to change CreateXML to createXML</span></div><div><br></div>  <div style="font-size: 10pt; font-family: verdana, helvetica, sans-serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> John Wayne <m01z04-libvirt@yahoo.com><br> <b><span style="font-weight: bold;">To:</span></b> "libvirt-users@redhat.com" <libvirt-users@redhat.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Monday, May 7, 2012 6:58 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [libvirt-users] creation of storage volume fails<br> </font> </div> <br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv1126908866"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 10pt; font-family: verdana, helvetica, sans-serif; "><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 <a target="_blank" href="http://libvirt.org">libvirt.org</a>
 documentation:</div><div>http://libvirt.org/html/libvirt-libvirt.html#virStorageVolCreateXML</div><div>virStorageVolPtr<span class="yiv1126908866Apple-tab-span" style="white-space:pre;">   </span>virStorageVolCreateXML<span class="yiv1126908866Apple-tab-span" style="white-space:pre;">        </span>(virStoragePoolPtr pool, </div><div><span class="yiv1126908866Apple-tab-span" style="white-space:pre;">                                         </span> const char * xmldesc, </div><div><span class="yiv1126908866Apple-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="yiv1126908866Apple-tab-span" style="white-space:pre;">   </span>pointer to storage pool</div><div>xmldesc:<span class="yiv1126908866Apple-tab-span" style="white-space:pre;">        </span>description of volume to create</div><div>flags:<span class="yiv1126908866Apple-tab-span"
 style="white-space:pre;"> </span>extra flags; not used yet, so callers should always pass
 0</div><div>Returns:<span class="yiv1126908866Apple-tab-span" style="white-space:pre;">  </span>the storage volume, or NULL on error</div><div><br></div></div></div></div></div></div><meta http-equiv="x-dns-prefetch-control" content="on"><br>_______________________________________________<br>libvirt-users mailing list<br><a ymailto="mailto:libvirt-users@redhat.com" href="mailto:libvirt-users@redhat.com">libvirt-users@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br><br> </div> </div>  </div></body></html>