<div dir="ltr">virt-builder looks like some fancy guest/host interaction related to building VM images.<div><br></div><div>What I'm looking for is more like:</div><div>  virsh save running_domain saved-domain-A.img</div><div>  cp saved-domain-A.img saved-domain-B.img</div><div>  virsh save-image-edit saved-domain-B.img   // Change the network, possibly MAC, VNC port<br></div><div><br></div><div>Then in parallel I want to do:</div><div>  virsh restore saved-domain-A.img</div><div>  virsh restore saved-domain-B.img<br></div><div><br></div><div>So that I have two instances of the same virtual machine starting from the same state.</div><div>This way I can reset the VMs without having to reboot them (booting is rather slow).</div><div><br></div><div>I practice I'll probably have ~16 instances at the same time. Constantly being reset to the same state.</div><div>I tried with QEMU, and it's seems totally doable with savevm, copy file, then doing loadvm twice in parallel.</div><div>(I'll be using a separate network for each VM, so I can be sure which one I'm talking to).</div><div><br></div><div>Is this doable with libvirt, or am I better off using QEMU directly? and how? I couldn't do internal snapshots with --live, and snapshot-revert says it can't revert to external snapshots yet :)</div><div>(using QEMU directly would certainly leave me with a lot of manual network configuration)</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">--<br>Regards Jonas Finnemann Jensen.</div></div></div>
<br><div class="gmail_quote">2016-04-19 2:23 GMT-07:00 Martin Kletzander <span dir="ltr"><<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Apr 18, 2016 at 10:05:02PM +0300, Michael Ravits wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Jonas,<br>
<br>
I asked a similar question here last week. You could find it by searching<br>
for this topic in the mailing list archives: "Clone VM with saved state".<br>
That being said I'd be very glad if you could update here when you find a<br>
complete solution.<br>
<br>
- Michael<br>
<br>
</blockquote>
<br></span>
What I *think* Jones wants is to use virt-builder, it could cause some<br>
problems if you started all of them.  What Michael wants is:<br>
<br>
 virsh save running_domain saved-image-file.img<br>
 virsh save-image-edit saved-image-file.img<br>
<br>
Hope that helped,<br>
Martin<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Mon, Apr 18, 2016 at 9:49 PM, Jonas Finnemann Jensen <<a href="mailto:jonasfj@mozilla.com" target="_blank">jonasfj@mozilla.com</a><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
wrote:<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I would like to save a running domain (ie. disk + memory) and be able to<br>
restore it multiple times creating duplicates of the orignal domain all<br>
starting from the same state.<br>
Use case:<br>
I'm building a task-processing system for use in a CI flow.<br>
I want to run multiple VMs in parallel using the same image (always<br>
starting from the same state).<br>
And to avoid needlessly booting between each task, I would like to save<br>
(and distribute) the domain state, so that I just restore from memory.<br>
<br>
However, I can't seems to change the UUID or the name of a domain once it<br>
is saved.<br>
Nor do I seem able to rename a domain while it is running.<br>
<br>
I can obviously duplicate both the disks and the file to which I saved the<br>
domain state using "virsh save".<br>
But I seem unable to rename before I restore.. Any ideas?<br>
<br>
Could I do this with snapshots? I suspect not since I see<br>
virDomainSnapshotRedefinePrep() calling<br>
virDomainDefCheckABIStability which raises the error here:<br>
<a href="https://fossies.org/dox/libvirt-1.3.3/domain__conf_8c_source.html#l17991" rel="noreferrer" target="_blank">https://fossies.org/dox/libvirt-1.3.3/domain__conf_8c_source.html#l17991</a><br>
<br>
Out of curiosity does anyone know what horrors might befall me if I were<br>
to remove the lines protecting against name and UUID changes? Then compile<br>
my own libvirt...<br>
The comment in the code says name can be changed, but I'm guessing I would<br>
have to change the UUID too. Does anyone see how that would create issues?<br>
I'm not sure how libvirt uses the UUID internally.<br>
<br>
--<br>
Regards Jonas Finnemann Jensen.<br>
<br>
_______________________________________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
<br>
</blockquote></blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
</blockquote>
</div></div></blockquote></div><br></div>