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

Enable "Create Snapshot" for VMs in KubeVirt under OpenShift Provider #264

Open
Dhamo1107 opened this issue Dec 10, 2024 · 3 comments
Open

Comments

@Dhamo1107
Copy link
Contributor

This feature request aims to enable the "Create Snapshot" functionality for VMs managed by the KubeVirt provider under OpenShift in ManageIQ. Snapshots allow users to save the state of a VM at a particular moment, providing a way to restore the VM to that state if needed.

Currently, the snapshot creation feature is not supported for KubeVirt VMs in OpenShift. Implementing this functionality will enhance ManageIQ's capabilities for managing VMs and align it with the existing feature set offered by other supported providers.

I am working on adding the "Create Snapshot" feature and have added supports :snapshot_create in /opt/manageiq/manageiq-gemset/bundler/gems/manageiq-providers-kubevirt-2d7aba4cd0bb/app/models/manageiq/providers/kubevirt/infra_manager/vm.rb

However, I encountered an error related to DDF. Please guide me on how to implement this feature with the appropriate backend code.
Thank You!

image
image
image

@agrare
Copy link
Member

agrare commented Dec 10, 2024

@Dhamo1107 since there is a UI form associated with that action, you have to declare what the dialog will contain. We use dynamic dialog fields (DDF) for this, and the method that you need to define on the Kubevirt VM class is params_for_create_snapshot. Here is an example from vmware: https://github.com/ManageIQ/manageiq-providers-vmware/blob/master/app/models/manageiq/providers/vmware/infra_manager/vm.rb#L43-L72

@Dhamo1107
Copy link
Contributor Author

I added that params_for_create_snapshot method @agrare and now got this
image

I checked the raw_create_snapshot in openstack provider snapshot.rb file, and also referred kubevirt API docs to create a snapshot. Give your suggestions for that raw_create_snapshot method to create a snapshot. Thank you

@agrare
Copy link
Member

agrare commented Dec 10, 2024

@Dhamo1107 can you push up a WIP pull-request? This looks like it is in code that you've added so I can't see what the arguments list is

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

No branches or pull requests

2 participants