kubevirt.github.io icon indicating copy to clipboard operation
kubevirt.github.io copied to clipboard

Add missing DataVolume accessModes in CDI lab

Open stefanha opened this issue 1 year ago • 15 comments

The Fedora DataVolume example in the CDI lab does not work out of the box with KubeVirt v1.1.1 on minikube v1.32.0:

status:
  conditions:
  - lastHeartbeatTime: "2024-02-14T21:18:57Z"
    lastTransitionTime: "2024-02-14T21:18:57Z"
    message: no accessMode defined DV nor on StorageProfile for standard StorageClass
    reason: ErrClaimNotValid
    status: Unknown
    type: Bound

Add accessModes so the example works.

What this PR does / why we need it:

It makes the CDI lab from the KubeVirt website work.

Does this PR fix any issue? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

No

Fixes #

Special notes for your reviewer:

stefanha avatar Feb 14 '24 21:02 stefanha

Hi @stefanha. 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 Feb 14 '24 21:02 kubevirt-bot

Maybe mention that is only needed if your storage class is not recognized by CDI.

awels avatar Feb 22 '24 18:02 awels

Maybe mention that is only needed if your storage class is not recognized by CDI.

It may have been caused by a mistake on my part (I followed the minikube KubeVirt installation instructions). Can you explain what you mean by "if your storage class is not recognized by CDI"?

stefanha avatar Feb 22 '24 19:02 stefanha

CDI maintains a list of known provisioners, and it automatically populates the values for those in the StorageProfiles. If you have a provisioner it does not know about, it will not automatically populate, and you have to specify it yourself.

awels avatar Feb 22 '24 19:02 awels

We also maintain documentation on how to set up storage profiles for provisioners that are not recognized: https://github.com/kubevirt/containerized-data-importer/blob/main/doc/storageprofile.md

awels avatar Feb 22 '24 19:02 awels

similar issue in https://github.com/kubevirt/kubevirt/issues/11280

akalenyu avatar Feb 26 '24 08:02 akalenyu

similar issue in kubevirt/kubevirt#11280

Yes, looks like this is a duplicate of that issue.

It would be nice for the CDI lab to just work without further tweaks. It's one of the first experiences users may have with KubeVirt. Is there any harm in setting the access mode explicitly?

stefanha avatar Feb 26 '24 16:02 stefanha

There is no technical harm, and it is fully supported. But we would like for people to get in the habit of not setting the values and letting the system figure it out. If we start out with set all this explicitly then that will defeat that idea. I guess if we just note that this is just for the lab, then it is fine.

awels avatar Feb 26 '24 16:02 awels

similar issue in kubevirt/kubevirt#11280

Yes, looks like this is a duplicate of that issue.

It would be nice for the CDI lab to just work without further tweaks. It's one of the first experiences users may have with KubeVirt. Is there any harm in setting the access mode explicitly?

Which provisioner is this? We see a surge of this type of issues lately so maybe some provisioner is becoming very common for a home lab quick test

akalenyu avatar Feb 26 '24 16:02 akalenyu

similar issue in kubevirt/kubevirt#11280

Yes, looks like this is a duplicate of that issue. It would be nice for the CDI lab to just work without further tweaks. It's one of the first experiences users may have with KubeVirt. Is there any harm in setting the access mode explicitly?

Which provisioner is this? We see a surge of this type of issues lately so maybe some provisioner is becoming very common for a home lab quick test

I hit this when running minikube v1.32.0 using Kubernetes v1.28.3 on Docker 24.0.7:

$ k get storageclass
NAME                 PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
standard (default)   k8s.io/minikube-hostpath   Delete          Immediate           false                  12d

stefanha avatar Feb 27 '24 16:02 stefanha

@awels If you prefer I can send a patch to add k8s.io/minikube-hostpath to storagecapabilities.go.

stefanha avatar Feb 27 '24 16:02 stefanha

I think that would be better, but maybe also just mention here that if someone is not using mini kube but another unknown storage that you need to set the access mode

awels avatar Feb 27 '24 17:02 awels

@awels I have change the commit to add a note about how to deal with the error.

stefanha avatar Feb 27 '24 17:02 stefanha

similar issue in kubevirt/kubevirt#11280

Yes, looks like this is a duplicate of that issue. It would be nice for the CDI lab to just work without further tweaks. It's one of the first experiences users may have with KubeVirt. Is there any harm in setting the access mode explicitly?

Which provisioner is this? We see a surge of this type of issues lately so maybe some provisioner is becoming very common for a home lab quick test

I hit this when running minikube v1.32.0 using Kubernetes v1.28.3 on Docker 24.0.7:

$ k get storageclass
NAME                 PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
standard (default)   k8s.io/minikube-hostpath   Delete          Immediate           false                  12d

Ah ofc, minikube, thanks for submitting the patch!

akalenyu avatar Feb 28 '24 09:02 akalenyu

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 May 28 '24 10:05 kubevirt-bot

/remove-lifecycle stale

awels avatar May 28 '24 12:05 awels

/lgtm

awels avatar May 28 '24 12:05 awels

@brianmcarey can you review?

awels avatar May 28 '24 12:05 awels

/cc @aburdenthehand

Can you take a look for approval?

brianmcarey avatar May 28 '24 12:05 brianmcarey

/approve Great stuff. Thanks @stefanha

aburdenthehand avatar May 29 '24 09:05 aburdenthehand

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aburdenthehand, brianmcarey

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