<p dir="ltr">Fair enough :)<br>
I just wanted to make sure it wasn't supported... I'm probably better off using QEMU directly. I totally understand that libvirt makes some sane decisions that makes sense for data center management.</p>
<p dir="ltr">I'm not sure why it couldn't be done. But honestly hacking libvirt to violate a core invariant is probably asking for trouble :)</p>
<div class="gmail_quote">Den 19. apr. 2016 11.17 PM skrev "Martin Kletzander" <<a href="mailto:mkletzan@redhat.com">mkletzan@redhat.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Apr 19, 2016 at 03:22:18PM -0700, Jonas Finnemann Jensen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
You'll also need to change the name and uuid of the domain at the very<br>
least.<br>
</blockquote>
<br>
Agree, but is that possible with libvirt?<br>
<br>
</blockquote>
<br>
Not in a supported way.  But you can, technically, edit the save file<br>
(not using virsh), change the name and uuid and restore it.  But don't<br>
seek help when something doesn't work for you after that =)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you do that (restore a previously running image with a different MAC<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
address)<br>
</blockquote>
<br>
Yeah,  probably I wouldn't change the MAC address. As I want to attach the<br>
VMs to different networks.<br>
I rely on the IP being in a different subnet to identify the VM in my<br>
metadata service.<br>
Using IP filters to enforce the subnet seems like the most robust way of<br>
being sure which VM I'm talking to.<br>
<br>
possibly by having the host toggle the interface offline and back on<br>
<br>
Yeah, I think unplugging the virtual network cable before I save the VM<br>
memory, and plugging it back in after I load the VM, then DHCP would run<br>
immediately.<br>
As an added benefit any guest program I have talking to my meta-data<br>
service would be able to detect that the VM has been loaded, by looking for<br>
network connection.<br>
<br>
<br>
--<br>
Regards Jonas Finnemann Jensen.<br>
<br>
2016-04-19 14:26 GMT-07:00 Laine Stump <<a href="mailto:laine@laine.org" target="_blank">laine@laine.org</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(please don't top-post. Put your responses inline, in context)<br>
<br>
On 04/19/2016 01:09 PM, Jonas Finnemann Jensen wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
virt-builder looks like some fancy guest/host interaction related to<br>
building VM images.<br>
<br>
What I'm looking for is more like:<br>
  virsh save running_domain saved-domain-A.img<br>
  cp saved-domain-A.img saved-domain-B.img<br>
  virsh save-image-edit saved-domain-B.img   // Change the network,<br>
possibly MAC, VNC port<br>
<br>
</blockquote>
<br>
You'll also need to change the name and uuid of the domain at the very<br>
least. And I assume these will all be transient domains, not persistent.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Then in parallel I want to do:<br>
  virsh restore saved-domain-A.img<br>
  virsh restore saved-domain-B.img<br>
<br>
</blockquote>
<br>
If you do that (restore a previously running image with a different MAC<br>
address), at the very least the guest OS will be confused about the MAC<br>
address of the network card, and you'll very likely end up with both guests<br>
responding to ARP requests for the original MAC address. There's likely<br>
other problems that I haven't thought of that will happen as well.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So that I have two instances of the same virtual machine starting from<br>
the same state.<br>
This way I can reset the VMs without having to reboot them (booting is<br>
rather slow).<br>
<br>
I practice I'll probably have ~16 instances at the same time. Constantly<br>
being reset to the same state.<br>
I tried with QEMU, and it's seems totally doable with savevm, copy file,<br>
then doing loadvm twice in parallel.<br>
(I'll be using a separate network for each VM, so I can be sure which one<br>
I'm talking to).<br>
<br>
</blockquote>
<br>
Well, as long as they're completely isolated from each other, you may have<br>
a better chance of success. However there will still be the issue of the IP<br>
address of the network interface. You can't have two networks using the<br>
same IP range (since libvirt doesn't use network namespaces for its<br>
networks), so the guest will need to change its IP, which means it will<br>
need to be notified of this need, possibly by having the host toggle the<br>
interface offline and back on - you can use virsh domif-setlink to do this.<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is this doable with libvirt, or am I better off using QEMU directly? and<br>
how? I couldn't do internal snapshots with --live, and snapshot-revert says<br>
it can't revert to external snapshots yet :)<br>
(using QEMU directly would certainly leave me with a lot of manual<br>
network configuration)<br>
<br>
</blockquote>
<br>
Someone else will have to talk about the particulars of snapshots...<br>
<br>
<br>
</blockquote></blockquote>
</blockquote></div>