kubevirt icon indicating copy to clipboard operation
kubevirt copied to clipboard

sidecar to inject qemu args

Open ibrokethecloud opened this issue 9 months ago • 6 comments

What this PR does

Before this PR: PR introduces an additional sample sidecar to inject additional qemu args to the domain definition, based on annotations present on the VMI.

After this PR: Users can fine tune qemu args in the domain definition to control specific behavior.

Fixes # https://github.com/kubevirt/kubevirt/issues/11093

Why we need it and why it was done in this way

The following tradeoffs were made: The sidecar approach seems the least disruptive means to perform this operation without changing core kubevirt api to allow inject of random qemu arguments.

The following alternatives were considered:

Links to places where the discussion took place: Please refer to conversation from here: https://github.com/kubevirt/kubevirt/issues/11093#issuecomment-2078541705

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


ibrokethecloud avatar May 09 '24 06:05 ibrokethecloud

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

kubevirt-bot avatar May 09 '24 06:05 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 iholder101 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

kubevirt-bot avatar May 09 '24 06:05 kubevirt-bot

Hi @ibrokethecloud. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

kubevirt-bot avatar May 09 '24 06:05 kubevirt-bot

I wrote one in the past too, see https://github.com/kubevirt/kubevirt/pull/9166#issuecomment-1768039885

victortoso avatar May 09 '24 09:05 victortoso

@ibrokethecloud this should be doable with the configmap that @victortoso mentioned. I would avoid to add an new image. On the other hand, I think we are missing the documentation how to achieve it, @victortoso am I correct? If so, would you mind to add the example in the user guide?

alicefr avatar May 13 '24 08:05 alicefr

Hi @alicefr and @ibrokethecloud

I created a simple python script to add qemu env/args using sidecars + configmap and published it as a gist: https://gist.github.com/victortoso/4a54ef0e75a2b917bb21cb33ec4da141

would you mind to add the example in the user guide?

I'll propose adding it in the user-guide later Today.

Just for clarification, the steps using this example are:

  1. The annotation for env/args is: libvirt.vm.kubevirt.io/qemuArgs, see how the data was set here
  2. Create the configmap e.g: k create -f examples/my-config-map.yaml
  3. Create the VMI (should have sidecar metadata properly set, see it here)

Cheers,

victortoso avatar May 14 '24 10:05 victortoso

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

kubevirt-bot avatar Aug 12 '24 11:08 kubevirt-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

kubevirt-bot avatar Sep 11 '24 11:09 kubevirt-bot

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

kubevirt-bot avatar Oct 11 '24 11:10 kubevirt-bot

@kubevirt-bot: Closed this PR.

In response to this:

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

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-sigs/prow repository.

kubevirt-bot avatar Oct 11 '24 11:10 kubevirt-bot