qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [Bug 1753186] Re: qemu-nbd: always first snapshot loaded fr


From: Max Reitz
Subject: [Qemu-devel] [Bug 1753186] Re: qemu-nbd: always first snapshot loaded from VDI images with snapshots
Date: Mon, 05 Mar 2018 12:51:16 -0000

Hi,

As far as I can tell that's because only the first snapshot is actually stored 
in the VDI.
(1) I've created a VM with /tmp/foo.vdi as storage
(2) Executed "echo 'snapshot' > /dev/sda" in the guest
(3) Took a snapshot
(4) Executed "echo 'next snapshot' > /dev/sda" in the guest
(5) Took a snapshot
(6) Executed "echo 'active layer' > /dev/sda" in the guest

$ strings /tmp/foo.vdi
<<< Oracle VM VirtualBox Disk Image >>>
snapshot
$ ls ~/VirtualBox\ VMs/foo/Snapshots
{c9a75c86-6c0d-4aaa-9d24-cbd4456c74fb}.vdi  
{ce16e224-fa61-4b26-a5c5-21d92062ced7}.vdi
$ strings ~/VirtualBox\ 
VMs/foo/Snapshots/\{ce16e224-fa61-4b26-a5c5-21d92062ced7\}.vdi 
<<< Oracle VM VirtualBox Disk Image >>>
next snapshot
$ strings ~/VirtualBox\ 
VMs/foo/Snapshots/\{c9a75c86-6c0d-4aaa-9d24-cbd4456c74fb\}.vdi 
<<< Oracle VM VirtualBox Disk Image >>>
active layer

So snapshots in VDI apparently are what qemu calls external snapshots, so they 
work through backing file links -- and the original file is simply the 
bottom-most backing file (that is, the oldest snapshot).  So the file you'd 
want to open is {c9a75c86-6c0d-4aaa-9d24-cbd4456c74fb}.vdi. 
 However:
$ qemu-img info \{ce16e224-fa61-4b26-a5c5-21d92062ced7\}.vdi
qemu-img: Could not open '{ce16e224-fa61-4b26-a5c5-21d92062ced7}.vdi': 
unsupported VDI image (non-NULL link UUID)

So qemu doesn't support this now.  The current behavior is more or less
correct (because the file only contains the data of the oldest
snapshot), supporting snapshots would be a feature request.

Max

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1753186

Title:
  qemu-nbd: always first snapshot loaded from VDI images with snapshots

Status in QEMU:
  New

Bug description:
  When mounting a virtual box disk image of a VM with snapshots, always
  the state of the first snapshot is shown.

  How to reproduce:
  1. Create a new VirtualBox VM or use an existing one, while choosing VDI as 
the disk image format.
  2. Create a snapshot of the VM.
  3. Modify the file system from within the VM enough that differences to the 
snapshotted version are apparent.
  4. Create another snapshot.
  5. Shut down the VM.
  6. Mount the partition from the disk image with `qemu-nbd -c /dev/nbd0 
/path/to/disk.vdi; mount /dev/nbd0pX /mnt`

  Expected result: The mounted disk image shall represent the latest state of 
the VM
  Actual result: The mounted disk image represents the VM state at the first 
snapshot

  version information: qemu-nbd-2.11.1(openSUSE Tumbleweed)

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1753186/+subscriptions



reply via email to

[Prev in Thread] Current Thread [Next in Thread]