Live snapshot not mentionned by VB GUI

Discussions related to using VirtualBox on Windows hosts.
Post Reply
NMe
Posts: 24
Joined: 20. Mar 2016, 15:20

Live snapshot not mentionned by VB GUI

Post by NMe »

Host : Windows 7 Pro x64
Host : Windows 7 Pro x64
Guest : Windows 7 Pro x64
VirtualBox 5.2.2 r119230 FR, host and guest additions
Hello,
I created 4 VMs on one host, each VM dedicated to one task (office tasks, photography, etc.). Main VDI files are backup weekly, but only if no snapshot linked.
Two VMs require iSCSI connections (for data backup practical reasons).
I took a new snapshot to test, and when the method has been fixed, I deleted the test snapshot taken from the first VM, and apply the method directly to the second VM. The two VMs connect OK to the iSCSIs.
I closed the two VMs.
When I re-opened the VMs, the second VM (where any snapshot has been taken) was still connected, but the first one (where a snapshot has been taken to test), did not reconnect. In fact, for that VM, in Properties/Storage, the reference to iSCSI has disappeared. I cleaned VirtualBox (vboxmanage storageattach ... --medium none, vboxmanage closemedium disk ...), reattach, and the VM connected again (with a new UUID for the device). But, now, VirtualBox GUI shows any snapshot (which is attempted), but there is an active snapshot in C:\Users\%USERNAME%\VirtualBox VMs\%VMNAME%\Snapshots (see screenshot attached).
As far I get it in VBox.log, it seems each test I did before let a "mark" as a snapshot UUID. Could it be a part of the issue ? How manage now to merge the two VDI (main and snapshot)? As the VM is high value licences holder - photography softwares, Microsoft Office Pro -, I am uncertain to use vboxmanage clone ... command to try to merge, if main UUID may change. But I can freely disconnect iSCSI, fully clean VM and VirtualBox sides, properly merge, an reconnect. A proper procedure would be very appreciate, thanks. NME
VBox - part 1.log
VBox.log - Part 1/2 (cut for size reason)
(54.2 KiB) Downloaded 3 times
VBox - part 2.log
VBox.log - Part 2/2 (cut for size reason)
(108.67 KiB) Downloaded 4 times
Global view of the issue
Global view of the issue
Snapshot issue - 65 ko.jpg (64.52 KiB) Viewed 1803 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Live snapshot not mentionned by VB GUI

Post by mpack »

Please provide logs as single, zipped attachments. It saves server space and makes it easier for us to process.

I'm not entirely understanding your description of the problem, and I don't know how you ended up with a differenced VDI in the main VM folder, but the mention of using storageattach et al is very worrying. I can't think of a legitimate reason to do that, and in all the scenarios I can think of you probably end up killing the VM.

Frankly, if you want to mess with individual files belonging to a VM then you'd be well advised to make each VM folder as simple and self contained as possible, i.e. no snapshots, no linked clones.
NMe
Posts: 24
Joined: 20. Mar 2016, 15:20

Re: Live snapshot not mentionned by VB GUI

Post by NMe »

Thank you for your answer. Sorry for not zipping. Reading you, I realize that my screenshot (which is not really a screenshot, but an assembly of parts of several screenshots) is not clear : main and differential VDI ARE in their correct folder, respectively, NMPHOTO_W7S_HDWR.VDI (main) in C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro and {...}.VDI (differential) in C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro\Snapshots, as they should be. I should have highlithed, or enclosed each folder to be clearer.
I did not proceeded to any manual operation, neither moving files, nor modifying files. When tests have been performed, I delete the snapshot with GUI, operation finished without any warning, and "Current State" replaced the line with the name of the snapshot. VM ran normaly, as others I use which have iSCSI connection. It is later that I discovered that a differential file remained. It seems as main and differential have swapped (by comparison with another VM, reading logs side to side), but I am not sure.
Please excuse my poor english and knowing of fondamentals of computing, but that do not prevents me to try to understand how things are going on. Thank you very much for any extra ideas, NME
NMe
Posts: 24
Joined: 20. Mar 2016, 15:20

