<div dir="ltr"><div>I'm trying to clone a volume in a storage pool and I'm following the steps described here: <a href="http://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Storage_Pools-Cloning.html">http://libvirt.org/docs/libvirt-appdev-guide-python/en-US/html/libvirt_application_development_guide_using_python-Storage_Pools-Cloning.html</a></div><div><br></div><div>My code looks like:</div><div><br></div><div><div> destXML = """</div><div>            <volume></div><div>              <name>"""+newDiskName+""".qcow2</name>                  </div><div>              <target></div><div>                <path>/jffs2/disk0/"""+poolName+'/'+newDiskName+""".qcow2</path></div><div>                <format type='qcow2'/></div><div>                <permissions></div><div>                  <owner>-1</owner></div><div>                  <group>-1</group></div><div>                  <mode>0644</mode></div><div>                  <label>virt_image_t</label></div><div>                </permissions></div><div>              </target></div><div>            </volume>"""</div></div><div><br></div><div>srcDisk = tmpPool.storageVolLookupByName(vDisk)<br></div>newVol = sp.createXMLFrom(destXML,srcDisk, 0)  <div><br></div><div>According to the steps described in the link, this should be it; but I can't start any VM that are using this volume.</div><div><br></div><div>Also comparing the volume XML files for src/dest it looks like the format is not copied over:</div><div>source:</div><div><div><volume type='file'></div><div>  <name>k.qcow2</name></div><div>  <key>/jffs2/disk0/sp/vDisk.qcow2</key></div><div>  <source></div><div>  </source></div><div>  <capacity unit='bytes'>3221225472</capacity></div><div>  <allocation unit='bytes'>332075008</allocation></div><div>  <target></div><div>    <path>/jffs2/disk0/sp/vDisk.qcow2</path></div><div>    <b><format type='qcow2'/></b></div><div>    <permissions></div><div>      <mode>0644</mode></div><div>      <owner>0</owner></div><div>      <group>0</group></div><div>    </permissions></div><div>    <timestamps></div><div>      <atime>1455879195</atime></div><div>      <mtime>1455879171</mtime></div><div>      <ctime>1455879171</ctime></div><div>    </timestamps></div><div>  </target></div></div><div><br></div><div><br></div><div>dest:</div><div><div><volume type='file'></div><div>  <name>newDiskName.qcow2</name></div><div>  <key>/jffs2/disk0/sp/newDiskName.qcow2</key></div><div>  <source></div><div>  </source></div><div>  <capacity unit='bytes'>3221225472</capacity></div><div>  <allocation unit='bytes'>326868992</allocation></div><div>  <target></div><div>    <path>/jffs2/disk0/sp/newDiskName.qcow2</path></div><div>    <b><format type='raw'/></b></div><div>    <permissions></div><div>      <mode>0644</mode></div><div>      <owner>0</owner></div><div>      <group>0</group></div><div>    </permissions></div><div>    <timestamps></div><div>      <atime>1455878686</atime></div><div>      <mtime>1455878681</mtime></div><div>      <ctime>1455878681</ctime></div><div>    </timestamps></div><div>  </target></div><div></volume></div></div><div><br></div><div>I this a bug in  libvirt->createXMLFrom ?? Or am I missing something?</div><div><br></div><div>Thanks,</div><div><div><div class="gmail_signature"><div><font color="#666666" face="verdana, sans-serif">Andrei</font></div></div></div>
</div></div>

<br>

        
        
        


<p><img src="http://www.klasonline.com/klas_telecom_email_sig_1_01.jpg"></p><p><span style="font-family:Arial;font-size:x-small">The information
transmitted is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material.
Any review, retransmission, dissemination or other use of or taking
of any action in reliance upon this information by persons or
entities other than the intended recipient is prohibited. If you
receive this in error please contact the sender and delete the
material from any computer immediately. It is the policy of Klas
 Limited to disavow the sending of offensive material and should
you consider that the material contained in the message is offensive
you should contact the sender immediately and also your I.T. Manager.</span></p><p><span style="font-family:Arial;font-size:x-small">Klas Telecom
Inc., a Virginia Corporation with offices at 1101 30th St. NW,
Washington, DC 20007.</span></p>
<p>
<font color="#000000"><font face="Arial"><font size="1">Klas Limited
(Company Number 163303) trading as Klas Telecom, an Irish Limited
Liability Company, with its registered office at Fourth Floor, One
Kilmainham Square, Inchicore Road, Kilmainham, Dublin 8, Ireland.</font></font></font></p>