Jump to content

(Prerelease 7 beta 2) VM Snapshot and restore


Go to solution Solved by SimonF,

Recommended Posts

Posted (edited)
15 minutes ago, SimonF said:

image.png

 

Revert will put VM back to before snapshot.

image.png

 

There are options for Block Commit and Pull.

how did you get to that screen?

is the usb manger plugin breking the vm tab?


image.thumb.png.5d649fefa18d6eec5f7567bed9f55756.png

 

image.thumb.png.65da81bdafecd96e0853944f963104ee.png


image.thumb.png.fd754bb2f2d67b561c2a27d4be99d583.png

 

or is a separate plugin needed?

Edited by bmartino1
pictures
Link to comment
  • bmartino1 changed the title to (Prerelease 7 beta 2) VM Snapshot and restore
11 minutes ago, bmartino1 said:

can we get a clarification on what each options does?

Revert snapshot:
Will restore ??? xml?

vs

Block Commit / Block Pull

I'm testing with these options atm with a quick setup.

This should be in the prerelease tread, but there is this post you can review 

Revert will set the VM back to the state before the snapshot.

 

When doing a QEMU snap the changes to the disk are written into an overlay file.

 

Block commit with copy the changes back to the original file and set that disk back to the orignal file name but will have all changes since the snap.

 

Block pull will pull backing data from the original file into the new overlay. The original is a moment in time. Vm will use the new file and not be dependant on backing file.

 

 

 

 

  • Thanks 1
Link to comment
Posted (edited)
On 8/12/2024 at 2:52 PM, SimonF said:

This should be in the prerelease tread, but there is this post you can review 

Revert will set the VM back to the state before the snapshot.

 

When doing a QEMU snap the changes to the disk are written into an overlay file.

 

Block commit with copy the changes back to the original file and set that disk back to the orignal file name but will have all changes since the snap.

 

Block pull will pull backing data from the original file into the new overlay. The original is a moment in time. Vm will use the new file and not be dependant on backing file.

 

 

 

 

the words for commit / pull are confuses even to me as a end user.

I want to know the option that combines them all back into a single vdisk.img file.

revert and pull to me sound the same while different implementations...

I don't want data loss so I would do a block commit if i'm understanding this

image.thumb.png.547402a9c3a5f694f75df281f03e6ecf.png

 

as i want to copy this vm to another unraid server for production.

Edited by bmartino1
Link to comment

Thank you for this clarfication:
https://wiki.libvirt.org/I_created_an_external_snapshot_but_libvirt_will_not_let_me_delete_or_revert_to_it.html

 

Quote

Revert will set the VM back to the state before the snapshot.

 

When doing a QEMU snap the changes to the disk are written into an overlay file.

 

Block commit with copy the changes back to the original file and set that disk back to the orignal file name but will have all changes since the snap.

 

Block pull will pull backing data from the original file into the new overlay. The original is a moment in time. Vm will use the new file and not be dependant on backing file.


SO yes theses options will vary based on how one made the snapshots...

A block pull is only when the vm is running per wiki documentation:
(so a snapshot while the vm is running could potetnail use block pull)
 

Quote

 

virsh blockpull: Remove one (or more) backing files, by pulling the content from the backing file into the active file. Limitation: as of qemu 1.6, you can only pull into the active image of an online guest (for offline images, qemu-img you can pull into any image with a rebase command). With this, it is possible to go from:

base <- snap1 <- snap2*

to:

base <- snap2*+^

where the contents of snap1 are now contained in snap2, and where snap2 had metadata rewritten to point to base.

 


while Block Commit is only when vm is off.
(so a snapshot when the machien is powered off)
 

Quote

virsh blockcommit: Modify a deep backing file so that one (or more) intermediate backing files are committed into the base. Limitation: as of qemu 1.6, you cannot commit from the active image of an online guest (for offline images, the qemu-img commit operation can commit, but only through one base file at a time). Also, if you commit into a backing file, you invalidate any other qcow2 file that has been based off the same backing file. With this, it is possible to go from:

base <- snap1 <- snap2*

to:

base^ <- snap2*+


