Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapshots: Allow disk-only snapshots of running machines #1560

Closed

Conversation

mvollmer
Copy link
Member

@mvollmer mvollmer commented Apr 16, 2024

  • Use "Full system" instead of "Complete". That's the libvirt terminology.
  • Detect guest agent and add "quiesce" flag is found.
  • Test quiesce functionality.... Maybe switch from cirros to alpine, which has qemu-guest-agent

image

image

image

@mvollmer
Copy link
Member Author

I wasn't able to revert to a disk-only snapshot:

image

Probably tracked by https://issues.redhat.com/browse/RHEL-21549 and fixed by https://www.mail-archive.com/devel@lists.libvirt.org/msg01703.html, but not yet in rhel-9-4.

Should this feature here go to rhel-9-4 or be put on hold until rhel-9-5?

@mvollmer mvollmer added blocked and removed blocked labels Apr 16, 2024
@mvollmer
Copy link
Member Author

Should this feature here go to rhel-9-4 or be put on hold until rhel-9-5?

Alright, current "main" goes to rhel-9-5 already, this is good to go.

@mvollmer
Copy link
Member Author

I should've used the term "disk-only" instead of "partial" in the code, but I figured out too late that that's what libvirt calls them.

@mvollmer mvollmer marked this pull request as ready for review April 16, 2024 11:52
@mvollmer
Copy link
Member Author

I should've used the term "disk-only" instead of "partial" in the code, but I figured out too late that that's what libvirt calls them.

Fixed.

@mvollmer
Copy link
Member Author

This is blocked on https://issues.redhat.com/browse/RHEL-21549

Cockpit should only offer the creation of disk-only external snapshots when they can also be restored. We might have to detect that at run-time, maybe by looking at the libvirt version.

@mvollmer mvollmer marked this pull request as draft April 19, 2024 07:01
@martinpitt
Copy link
Member

For the record: I will never approve this, this is a dangerous and crazy practice to offer and train admins to do. I won't make a fuss if someone else approves, but I refuse any responsibility for this, sorry.

@mvollmer
Copy link
Member Author

I wasn't able to revert to a disk-only snapshot:

Hmm, reverting disk-only snapshots might not be that important. Maybe they are only used as a mechanism to get a stable view of disks for the purposes of backup. If that is the case, I would argue that Cockpit doesn't need to offer disk-only snapshots. Completing the backup requires a deep understanding of how external snapshots are implemented and this is best done on the command line or from a program.

@mvollmer
Copy link
Member Author

Completing the backup requires a deep understanding of how external snapshots are implemented and this is best done on the command line or from a program.

What Cockpit could do is to expose the snapshotted disks as NBD devices so that people can then copy them to their backups.

Copy link
Member

@garrett garrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is very dangerous, both for stateful live snapshots (with state and memory) and disk-only, as it breaks expectations, which means it'll break someone's backups, which means someone using Cockpit will eventually lose their data.

We need to talk about snapshots holistically (the complete picture, including internal, external disk-only, and external live snapshots and the supportability and purpose of each) and work on designs that might help to mitigate the very real and likely risk for catastrophic data loss due to external snapshots.

@mac2net
Copy link

mac2net commented May 15, 2024

I mentioned on another thread here that I in fact did break a VM fiddling with the snapshots. I received additional instructions and will do another test shortly.
I understand that documentation has been added to the Redhat 9.4 release but I made a suggestion that documentation could be added via the GUI with a popup link that could at a minimum provide a link to documentation on the web,
image

<p>{_("This type of snapshot only saves the storage devices of the virtual machine, and not the state of running processes.")}</p>
</FlexItem>
</Flex>}>
<button onClick={e => e.preventDefault()} className="pf-v5-c-form__group-label-help">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

<Split hasGutter>
<Radio isChecked={!isDiskOnly}
id="snapshot-create-dialog-type-full"
onChange={() => onValueChanged("isDiskOnly", false)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

if (new_vm.connectionName == vm.connectionName && new_vm.id == vm.id)
return new_vm;
}
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This added line is not executed by any test.

@mvollmer
Copy link
Member Author

This is dead for now. No disk-only snapshots of running VMs in Cockpit, see https://issues.redhat.com/browse/COCKPIT-1112

@mvollmer mvollmer closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants