Re: Swap virtio images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 6, 2012 at 9:35 AM, Iain J. Watson <lists@xxxxxxxxxxxxxxx> wrote:
> Hello,
>
> I am trying to find a way to use backing files to make snapshots of
> running VMs. The idea is I pause the VM, use qemu-img to create a new
> disk file with the currently used file as a backing file, swap the
> images then unpause the VM.
>
> Commands would be something like:
>
> ----------
>  (qemu) stop
>  (qemu) drive_del virtio0
>
>  $ qemu-img create -f qcow2 -b os-disk-0.qcow2 os-disk-1.qcow2
>
>  (qemu) drive_add 0 file=os-disk-1.qcow2   # I'm not 100% sure on the
> drive_add syntax
>  (qemu) c
> ----------
>
> If I try and do this just now I get the error "Can't hot-add drive to
> type 7" when running the drive_add command.
>
> Is there another way to achieve this? Is this something that could
> potentially be added or would architecture not support what I'm trying
> to do?
>
      This is probably not the answer you seek, but I create a lvm
logical volume for each vm. So, if I need to backup the "pickles" vm I
create a lvm snapshot, which can be done while the vm is happily
running along:

lvcreate -L 10G -s -n pickles_snap_`date "+%Y%m%d"` ${HOSTNAME}_vg0/pickles

If I need to go back to the snapshot I can lvconvert --merge.

> Cheers,
> Iain Watson
> --
> "Just think how stupid the average person is,
> and then realize that half of them are even stupider!"
> --George Carlin
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux