kubevirt icon indicating copy to clipboard operation
kubevirt copied to clipboard

[Clone API]: Support snapshot source

Open iholder101 opened this issue 3 years ago • 4 comments

What this PR does / why we need it: This PR adds support for cloning with a snapshot as source. In other words, after this PR we would be able to clone a Snapshot into a running VM.

The relates to this issue: https://github.com/kubevirt/kubevirt/issues/6089.

Long story short: the term "template" is overloaded and has different meanings according to the context. This PR aims to resolve the "bookmark VM" use-case. In this use-case, the user (e.g. the system admin) wishes to take a clean image of an OS, modify it in some way, and then create a "bookmark" that would serve as a base for creating more similar VMs.

In other words, the system-admin would:

  1. Create some VM
  2. Perform changes: Install apps / download files / change configurations / anything else
  3. Create a snapshot of the VM
  4. (optionally) Delete the original VM
  5. After some time, create new VMs from the saved snapshot

Please note that since the clone object defined the different cloning configurations, it's possible to clone the same snapshot many times with different configurations according to the user's need.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes https://github.com/kubevirt/kubevirt/issues/6089 (Well, at least partially)

Release note:

Introduce support for clones with a snapshot source (e.g. clone snapshot -> VM)

iholder101 avatar Sep 13 '22 08:09 iholder101

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

kubevirt-bot avatar Sep 13 '22 08:09 kubevirt-bot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign alonakaplan for approval by writing /assign @alonakaplan in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

kubevirt-bot avatar Sep 13 '22 08:09 kubevirt-bot

FYI /cc @mhenriks @lyarwood @fabiand @ShellyKa13

iholder101 avatar Sep 15 '22 13:09 iholder101

Thanks a lot for your insightful review @mhenriks! All comments are addressed.

iholder101 avatar Sep 30 '22 08:09 iholder101

Thanks a lot @ShellyKa13! Your review is very insightful and appreciated! All of your comments are addressed :+1:

iholder101 avatar Oct 03 '22 09:10 iholder101

I think this looks good, I think my only question is about the location of func tests

mhenriks avatar Oct 10 '22 21:10 mhenriks

Thanks for your review @mhenriks! I've moved the functional tests outside of the storage package here: https://github.com/kubevirt/kubevirt/pull/8458/commits/736558717fdd716b53c02025a1b312a3bdb1de8c

Let me know if anything else is missing

iholder101 avatar Oct 11 '22 09:10 iholder101

/retest

iholder101 avatar Oct 11 '22 12:10 iholder101

@mhenriks

Not sure this is complete. What about syncInfo.snapshotReady?

Great catch! Thanks!

iholder101 avatar Oct 19 '22 09:10 iholder101

/retest

iholder101 avatar Oct 19 '22 18:10 iholder101

/retest

iholder101 avatar Oct 24 '22 12:10 iholder101

/retest

iholder101 avatar Nov 06 '22 18:11 iholder101

@iholder-redhat: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-check-unassigned-tests 4e6b3480d9fc17de092d5dfd8c3f20ce9959eecd link true /test pull-kubevirt-check-unassigned-tests
pull-kubevirt-e2e-k8s-1.22-sig-performance 4e6b3480d9fc17de092d5dfd8c3f20ce9959eecd link false /test pull-kubevirt-e2e-k8s-1.22-sig-performance

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

kubevirt-bot avatar Nov 06 '22 19:11 kubevirt-bot

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enp0s3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

kubevirt-bot avatar Nov 09 '22 13:11 kubevirt-bot

Nice work /lgtm

+1 Indeed!

enp0s3 avatar Nov 10 '22 08:11 enp0s3

/test pull-kubevirt-check-unassigned-tests

iholder101 avatar Nov 10 '22 10:11 iholder101

/retest-required

brianmcarey avatar Nov 11 '22 08:11 brianmcarey

/retest-required

maya-r avatar Nov 13 '22 05:11 maya-r

/lgtm

enp0s3 avatar Nov 13 '22 08:11 enp0s3