so in my case as i powered off the vm and made the snapshots i need teh vm off and run a block commit to make it vdisk1.img and 1 snapshot (the lattest verion that i'm running...)

to fix my share to antoher unraid Vm i will still need to prefrom a virsh block copy to make a new vdisk1 file with the contents of both.
 

Quote

virsh blockcopy: Create a copy of the contents into any other format, and optionally pivot into the copy rather than the original. Limitation: as of qemu 1.6, this operation cannot be restarted, so libvirt 1.1.1 refuses to support this operation for anything except transient domains. With this, it is possible to go from:

base <- snap1 <- snap2*

to:

new^*

where the contents of the entire old chain is now in new. Other destination configurations are also possible, and with a sequence of several operations combined, a user can get back to the original file name with a minimum of data movement between temporary snapshot qcow2 files.

Note that which of the options is fastest will depend on how much the live image has diverged from the point in time where the snapshot was taken. Also note that the resulting file name of w (although qemu is still working on ways to decently expose that information to the user, so your best guess may be based on file sizes or relative length of time between a snapshot creation and your merge operation).

 

Link to comment

so with the vm powered off

i made a lattest snapshot default options

and ran block commit. Default --base --top ...

the unrand vm tab:

image.thumb.png.a14b7a73c2845696c6e02db07d037c94.png

Now I have 1 vdisk again. YEAH!

image.thumb.png.dc6cb443cd92b334623ac0139abcd3fc.png

not sure if the snapshots need manual deleted but the snapshot files are gone and the system boot to the last snapshot as i wanted.
 

Link to comment
26 minutes ago, bmartino1 said:

so with the vm powered off

i made a lattest snapshot default options

and ran block commit. Default --base --top ...

the unrand vm tab:

image.thumb.png.a14b7a73c2845696c6e02db07d037c94.png

Now I have 1 vdisk again. YEAH!

image.thumb.png.dc6cb443cd92b334623ac0139abcd3fc.png

not sure if the snapshots need manual deleted but the snapshot files are gone and the system boot to the last snapshot as i wanted.
 

How did you run. The VM has to be running to show options in beta2 in next release beta or rc will show when VM is not running and will start in a suspended state to action. If you ran virsh then it would not remove the snapshots from the database also will not remove nvram snaps etc.

 

image.pngimage.png

Link to comment
49 minutes ago, bmartino1 said:

to fix my share to antoher unraid Vm i will still need to prefrom a virsh block copy to make a new vdisk1 file with the contents of both.

Block commit will do this but VM needs to be running. Block copy is really for migrations to others systems or file locations.

 

Commit copies data from all overlays back into the original img file.

 

Pull pulls data from the backing files into the latest file. So the orginal image is as before the snap and the backing file is a complete image will all the data pulled into it.

 

Block copy is not implemented in the VM Gui.

Link to comment

all my VM were off. On Source system The borg to my system BMM-Unraid.

On the borg anytime i wanted to make a snapshot in ubuntu I powered off the VM
clicked the VM name and click create snapshot:
image.thumb.png.1dc28ee0956c62e13978d5761d0e388a.png

image.thumb.png.c2562b3ce0da602b41d9da431ed7b618.png


I installed os did something power off VM same way made snapshot Untill i'm a few chains down and have everything the way i want in the VM.

Now I have 4 or so snapshot chains.
I created a snapshot called it before I block commit while the system is off...

then in the list of snapshot click on the recently created snapshot and run block commit option with default on screen

not changing a thing in the menu and click Block Commit
image.png.77bdd1d9e275752b69ecba471a854c35.png

then waited until the action is competed in the window.

What i was left with was a mes of snapshots in teh vm tab but a singla vmdisk1. I booted the VM and it was working with the last edits... ATM I'm copying that file to my unraid to test on another machine...

Link to comment

side not to self. Also grab the extra meta data within  /etc/libvirit data when moving new VM with snapshot to a new Unraid System...

vdisk1 has all the data, but i still need to tranfer the qemu VM nvram bios file snapshot data and snapshot db data to teh new unraid system:

image.png.049a023201ffed7839537f4ec8c9c8a7.png


I have sucessfully moved the vm after a snapshot block commit to a new unraid system

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...