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

Proposal for inject/eject CD-ROM #369

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mhenriks
Copy link
Member

What this PR does / why we need it:

Currently, a VM has to be rebooted to change the CD-ROM media. Let's leverage the hotplug volume API to fix that gaping hole in functionality

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 #

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:

Proposal for inject/eject CD-ROM

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Dec 18, 2024
@kubevirt-bot
Copy link

[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 davidvossel for approval. 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

Signed-off-by: Michael Henriksen <[email protected]>
Copy link
Member

@dankenigsberg dankenigsberg left a comment

Choose a reason for hiding this comment

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

Thanks for caring for this much-requested functionality.

kubevirt/kubevirt

# Design
Like most new features in KubeVirt, the building blocks already exist, just have to wire everything together
Copy link
Member

Choose a reason for hiding this comment

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

Please consider alternative designs and their pros/cons. In particular, can you consider following https://github.com/kubevirt/community/blob/e4645eb/design-proposals/vm-rollout-strategy/vm-rollout-strategy.md to enable a simpler, declarative, API. According to it, the user expresses a VM spec that includes a CDROM with a specific PVC and the VM controller makes that happen.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can address that in the design, but just to answer you inline, I think the functionality you describe can be generalized and included in an all encompassing "Declarative Volume Hotplug" design

Copy link
Member

Choose a reason for hiding this comment

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

I can address that in the design,

Thanks.

I think the functionality you describe can be generalized and included in an all encompassing "Declarative Volume Hotplug" design

Right, I'd love to see that. But I'd be satisfied in seeing CDROM-only as a first step.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think just CD-ROM being declarative would be confusing to users.

To me, what is proposed here is a good first step in making this long awaited functionality available to users soon. Going full declarative is a lot more complicated. But is something I do agree that we should tackle eventually

Copy link
Member

Choose a reason for hiding this comment

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

Please consider pros and cons each of these options in the text of the design.

Copy link
Member

Choose a reason for hiding this comment

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

Adding my 2 cents here, declarative is a nice to have, however, this type of installation operation is imperative and kind of "manual". Do we really expect this to be used with git ops?

@mw-0
Copy link

mw-0 commented Dec 18, 2024

this would be great. this is a real user missing feature moving from alternatives.

@jean-edouard
Copy link
Contributor

I would add an important non-goal about "config volumes", typically for service accounts.
Config volumes are ISOs but they're exposed as disks, not cdroms for some reason, so they can't be ejected/inserted.

@mhenriks
Copy link
Member Author

I would add an important non-goal about "config volumes", typically for service accounts. Config volumes are ISOs but they're exposed as disks, not cdroms for some reason, so they can't be ejected/inserted.

The fact that they they are isos is more of an implementation detail to me. Do end users really know/care when it is exposed as a disk?

I state as a non-goal Support for any volume type other than DataVolume/PersistentVolumeClaim. To me that is pretty clear, but maybe I can link to all the volume types we support

@jean-edouard
Copy link
Contributor

I would add an important non-goal about "config volumes", typically for service accounts. Config volumes are ISOs but they're exposed as disks, not cdroms for some reason, so they can't be ejected/inserted.

The fact that they they are isos is more of an implementation detail to me. Do end users really know/care when it is exposed as a disk?

They do know, since they are directly consuming them. And they probably do care, since that limitation prevents service account data from getting updated.

I state as a non-goal Support for any volume type other than DataVolume/PersistentVolumeClaim. To me that is pretty clear, but maybe I can link to all the volume types we support

You're right that's probably enough, thanks!


## Goals
- Extend existing APIs to support inject/eject CD-ROM operations
- Extend virtctl to have cdrom specific commands
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to do this using only kubectl. In general we've been trying to avoid adding things to virtctl that can already be done entirely in kubectl.

Copy link
Member Author

Choose a reason for hiding this comment

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

That would be declarative hotplug, which again, I think we should do eventually.

Users are currently used to adding/removing disks in a non-declarative way via virtctl. Also, there explicit requirements from customers to have a non declarative way to inject/eject CD-ROM.

See https://issues.redhat.com/browse/CNV-7383

@stu-gott
Copy link
Member

/hold

A request was made to compare pros/cons of doing just CD-ROM vs a more generalized API. This hold can be removed once that's addressed.

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 18, 2024
@alicefr
Copy link
Member

alicefr commented Dec 19, 2024

@mhenriks aren't we missing the setting of the boot order for the other disks? I mean, if we eject the cdrom, how does the VM know from which disk it has to boot the next time it is restarted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants