<font face="arial" size="1"><p style="margin:0;padding:0;font-family: arial; font-size: 8pt; word-wrap: break-word;">So I notice that some operations by libvirt such as creating a snapshot actually change the source of the active disk image for a domain without requiring a restart of the vm. How can this be achieved manually? There are instances where I am manipulating files with qemu-img or virsh commands and afterward need to change what file the vm is using as its disk. One example is when deleting a snapshot. Please see example below:<br /> <br />===============================================================<br />root >#virsh snapshot-create-as --domain $DOMAIN $SNAP $DESC --disk-only --diskspec vda,snapshot=external,file=/var/lib/libvirt/images/${SNAPFILE} --atomic<br />Domain snapshot ballyclient-1.snap1 created<br />root >#virsh dumpxml $DOMAIN | grep 'source file'<br />      <source file='/var/lib/libvirt/images/ballyclient-1.snap1.qcow2'/><br />root >#virsh snapshot-delete --metadata $DOMAIN $SNAP<br />Domain snapshot ballyclient-1.snap1 deleted<br />  <br />root >#find /var/lib/libvirt/images/ -type f -name $SNAPFILE -delete<br />root >#virsh dumpxml $DOMAIN |grep 'source file'<br />      <source file='/var/lib/libvirt/images/ballyclient-1.snap1.qcow2'/><br />root >#virsh dumpxml $DOMAIN | sed 's/snap1\.//g' >/tmp/$DOMAIN.xml && virsh define /tmp/$DOMAIN.xml && virsh destroy $DOMAIN  && virsh start $DOMAIN && virsh dumpxml $DOMAIN | grep 'source file'<br />Domain ballyclient-1 defined from /tmp/ballyclient-1.xml<br />Domain ballyclient-1 destroyed<br />Domain ballyclient-1 started<br />      <source file='/var/lib/libvirt/images/ballyclient-1.qcow2'/><br />root >#<br />===============================================================<br /><br />So how could I have told libvirt to go back to using the original base image as 'source file' after deleting the snapshot? I am guessing this is something trivial but `man virsh` has not helped me on this one. <br /><br /></p>
<!--WM_COMPOSE_SIGNATURE_START-->
<p style="margin:0;padding:0;font-family: arial; font-size: 8pt;"><span style="font-size: 10pt;"><strong>Mathew Moon</strong></span><br /><span style="font-size: 8pt;">Systems Administrator</span></p>
<p style="margin:0;padding:0;font-family: arial; font-size: 8pt;"><span style="font-size: 8pt;">Cell: (205) 514-5058</span></p>
<p style="margin:0;padding:0;font-family: arial; font-size: 8pt;"><img src="cid:vipaar_resized.png@1414013952.3502" alt=""></p>
<!--WM_COMPOSE_SIGNATURE_END--></font>