Re: Live snapshot not mentionned by VB GUI

Post by NMe »

Hello,
I try to better descript my problem :
  • I want to backup each VM, once a week, because of their $ licensing value;
  • To do, I wrote a PowerShell script verifying VM is closed, and had no differential ; if yes, simply copy to a server;
  • Datas treated in or by applications in the VM are treated on an iSCSI disk on a server, server which is it-self backuped (so, I do not worry about data backup). This pattern runs OK.
Last week, I added a new VM, relative to photography.
  • Create from scratch (W7, partioning C:(OS) and E:(datas), customization);
  • Create snapshot and initialize iSCSI:
    • Server : LUN and iSCSI target;
    • Code: Select all

      vboxmanage : SATA(2,0) (vboxmananage storageattach NMPHOTO_W7x64Pro --storagectl "SATA" --port 2 --device 0 --type hdd --medium iscsi --server ...  --target iqn... --tport 3260);
      Returns : iSCSI disk created. UUID: ...
    • VirtualBox GUI : add storage ...;
    • Windows (guest) : configure iSCSI initiator, then configure the partition;
    • Unfortunately, I did a mistake in the target name (relatively to my standard pattern), and I had to redo the operations (and I cannot remember if I have had merged the snapshot before or not);
    • Unmounting successful (Windows (guest), vboxmananage storageattach ... --medium none, vboxmanage closemedium disk {iSCSIUUID}, VBox GUI update, server (modify target name). Everything clear;
  • Second new process successful;
  • A this point, I certainly merged the snapshot, if any left;
  • Create a new snapshot to install photography softwares (line 1 : Before Install, line 2 : Current state). Successful. Merge the snapshot (line 1 : Current State).
When I came back to backup PS script for that VM, I saw there was still a differential.

First I thought the issue was linked to iSCSI (next posts), but after to have read a long thread you wrote about UUID parenting, I ran vboxmanage internalcommands dumphdinfo:

Main

Code: Select all

vboxmanage internalcommands dumphdinfo C:\Users\Noël_2\VirtualBox_VMs\NMPHOTO_W7x64Pro\NMPHOTO_W7S_HDWR.vdi
--- Dumping VD Disk, Images=1
Dumping VD image "C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro\NMPHOTO_W7S_HDWR.vdi" (Backend=VDI)
Dumping VDI image "C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro\NMPHOTO_W7S_HDWR.vdi" mode=r/o uOpenFlags=9 File=0x000000001fb8b0
Header: Version=00010001 Type=1 Flags=0 Size=134217728000
Header: cbBlock=1048576 cbBlockExtra=0 cBlocks=128000 cBlocksAllocated=33828
Header: offBlocks=1048576 offData=2097152
Header: Geometry: C/H/S=1024/255/63 cbSector=512
Header: uuidCreation={8ecc21d8-f45b-48ae-85e4-681663c7bc8c}
Header: uuidModification={507bd316-deec-467b-99de-2a59281d5db4}
Header: uuidParent={00000000-0000-0000-0000-000000000000}
Header: uuidParentModification={00000000-0000-0000-0000-000000000000}
Image:  fFlags=00000000 offStartBlocks=1048576 offStartData=2097152
Image:  uBlockMask=000FFFFF cbTotalBlockData=1048576 uShiftOffset2Index=20 offStartBlockData=0
Differential

Code: Select all

vboxmanage internalcommands dumphdinfo C:\Users\Noël_2\VirtualBox_VMs\NMPHOTO_W7x64Pro\Snapshots/{b75e8111-709e-4868-9ca2-e377744a128a}.vdi
--- Dumping VD Disk, Images=1
Dumping VD image "C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro\Snapshots/{b75e8111-709e-4868-9ca2-e377744a128a}.vdi" (Backend=VDI)
Dumping VDI image "C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro\Snapshots/{b75e8111-709e-4868-9ca2-e377744a128a}.vdi" mode=r/o uOpenFlags=9 File=0x000000003fb910
Header: Version=00010001 Type=4 Flags=0 Size=134217728000
Header: cbBlock=1048576 cbBlockExtra=0 cBlocks=128000 cBlocksAllocated=11591
Header: offBlocks=1048576 offData=2097152
Header: Geometry: C/H/S=1024/255/63 cbSector=512
Header: uuidCreation={b75e8111-709e-4868-9ca2-e377744a128a}
Header: uuidModification={301b343c-966e-4c65-af33-a6a391c4f9d7}
Header: uuidParent={8ecc21d8-f45b-48ae-85e4-681663c7bc8c}
Header: uuidParentModification={b82ebeb4-3cfc-42c4-8981-78175c65d912}
Image:  fFlags=00020000 offStartBlocks=1048576 offStartData=2097152
Image:  uBlockMask=000FFFFF cbTotalBlockData=1048576 uShiftOffset2Index=20 offStartBlockData=0
Even Vbox GUI knows than connection is indirect (see zip attached)

On the other hand, iSCSI seems correct, comparing two different VMs (just note one can also see here that SATA(0, 0) points to snapshot and not to main)

Code: Select all

vboxmanage showvminfo NMPHOTO_W7x64Pro (faulty VM)
...
...
SATA (0, 0): C:\Users\Noël_2\VirtualBox VMs\NMPHOTO_W7x64Pro\Snapshots/{b75e8111-709e-4868-9ca2-e377744a128a}.vdi (UUID: b75e8111-709e-4868-9ca2-e377744a128a)
SATA (1, 0): Empty
SATA (2, 0): 192.168.33.108|iqn.2000-01.com.synology:SYNL412PSQA.Target-2.be8540fe9a (UUID: 880bc988-9d9c-4439-a4c9-1232eb13f4fb)
...

Code: Select all

vboxmanage showvminfo NMPHOTO_W7x64Pro (correct VM for reference)
...
...
SATA (0, 0): C:\Users\Noël_2\VirtualBox VMs\NMDEVLPMNT_W7x64Pro\NMDEVLPMNT_W7S_HDWR.vdi (UUID: 2c1c4c24-41e6-45b1-9bbe-8c451ac02e27)
SATA (1, 0): Empty
SATA (2, 0): 192.168.33.108|iqn.2000-01.com.synology:SYNL412PSQA.Target-3b.be8529fe9a (UUID: a83caac5-4bc0-418d-8ad8-978c1351a85b)
...
...
As VM NMPHOTO_W7x64Pro is running, and VirtualBox knows that there is an indirect connection, can you help me to correct the issue, and merge the two VDI files. Thank you very much.
Attachments
Sans titre.zip
Indirect connection
(62.39 KiB) Downloaded 5 times
Last edited by socratis on 4. Feb 2018, 14:33, edited 1 time in total.
Reason: Fixed formatting.
NMe
Posts: 24
Joined: 20. Mar 2016, 15:20

Re: Live snapshot not mentionned by VB GUI

Post by NMe »

Sans titre.zip
(62.39 KiB) Downloaded 3 times
Zip in line
NMe
Posts: 24
Joined: 20. Mar 2016, 15:20

Re: Live snapshot not mentionned by VB GUI

Post by NMe »

Hello, the issue can be reproduced.
- Create a VM (Windows 7 Pro) on a client PC (Windows 7 Pro)
- Create a LUN and its target on a server
- With VirtualBox GUI, increase SATA port number from 2 to 3
- Execute VBoxManage command
vboxmanage storeattach "VMName"
--storagectl "SATA" --port 2 --device 0 --type hdd --medium iscsi
--server 192.168.aaa.bbb
--target iqn…
--tport 3260
> C:\NewiSCSI-UUID.txt
- Control with VirtualBox GUI, Storage, than SATA port 2 is connected to the iSCSI target iqn…
- Open the VM
- Start Menu
- Disk Management
- A windows appears with Disk 1 ticked and Main boot sector ticked
This windows will never appear again : possible reason for the issue if
these parameters are incorrect ?
- Then, proceed as usual to define simple volume, size, format, letter and name
- Control with Windows Explorer
- The iSCSI disk is fully operationnal
- Close the VM
- Control with VirtualBox GUI, Storage, than SATA port 0 is connected (directly) to the main VDI file

- Then, take a snapshot "Before to install new software"
- Now there are 2 lines :
- Before to install new software
- Current State
- Control with Windows Explorer than in folder C:\Users\%USERNAME%\VirtualBox VMs\%VMNAME%\Snapshots\ there is a differential disk {…}.VDI
- Control with VirtualBox GUI, Storage, than SATA port 0 is now connected (undirectly) to the differential disk in folder …\Snapshots\

- With VirtualBox GUI, delete the snapshot, one line remains (Current State)
- Control with Windows Explorer than in folder …\Snapshots the differential VDI remains also
- Control with VirtualBox GUI, Storage, than SATA port 0 is always connected (undirectly) to the differentialVDI file

How to get round this issue ?

Thanks, NMe
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Live snapshot not mentionned by VB GUI

Post by mpack »

I have to say that with this step:
- Create a LUN and its target on a server
You lose me. And the messing with sata port numbers and "storageattach" just makes it worse. All I can say is that I don't understand the need to do any of these things. And snapshots are fragile at the best of times.

I will note that a snapshot is possible even in a VM which has no drives, and that may be what is happening here.
NMe
Posts: 24
Joined: 20. Mar 2016, 15:20

Re: Live snapshot not mentionned by VB GUI

Post by NMe »

Hello,

Thank you for your answers.

My project had 2 targets :

a/Divide disk crash cost by creating several VM devoted to one workflow (one for development, one for photography, etc.), each VM being backup regularly by Windows Scheduler on the host ;
b/Backup workflow and/or datas of each VM the more easily as possible, outside the VM to limit its size.

Point a is simple, provided all snapshots are deleted (any differential disk exist), and VM stopped. The 2 conditions may be easily checked before backup.

Point b could be solved by a simple network connection in the VM to any shared folder on the server, but iSCSI disk sounds as an attractive solution to try because the server manages automatically LUNs backup. In the server OS environment, such iSCSI disks are called LUN, and the link to them is an iSCSI target, however I assume these are general (iSCSI) terminologies.

How the issue came :
After to have created VM, LUN and target, I connected the iSCSI disk to the VM, succesfully. Then I took a snapshot, installed successfully any software (here CDBurner or NotePad++; only to see). As everything went ok, I closed the VM, and deleted the snapshot (merged the differential VDI). The differential VDI remained in the …\Snapshots folder, while VirtualBox GUI snapshot showed only Current State. In the Storage section, the VM was connected undirectly through the differential disk. No other way to recover the VM than use CloneVDI from the differential, redo the VM, and lost Windows and Office licencing (the VM was not a sandbox, shame on me ! ...)

Solution :
After a lot of tests (with sandboxes !), I notice than snapshoting a VM with an iSCSI connection creates two differentials : one for the base VDI, one for the iSCSI disk (which "exists" only by its UUID). I notice also than snapshoting works with such a VM : when one deletes the snapshot, the two differentials VDI vanished, and one gets an unique base VDI.

But, if one connects the iSCSI (succesfully), and takes the snapshot immediately (successfuly), installs any software (successfully), closes the VM, and deletes the snapshot, one differential remains in the …\Snapshots folder, while VirtualBox GUI snapshot shows only Current State.

So, one MUST close the VM straight after iSCSI connection, and re-open later to take a snapshot.

Unless there is a configuration point to pay close attention (in Windows disks manager, VM side, for instance ?), or if you consider it is a VirtualBox issue, for me, the thread can be closed.

I am going to use this architecture for a few monthes and see if it could be interesting for personnal or small business.

Thanks again, NMe
Post Reply