Jump to content

VM Snapshots


Recommended Posts

2 hours ago, bmartino1 said:

So i'm playing around with the unraid VM in v7 beta 2

image.thumb.png.9491a0e843a86d9368a3ceeff2b14587.png

 

I have found a few bugs here and there from general use and would like to know more on the snapshot system

 

another small bug is removing older VMs... 

 

image.thumb.png.d94201b2c4a04989bee58306e51021ef.png

image.png.1df6802886fb380c9b38e488a5f3a056.png

 

image.thumb.png.5df4669b6c63d9ad3a97e64f7dc7bca6.png

 

This was a vm that I chose to remove vm and disk. but I can't remove this folder... 

 

Another small bug is a new vm created in vdisk 1 doen't build the vdisk. I was able to copy the vdisk over to other VMs, as if unrad makes a vdisk it 500 mb and a ubuntu installer can't find the disk missing block device... but copy over a unraid 20GB premade form unraid 6 and the same vm ubuntu installer can now see and use the vdsik...


Example in testing for example the libvirt.img breaks, moves or is no longer, any vm wiht snapshots is lost. there may be a way to fix this IDK. but is a concern if moving a vm from one unraid to another... Unless we merge the snapshot back into vdisk 1...

From my experience.

image.png.a21073382b52c481962ca9f9472c2253.png

 

I need to make 2 snapshots for a backup. If i want to revert to snapshot base per testing i would click the earlier chain and click revert snapshot. Great!

I can't remove an older snapshot as this will break the chain needed to boot and have my curent work in the lattest sna[shot (hence 2) 1 for the actual backup, 1 for the back runnig new code...

So my question is what does block commit and block Pull due and what is the use case.

How would I Merge my current chain into 1 disk image now that i have a finished project in testing.

So other side VM feature request hat would be nice as we have a excellent implementation of ejecting disks would be to add a boot order option to the web gui to change the boot from the vdisk file over the disk drive file.

Thoughts concerns, or am I miss understanding the implementation of how snapshots in VM is supposed to work?

Bug report added here:

 

This section is just for general info, issues should be posted in the prerelease bug section

Link to comment
2 hours ago, bmartino1 said:

not sure if these are causing problems with snapshots and other issues in beta 7

Snapshot plugin does not do anything with zfs snaps. It just show zfs list.

 

Are you doing zfs snaps in vm manager or qemu ones?

Link to comment
  • 2 weeks later...

Hey guys, running unraid 7 beta 2 and made an snapshot of an windows 10 VM before upgrading to 11.
The upgrade went throught, and now i wanted to delete the snapshot and stay on the data the VM now is.
After reading threads the "Block commit" function is what i am wanting.
Started it, with the VM shutdown.

 

Sadly, the output window is empty, for over 15 minutes now (See picture).

 

The files disk files seems untouched:

 

image.png.1a8de43d38b17fb033dbff4b79d177a9.png

 

Any hint's what i can do to merge those vdisk's?
Do i have to start the VM to get it merged?

(Dont want to mess it up :-)

 

Thank you

 

 

image.thumb.png.d0d8a340aea1af8250aa9ad1db5048d2.png

 

image.thumb.png.57f32e61ff362941a8c2643065cc46d7.png

Edited by pOpYRaid
Link to comment

After half an hour my unraid was going to sleep.
File are unchanged.
Started the commit again, and again the window is empty (as on the first try).
Also the file are not changing (size and time stamp).

 

Please help?

Where are Log files for the commands launched?

 

thx

Link to comment
56 minutes ago, pOpYRaid said:

After half an hour my unraid was going to sleep.
File are unchanged.
Started the commit again, and again the window is empty (as on the first try).
Also the file are not changing (size and time stamp).

 

Please help?

Where are Log files for the commands launched?

 

thx

Should appear on from Page.

 

image.png

Link to comment

ok, i fixed it!

 

It was definitely the issue that i used KVM (domain) name with spaces!
I will call it a bug, you find articles on the net saying the frontend using libvirt should NOT allow KVM (domain) names with spaces.

 

