Page 1 of 1

VM lost current-state.vdi and reuse last snapshot as last.

Posted: 7. Nov 2011, 17:14
by iigor12
I have some problem with VirtualBox. My vdi snapshots rollback (somehow) and now I can't start VM from last state.

What I've done

1. Create VM with HD. (lamborghini.vdi)

Now HD hierarchi looks like this

Code: Select all

    lamborghini.vdi (*)
(*) - Changes write here

.2. Create snapshot (take snapshot)

Now HD hierarchi looks like this

Code: Select all

    lamborghini.vdi (F)
    -> {3c78b30d-3c34-4d17-a67e-e05b1a02d7db}.vdi (*)
(F) frozen

.3. Create second snapshot

Now HD hierarchi looks like this

Code: Select all

    lamborghini.vdi (F)
    -> {7d615830-6378-4c25-ba5e-c5700a465716}.vdi (F)
    -> -> {3c78b30d-3c34-4d17-a67e-e05b1a02d7db}.vdi (*)
.4. One month later. Switch off VM. (from guest OS)

.5. Switch off Host OS.

.6. Run Host OS

.7. Run Guest OS

Code: Select all

    $ VBoxManage startvm lamborghini --type headless
.8. Found, that active HD is: 7d615830-6378-4c25-ba5e-c5700a465716, and it's not frozen! (no additional snapshot vdi)

Now HD hierarchi looks like this

Code: Select all

     lamborghini.vdi (F)
     -> {7d615830-6378-4c25-ba5e-c5700a465716}.vdi (*)
not even

Code: Select all

     lamborghini.vdi (F)
     -> {7d615830-6378-4c25-ba5e-c5700a465716}.vdi (F)
     ->-> {3c78b30d-3c34-4d17-a67e-e05b1a02d7db}.vdi 
     ->-> {some_new_number}.vdi (*)
There is no {3c78b30d-3c34-4d17-a67e-e05b1a02d7db} at all.

I'm totaly sure, that do nothing else. (no snapshot restore and anything else) between 4 and 7.

Code: Select all

    $uname -a
    FreeBSD ny.local 8.2-STABLE FreeBSD 8.2-STABLE #0: Sat Oct  8 10:36:54 UTC 2011     root@ny.prettysin.info:/usr/obj/usr/src/sys/GENERIC  amd64

    $ ll ~/backup/Snapshot
    -rw-------  1 igor  igor  - 16196390912 Nov  3 23:55 {3c78b30d-3c34-4d17-67e-e05b1a02d7db}.vdi
    -rw-------  1 igor  igor  -  8944439296 Nov  7 12:07 {7d615830-6378-4c25-a5e-c5700a465716}.vdi

    $ VBoxManage -v
    4.0.12_OSEr72916
Log before last start(with actual data)

