<div dir="ltr">Hi Kashyap,<div><br></div><div>Thanks for your answer!</div><div><br></div><div>Unfortunately my use case requires cloning the exact memory state, so I won't be able to use virt-sysprep.</div><div>But the snapshot command looks like something I could use.</div><div>Could you suggest how to proceed and create/start a new vm from that snapshot?</div><div><br></div><div>Thanks,</div><div>Michael</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 12, 2016 at 2:37 PM, Kashyap Chamarthy <span dir="ltr"><<a href="mailto:kchamart@redhat.com" target="_blank">kchamart@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Apr 11, 2016 at 12:01:08PM +0300, Michael Ravits wrote:<br>
> Hi,<br>
><br>
> My use case involves creating duplicates of saved virtual machines.<br>
<br>
</span>While I realize you want to trivially clone VMs with some state at<br>
random point in time, you might want to look into `virt-builder` about<br>
cloning VMs.  It has some sensible advice:<br>
<br>
    <a href="http://libguestfs.org/virt-builder.1.html#clones" rel="noreferrer" target="_blank">http://libguestfs.org/virt-builder.1.html#clones</a><br>
<br>
Using `virt-builder` to clone images, will 'sysprep' the images, which<br>
will ensure that (a) each VM copy gets a fresh pair of SSH host keys;<br>
(b) a new random seed; (c) all security/sensitive information is<br>
removed; (d) log files are cleaned (in the below URL, look up the string<br>
"logfiles *" to see what all it removes), and much more.   Take a look<br>
here for what all it does:<br>
<br>
    <a href="http://libguestfs.org/virt-sysprep.1.html#operations" rel="noreferrer" target="_blank">http://libguestfs.org/virt-sysprep.1.html#operations</a><br>
    <a href="http://libguestfs.org/virt-sysprep.1.html#security" rel="noreferrer" target="_blank">http://libguestfs.org/virt-sysprep.1.html#security</a><br>
<span class=""><br>
> Tried with virt-manager and with virsh but so far it seems like this<br>
> case is not supported by these tools.  Does anyone know how I could<br>
> achieve the above?<br>
<br>
</span>With 'virsh', you _can_ save the live disk and memory state:<br>
<br>
    $ virsh snapshot-create-as \<br>
        --domain myvm snap1 \<br>
        --diskspec vda,file=./disk-snap.qcow2,snapshot=external \<br>
        --memspec file=./mem-snap.qcow2,snapshot=external \<br>
        --atomic<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
/kashyap<br>
</font></span></blockquote></div><br></div>