-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add Suspend To Disk Option to the VM control menu #1359
base: main
Are you sure you want to change the base?
Conversation
Added DiskSuspend
Added DiskSuspend
Rename Suspend
Bugfix
Bugfix
Thanks for the Response. The difference between pause and managedsave are: pause
managedsave
After managedsave (Suspend to disk) the menu looks like the vm was "shut off", because in libvirt the vm Domain was destroyed. So Technically the vm is shutoff . To Resume the vm use normal start. Its the same behaviour as on a real PC after Suspend to Disk the PC is off, to continue use the power on button. Save could be a better name for this functionality, instead of Suspend to disk. Currently in the list and detail view the State is shut-off. Technically is the vm Domain destroyed in libvirt. I have to check if libvirt is able to represent the mangedsave state. It is possible to Suspend to disk a paused vm because, mangedsave allows to save the state of an paused vm to disk. On resume (start) the state of an paused vm is still paused. |
Its now possible to delete an managedsaveimage from the vm , if there is one
…the vm list and detail view
I made some changes based on the points mentioned. The name of the option has been changed from "Suspend to Disk" to "Save," as this should better reflect the functionality. To indicate that a saved image (managed save state) is present for the vm, I have added the tag "(Saved)" to the Shut Off status in both the list view and detail view. I chose not to use a separate status since the libvirt status of a vm with a saved image is "shut off," and there is no separate status for managed save. However, there might be a better way to implement this in the code. In addition, I have implemented the option to remove an existing saved image. However, without a confirmation dialog. Perhaps it would be advisable to add one. Unfortunately, libvirt does not provide an event for a deleted saved image, so I had to choose an approach that deviates from the behavior of other actions in code. Currently, it is not possible to filter based on the saved image tag. I am not sure if it makes sense to implement this function at the moment. The VMs are listed under "shut off" because that is the libvirt status. |
I do not like the word "Save" for this functionality. It sounds like it will save the VM as a file and download it, which is how "Save" is used in basically every other app (web-based or native). "Suspend to disk" was clearer to me, at least. The state should probably also be "Suspended". (It should probably still show up when filtering by the "shut off" state.) How is "Remove save image" any different from "Delete"? If it's supposed to remove the suspended state, it's pretty much the same starting it back up and choosing "Force shut down", right? |
I had considered that 'Suspend to Disk' might not be suitable because 'managedsave' also allows saving the content of paused vm, and the libvirt command is named 'managedsave.' However, I can change it to 'Suspend to disk' and the state to Suspended if you prefer. Internally, 'Remove save image' uses the Libvirt 'ManagedSaveRemove' command, which simply deletes the saved image without starting the vm. In principle, this image is also deleted when the vm is started, making the behaviour comparable to turning on and immediately turning off the vm. The reason I implemented this function is to provide a solution in case of an error where the vm fails to start due to an issue with the save image. |
…atored Code and change Name to "Remove suspend Image"
The stop function can only pause the VM, which means that the VM continues to allocate resources and the status of the VM is lost when the Host is rebooted.
It would be useful to have a function that allows you to save the state of a VM to disk and resume it at a later point in time.
Libvirt offers the managedsave function for this purpose.
This patch adds this function to the control menu of the VM