Code: Select all

    $ head -n15 Logs/VBox.log.1
    00:00:00.027 VirtualBox 4.0.12_OSE r72916 freebsd.amd64 (Oct  7 2011 21:59:54) release log
    00:00:00.027 Log opened 2011-10-20T18:08:22.813231000Z
    00:00:00.027 OS Product: FreeBSD
    00:00:00.027 OS Release: 8.2-STABLE
    00:00:00.027 OS Version: FreeBSD 8.2-STABLE #0: Sat Oct  8 10:36:54 UTC 2011        root@ny.local:/usr/obj/usr/src/sys/GENERIC
    00:00:00.027 Host RAM: 24499MB RAM, available: 3988MB
    00:00:00.027 Executable: /usr/local/lib/virtualbox/VBoxHeadless
    00:00:00.027 Process ID: 85437
    00:00:00.027 Package type: BSD_64BITS_GENERIC (OSE)
    00:00:00.033 Installed Extension Packs:
    00:00:00.033   None installed!
    00:00:00.068 VRDE: VirtualBox Remote Desktop Extension is not available.
    00:00:00.086 SUP: Opened VMMR0.r0 (/usr/local/lib/virtualbox/VMMR0.r0) at     0xffffffff81221020.
    00:00:00.102 File system of '/home/igor/VirtualBox VMs/lamborghini/Snapshots' (snapshots) is zfs
    00:00:00.102 File system of '/home/igor/VirtualBox VMs/lamborghini/Snapshots/{3c78b30d-3c34-4d17-a67e-e05b1a02d7db}.vdi' is zfs

    $ cat Logs/VBox.log.1 |grep -C6 "7d615830-6378-4c25-ba5e-c5700a465716"
    00:00:00.128 [/Devices/piix3ide/0/LUN#0/AttachedDriver/Config/] (level 6)
    00:00:00.128   Format <string>  = "VDI" (cb=4)
    00:00:00.128   Path   <string>  = "/home/igor/VirtualBox VMs/lamborghini/Snapshots/{3c78b30d-3c34-4d17-a67e-e05b1a02d7db}.vdi" (cb=91)
    00:00:00.128   Type   <string>  = "HardDisk" (cb=9)
    00:00:00.128
    00:00:00.128 [/Devices/piix3ide/0/LUN#0/AttachedDriver/Config/Parent/] (level 7)
    00:00:00.128   Format <string>  = "VDI" (cb=4)
    00:00:00.128   Path   <string>  = "/home/igor/VirtualBox VMs/lamborghini/Snapshots/{7d615830-6378-4c25-ba5e-c5700a465716}.vdi" (cb=91)
    00:00:00.128
    00:00:00.128 [/Devices/piix3ide/0/LUN#0/AttachedDriver/Config/Parent/Parent/] (level 8)
    00:00:00.128   Format <string>  = "VDI" (cb=4)
    00:00:00.128   Path   <string>  = "/home/igor/VirtualBox VMs/lamborghini/lamborghini.vdi" (cb=54)

Log last start(from old snapshot)

Code: Select all

    $ head -n16 Logs/VBox.log
    00:00:00.060 VirtualBox 4.0.12_OSE r72916 freebsd.amd64 (Oct  7 2011 21:59:54) release log
    00:00:00.060 Log opened 2011-11-06T22:44:32.090488000Z
    00:00:00.060 OS Product: FreeBSD
    00:00:00.060 OS Release: 8.2-STABLE
    00:00:00.060 OS Version: FreeBSD 8.2-STABLE #0: Sat Oct  8 10:36:54 UTC 2011     root@ny.prettysin.info:/usr/obj/usr/src/sys/GENERIC
    00:00:00.060 Host RAM: 24499MB RAM, available: 19602MB
    00:00:00.060 Executable: /usr/local/lib/virtualbox/VBoxHeadless
    00:00:00.060 Process ID: 20199
    00:00:00.060 Package type: BSD_64BITS_GENERIC (OSE)
    00:00:00.088 Installed Extension Packs:
    00:00:00.088   None installed!
    00:00:00.146 VRDE: VirtualBox Remote Desktop Extension is not available.
    00:00:00.166 SUP: Loaded VMMR0.r0 (/usr/local/lib/virtualbox/VMMR0.r0) at 0xffffffff81238020 - ModuleInit at ffffffff8124c3f0 and ModuleTerm at ffffffff8124c3c0
    00:00:00.166 SUP: VMMR0EntryEx located at ffffffff8124c2f0, VMMR0EntryFast at ffffffff8124c470 and VMMR0EntryInt at ffffffff8124b550
    00:00:00.177 File system of '/home/igor/VirtualBox VMs/lamborghini/Snapshots' (snapshots) is zfs
    00:00:00.178 File system of '/home/igor/VirtualBox VMs/lamborghini/Snapshots/{7d615830-6378-4c25-ba5e-c5700a465716}.vdi' is zfs
    $ cat Logs/VBox.log|grep -C6 "7d615830-6378-4c25-ba5e-c5700a465716"
    00:00:00.227 [/Devices/piix3ide/0/LUN#0/AttachedDriver/] (level 5)
    00:00:00.227   Driver <string>  = "VD" (cb=3)
    00:00:00.227
    00:00:00.227 [/Devices/piix3ide/0/LUN#0/AttachedDriver/Config/] (level 6)
    00:00:00.227   Format <string>  = "VDI" (cb=4)
    00:00:00.227   Path   <string>  = "/home/igor/VirtualBox VMs/lamborghini/Snapshots/{7d615830-6378-4c25-ba5e-c5700a465716}.vdi" (cb=91)
    00:00:00.227   Type   <string>  = "HardDisk" (cb=9)
    00:00:00.227
    00:00:00.227 [/Devices/piix3ide/0/LUN#0/AttachedDriver/Config/Parent/] (level 7)
    00:00:00.227   Format <string>  = "VDI" (cb=4)
    00:00:00.227   Path   <string>  = "/home/igor/VirtualBox VMs/lamborghini/lamborghini.vdi" (cb=54)

Could anybody tell me, how can I restore data from {3c78b30d-3c34-4d17-67e-e05b1a02d7db}.vdi and what had actually happen?

Re: VM lost current-state.vdi and reuse last snapshot as las

Posted: 7. Nov 2011, 21:51
by iigor12
I recover it:

1. Using File > Virtual Media Manager – Delete reference to the failed hard drive located on your NAS.
2. In the settings for your VM remove the failed disk
3. Click on sata and the little ‘Add HDD’ icon to the right – you can now select your remote disk image
4. add snapshot hard
5. add secondsnapshot hard.

But, I don't understand, whereis data from "last" session.

I read viewtopic.php?f=24&t=8046. According "Q. So how are virtual bytes in my Virtual HDD mapped into physical bytes in my VDI? " vdi does not store any transaction. Data store as a snapshot of drive.


I have
Root -> SNAP1 -> SNAP2*

After "bug"

Root -> SNAP1*

And why
Root -> SNAP1 -> SNAP2* = Root -> SNAP1* -> SNAP2* ?
Where is data from "last" session (diff SNAP1 SNAP1*)? It does not store anywhere?

Current session:

Code: Select all

$ VBoxManage list -l hdds
UUID:        d454c328-1edf-49ba-95a5-a01e46f4f1d8
Parent UUID: base
Format:      VDI
Location:    /home/igor/VirtualBox VMs/lamborghini/lamborghini.vdi
State:       locked read
Type:        normal
Usage:       lamborghini (UUID: f846c627-1f7a-4921-9ffa-8fe47d0dec26) [clean_install (UUID: 59e319a4-6870-487b-b055-39885bca5a27)]

UUID:        7d615830-6378-4c25-ba5e-c5700a465716
Parent UUID: d454c328-1edf-49ba-95a5-a01e46f4f1d8
Format:      VDI
Location:    /home/igor/VirtualBox VMs/lamborghini/Snapshot/{7d615830-6378-4c25-ba5e-c5700a465716}.vdi
State:       locked read
Type:        normal

UUID:        3c78b30d-3c34-4d17-a67e-e05b1a02d7db
Parent UUID: 7d615830-6378-4c25-ba5e-c5700a465716
Format:      VDI
Location:    /home/igor/VirtualBox VMs/lamborghini/Snapshot/{3c78b30d-3c34-4d17-a67e-e05b1a02d7db}.vdi
State:       locked write
Type:        normal
Usage:       lamborghini (UUID: f846c627-1f7a-4921-9ffa-8fe47d0dec26)


Re: VM lost current-state.vdi and reuse last snapshot as las

Posted: 8. Nov 2011, 14:08
by mpack
iigor12 wrote:And why
Root -> SNAP1 -> SNAP2* = Root -> SNAP1* -> SNAP2* ?
Where is data from "last" session (diff SNAP1 SNAP1*)? It does not store anywhere?
You have the hierarchy wrong. Snapshot refers to the thing thats frozen in time, not the thing that depends on it. E.g. after taking two snapshots your hierarchy would be Snapshot(base vdi)->Snapshot(First child)->CurrentState. If you take another snapshot then "CurrentState" becomes the last snapshot and a new current state will be created.

The current state is a .vdi with a UUID filename, just like all except the base VDI. It is stored in the snapshots folder along with all other children of the base VDI. The current state will have the most recent time stamp.