I fixed it by doing the following:

  • Rename the maschine with the webgui to a name without spaces ("Windows11" in my case)
  • The snapshots seems to be gone and are not shown in webgui
    That's because the snapshotdb\{domain} folder is not renamed.
    Maybe that's another bug.
    I manually renamed it in directory "/etc/libvirt/qemu/snapshotdb/" from "Windows\ 11\ Server\ \(Macrium\ Site\ Manager\)" to "Windows11" (same as KVM name)
    After pressing F5 in the webgui on the VM tab, snapshots for this machine is shown again
  • Sadly "Block commit" does'nt work, it complains about missing base image
    Sure, the sanpshotdb has the wrong domain path in it.
  • I dirty/lazy fixed it by coping the new renamed domain folder to the old name.

    cd /mnt/cache/domains
    cp -r Windows11 "Windows 11 Server (Macrium Site Manager)"
     
  • After that the "Block commit" worked
  • Now you have to remove the New domain with "rm -R Windows11".
    Because the merged disk is at the old path.
    An than move the new vdisk back to the new KVM/domain name 'mv "Windows 11 Server (Macrium Site Manager)"/ Windows11'

    !! Attention !! Before you remove anything, be SURE that's the correct directory or make an backup.
    I have double checked the timestamps of vdisk1.img.

And yessss, it boots up!

 

@limetech can you please look into this, this should be fixed for the final v7 release.
There are two issues:

  • Don't allow spaces in KVM & snapshot names
  • Also rename the snapshotdb when renaming KVM over webgui and maybe fix the baseimage path inside the db
    or prevent renaming in the gui when there are snapshots.

thx

Edited by pOpYRaid
Link to comment
42 minutes ago, pOpYRaid said:

ok, i fixed it!

 

It was definitely the issue that i used KVM (domain) name with spaces!
I will call it a bug, you find articles on the net saying the frontend using libvirt should NOT allow KVM (domain) names with spaces.

 

I fixed it by doing the following:

  • Rename the maschine with the webgui to a name without spaces ("Windows11" in my case)
  • The snapshots seems to be gone and are not shown in webgui
    That's because the snapshotdb\{domain} folder is not renamed.
    Maybe that's another bug.
    I manually renamed it in directory "/etc/libvirt/qemu/snapshotdb/" from "Windows\ 11\ Server\ \(Macrium\ Site\ Manager\)" to "Windows11" (same as KVM name)
    After pressing F5 in the webgui on the VM tab, snapshots for this machine is shown again
  • Sadly "Block commit" does'nt work, it complains about missing base image
    Sure, the sanpshotdb has the wrong domain path in it.
  • I dirty/lazy fixed it by coping the new renamed domain folder to the old name.

    cd /mnt/cache/domains
    cp -r Windows11 "Windows 11 Server (Macrium Site Manager)"
     
  • After that the "Block commit" worked
  • Now you have to remove the New domain with "rm -R Windows11".
    Because the merged disk is at the old path.
    An than move the new vdisk back to the new KVM/domain name 'mv "Windows 11 Server (Macrium Site Manager)"/ Windows11'

    !! Attention !! Before you remove anything, be SURE that's the correct directory or make an backup.
    I have double checked the timestamps of vdisk1.img.

And yessss, it boots up!

 

@limetech can you please look into this, this should be fixed for the final v7 release.
There are two issues:

  • Don't allow spaces in KVM & snapshot names
  • Also rename the snapshotdb when renaming KVM over webgui and maybe fix the baseimage path inside the db
    or prevent renaming in the gui when there are snapshots.

thx

Will look at my code it maybe the snapshot with spaces i need to check.

Link to comment
30 minutes ago, pOpYRaid said:

Sure, the VM name was "Windows 11 Server (Macrium Site Manager)" (without quotes).
The snapshot name was "Vor Windows 11 Upgrade" (without quotes).

Maybe it was the bracket's in the KVM name?

 

 

You running on a ZFS pool? This has been add to next release.

 

image.png

  • Thanks 1
Link to comment
2 hours ago, pOpYRaid said:

Also rename the snapshotdb when renaming KVM over webgui and maybe fix the baseimage path inside the db
or prevent renaming in the gui when there are snapshots.

Will look to add disable for rename in this version as snapshotdb will need all paths updating also. So will look to allow rename in 7.1+

