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

Snapshot and migrate functionality. #1540

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bjwrigh
Copy link
Contributor

@bjwrigh bjwrigh commented Jun 25, 2024

-29ea35c: Fixed some log levels causing unnecessary noise when using Phenix
-379c4bf: Snapshot now only does snapshot. Migrate does migrate (and snapshot, because they are often linked). Will also take care of multiple disks automatically. [Note: vm snapshot previously paused VM because of calling migrate. This is no longer the case. vm migrate still pauses the VM for the operation, but does not restart the VM]

Copy link
Contributor

@jacdavi jacdavi left a comment

Choose a reason for hiding this comment

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

Overall looks good. Tested that everything functioned as expected and it did. Just two things

  1. Could you run scripts/all.bash I saw a missing curly brace and some formatting errors that should be fixed
  2. Is this code block still relevant for snapshots? If not can we remove it and the associated part of the help output? https://github.com/sandia-minimega/minimega/pull/1540/files#diff-3e02ecaf1183b3cbe8d2924d7ff4d9bf7e0b0763d897cd7f98b65b02994fdf9dR798-R818

…grate)

reword help docs for vm snapshot
remove empty append
@glattercj
Copy link
Contributor

This will break the ns snapshot command. I recommend adding updates to support it before merging this. @jacdavi your question about the relevant code block is related to this command. PR where this was all added here.

@jacdavi
Copy link
Contributor

jacdavi commented Jul 9, 2024

@glattercj thanks for the heads up!

If I'm tracking everything correctly, it seems that ns snapshot should be renamed or at least call vm migrate. The main purpose of this PR is to flip the meaning of snapshot and migrate to match QEMU's naming (snapshot makes a new disk backed by your current disk, while migration is for state/memory).

@glattercj
Copy link
Contributor

Maybe keep each command atomic without hidden side effects?

  • vm snapshot = only disk
  • vm migrate = only memory state
  • ns save calls each of the above to create a saved namespace 'snapshot' (replaces ns snapshot)

@jacdavi
Copy link
Contributor

jacdavi commented Jul 9, 2024

Based on code comments, it seems unlikely that anyone would want to save just the memory state, since it's probably not bootable without the disk at that point as well. I think that's why @bjwrigh kept them coupled.

@glattercj
Copy link
Contributor

glattercj commented Jul 9, 2024

In that case why not just combine the 2 and have:

  • vm save (what this PR is proposing as 'vm migrate')
  • ns save (calls ^)

I added vm snapshot specifically for ns snapshot, so if migrate is doing both, just have them both named "save" and remove the vm snapshot command entirely. I'm mostly arguing for sane naming since "save" is sort of self-descriptive of what the command is doing for normal users, where "migrate" doesn't mean much unless you really know qemu and dig into the commit history to find this PR and find the reasoning. But at the end of the day I'll defer to you :)

@jacdavi
Copy link
Contributor

jacdavi commented Jul 11, 2024

I appreciate the input. Given how long it's taken me to wrap my head around all the disk commands in minimega/phenix, I understand how important naming is.

I agree that migrate really doesn't give a good sense of what's happening since we're not using the function to move a vm across hardware. save seems more appropriate, so I'm good to switch to that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants