Bug 1572295 - RFE: virsh: Export snapshot to new VM (clone from snapshot)
Summary: RFE: virsh: Export snapshot to new VM (clone from snapshot)
Keywords:
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-26 16:01 UTC by Medic Momcilo
Modified: 2018-07-18 15:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Medic Momcilo 2018-04-26 16:01:19 UTC
As far as I can tell, virsh snapshots contain enough information to create new VM from the snapshot (RAM and disk are saved).

When cloning from snapshot, we would get same results as we would when reverting to a snapshot, but in a new VM.

Main benefit would be easy backups.

We could just take snapshot and save it externally with ability to restore to it at any time.

Hope it's clear what the intention is behind this RFE.

I would gladly provide more information if needed.

Comment 1 Eric Blake 2018-04-26 16:23:00 UTC
It almost sounds like you are asking for a way to clone a new live VM from a snapshot of an existing live VM, while leaving the existing VM running.  This is extremely dangerous, as having two distinct VMs running at the same time, but sharing resources such as hostname, entropy pool, network connections, ... from the point in time where the snapshot was created, will create chaos if not security holes.  Cloning a new VM is best done on an offline VM, through specialized tools such as virt-sysprep, which handle all the implications of scrubbing the new VM to be distinct enough from the original.

If you are NOT asking for two parallel VMs, then you are merely asking for a way to revert back to the state recorded in a snapshot, but then you don't need a new VM.  And yes, being able to revert to a snapshot is a desirable property of any snapshot system (the fact that libvirt can currently do it for internal snapshots but not for external snapshots is a deficiency, already tracked in other bug reports).

At any rate, the act of properly cloning a VM (particularly a live one) involves too much knowledge about the contents of the guest being cloned, so that libvirt will never do that (rather, it's a task for tools higher in the stack, like virt-sysprep).


Note You need to log in before you can comment on or make changes to this bug.