root@computenode:~# cat /etc/libvirt/qemu/snapshotdb/AAArch/snapshots.db 
{
    "S20240820195913": {
        "name": "S20240820195913",
        "parent": "Base",
        "state": "shutoff",
        "desc": null,
        "memory": {
            "@attributes": {
                "snapshot": "no"
            }
        },
        "creationtime": "1724180353",
        "method": "QEMU",
        "backing": {
            "hdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2"
            ],
            "rhdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2"
            ]
        },
        "primarypath": "\/mnt\/vmpoolzfs\/domains2\/AAArch",
        "disks": [
            {
                "@attributes": {
                    "name": "hdc",
                    "snapshot": "external",
                    "type": "file"
                },
                "driver": {
                    "@attributes": {
                        "type": "qcow2"
                    }
                },
                "source": {
                    "@attributes": {
                        "file": "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2"
                    }
                }
            },
            {
                "@attributes": {
                    "name": "hda",
                    "snapshot": "no"
                }
            }
        ]
    },
    "S20240820200054": {
        "name": "S20240820200054",
        "parent": "S20240820195913",
        "state": "shutoff",
        "desc": null,
        "memory": {
            "@attributes": {
                "snapshot": "no"
            }
        },
        "creationtime": "1724180454",
        "method": "QEMU",
        "backing": {
            "hdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820200054qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2"
            ],
            "rhdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820200054qcow2"
            ]
        },
        "primarypath": "\/mnt\/vmpoolzfs\/domains2\/AAArch",
        "disks": [
            {
                "@attributes": {
                    "name": "hdc",
                    "snapshot": "external",
                    "type": "file"
                },
                "driver": {
                    "@attributes": {
                        "type": "qcow2"
                    }
                },
                "source": {
                    "@attributes": {
                        "file": "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820200054qcow2"
                    }
                }
            },
            {
                "@attributes": {
                    "name": "hda",
                    "snapshot": "no"
                }
            }
        ]
    }
}

 

  • Thanks 1
Link to comment
26 minutes ago, SimonF said:

Will look to add disable for rename in this version as snapshotdb will need all paths updating also. So will look to allow rename in 7.1+

root@computenode:~# cat /etc/libvirt/qemu/snapshotdb/AAArch/snapshots.db 
{
    "S20240820195913": {
        "name": "S20240820195913",
        "parent": "Base",
        "state": "shutoff",
        "desc": null,
        "memory": {
            "@attributes": {
                "snapshot": "no"
            }
        },
        "creationtime": "1724180353",
        "method": "QEMU",
        "backing": {
            "hdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2"
            ],
            "rhdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2"
            ]
        },
        "primarypath": "\/mnt\/vmpoolzfs\/domains2\/AAArch",
        "disks": [
            {
                "@attributes": {
                    "name": "hdc",
                    "snapshot": "external",
                    "type": "file"
                },
                "driver": {
                    "@attributes": {
                        "type": "qcow2"
                    }
                },
                "source": {
                    "@attributes": {
                        "file": "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2"
                    }
                }
            },
            {
                "@attributes": {
                    "name": "hda",
                    "snapshot": "no"
                }
            }
        ]
    },
    "S20240820200054": {
        "name": "S20240820200054",
        "parent": "S20240820195913",
        "state": "shutoff",
        "desc": null,
        "memory": {
            "@attributes": {
                "snapshot": "no"
            }
        },
        "creationtime": "1724180454",
        "method": "QEMU",
        "backing": {
            "hdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820200054qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2"
            ],
            "rhdc": [
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820193043qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820195913qcow2",
                "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820200054qcow2"
            ]
        },
        "primarypath": "\/mnt\/vmpoolzfs\/domains2\/AAArch",
        "disks": [
            {
                "@attributes": {
                    "name": "hdc",
                    "snapshot": "external",
                    "type": "file"
                },
                "driver": {
                    "@attributes": {
                        "type": "qcow2"
                    }
                },
                "source": {
                    "@attributes": {
                        "file": "\/mnt\/user\/domains2\/AAArch\/vdisk1.S20240820200054qcow2"
                    }
                }
            },
            {
                "@attributes": {
                    "name": "hda",
                    "snapshot": "no"
                }
            }
        ]
    }
}

 

Thx a lot, also for this change!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...