-
Notifications
You must be signed in to change notification settings - Fork 609
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
[cinder-csi-plugin] Cinder CSI plugin should not provision ROX or RWX volumes #1367
Comments
@Fedosin which version of plugin you are using? I believe this error shouldn't come in latest code |
@Fedosin I saw |
This is our code https://github.com/openshift/cloud-provider-openstack |
@Fedosin Did you specify volume type is storage class as multiattach , and volume created in cinder have the property multiattach=True? |
Hi @ramineni, the issue occurs when asking for ROX or RWX access mode but the backend doesn't support multiattach. In this case, cinder CSI should not provision the volume but return an error because it won't be able to honor the required access mode. See the following example:
The PV shows
However, the volume doesn't support multi-attach:
Do you think it's enough to chesk the volume capabilities in |
There seem to be multiple problems here:
Is there a way for the cinder driver to discover what the backend really supports? Just to make sure I understand correctly: #1368 fixes the second issue, but is not acceptable in its current form because, due to the first issue, this would prevent the Multi-Attach feature ? |
Is there a way to discover what capabilities the backend supports? |
@mandre , right now, we only check volume.multiattach flag , to check volume is capable of multiattach or not. It requires admin to configure correct volume type while creating volume. You could also explore any cinder API which expose that |
'multiattach' is an extra_spec on the volume type. We should be able to check that. |
Incidentally, although the published api docs don't say so there's at least 1 code comment suggesting that volume.multiattach is deprecated: I don't know how likely it is to go away in practise, but it seems prudent to use the extra_spec on the type rather than the field on the volume. |
multi-attach is not by itself sufficient for safe RWX when using block storage like cinder. You also need to make sure to set "volumeMode = 'Block' " in your PVC. The volumeMode option which was introduced as a beta feature in k8s 1.13 [1] Not doing this setting, using an earlier k8s version than 1.13, or setting "Filesystem" gets you traditional behavior where k8s expects to either find a filesystem on the block volume or it will create an xfs or ext4 filesystem before making it available to applications. These are node local file systems and it is not safe to mount them on multiple nodes in the cluster, even read only (read only mounts still write file system metadata). So Cinder and other block based PVs with RWX is really for applications like some databases that work with raw block devices, read and write to block offsets rather than to posix filesystem paths, and that do their own coordination/write arbitration when there are multiple writers rather than relying on a filesystem for this function. Another use is for instance with kubevirt, where raw block volumes with ISO images are used for boot and it is is useful to be able to multi-attach them to facilitate live migration. When you do multiple attaches of a Cinder block volume in OpenStack neither Cinder nor Nova builds a file system on the block volume so the traditional k8s behavior of imposing a node local filesystem is not an issue. The owner of Nova guest VMs with multiple attaches to the same volume can make this mistake, but OpenStack itself will not put them in this predicament. [1] https://kubernetes.io/blog/2019/03/07/raw-block-volume-support-to-beta/ |
For completeness, I wrote up what I believe should be the logic here: #1368 (comment) |
I commented in #1368 that to my knowledge Cinder provides no way for a regular user (member with project scoped keystone role) to discover the multiattach extra spec in volume types. IMO that is a deficiency that Cinder should address (PTG topic? capabilities discovery has come up before in Cinder but to my knowledge was never resolved). (FWIW, in Manila we distinguish between traditional, private extra-specs which have back end details that are not the business of regular users and public extra-specs, which can be used by regular users for capability discovery) |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
Cinder spec: https://specs.openstack.org/openstack/cinder-specs/specs/xena/expose-cinder-user-visible-extra-specs-spec.html |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle-stale |
/remove-lifecycle stale |
https://review.opendev.org/c/openstack/cinder/+/806260 implements user visible extra specs for Cinder, including whether a volume type has multi-attach support. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
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. |
/kind bug
What happened:
When creating a PVC with ROX or RWX access mode, the volume provisioned successfully, but when creating pods assigned to different nodes, it got attach failure.
What you expected to happen:
We should show out the unsupport message as cinder in-tree plugin does:
Warning ProvisioningFailed 7s (x3 over 14s) persistentvolume-controller Failed to provision volume with StorageClass "standard": invalid AccessModes [ReadWriteMany]: only AccessModes [ReadWriteOnce] are supported
How to reproduce it:
Install OSP cluster and cinder csi driver is installed.
Create PVC with ROX/RWX access mode, and create pod to consume it.
Check the pod and pvc statuses
Create another pod which assigned to another node
Volume provisioned successfully
$ oc get pvc -n wduan
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mypvc02 Bound pvc-ae09e478-2b8e-4350-a83a-b789ff991d7d 1Gi RWX standard-csi 17m
$ oc get pvc -n wduan-01
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mypvc03 Bound pvc-9404f88c-d437-493b-ba5e-3a2685cdc1c9 1Gi ROX standard-csi 14m
Warning FailedAttachVolume 12s attachdetach-controller AttachVolume.Attach failed for volume "pvc-ae09e478-2b8e-4350-a83a-b789ff991d7d" : rpc error: code = Internal desc = [ControllerPublishVolume] Attach Volume failed with error failed to attach ccc11e8b-cfff-40ac-92da-d7baed902b12 volume to fa6d2e8c-eb8f-4a57-a54a-5063f2b8bec7 compute: Bad request with: [POST https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13774/v2.1/servers/fa6d2e8c-eb8f-4a57-a54a-5063f2b8bec7/os-volume_attachments], error message: {"badRequest": {"message": "Invalid input received: Invalid volume: Volume ccc11e8b-cfff-40ac-92da-d7baed902b12 status must be available or downloading (HTTP 400) (Request-ID: req-75c01a31-c877-4582-930e-35c5d8b64eaf)", "code": 400}}
The text was updated successfully, but these errors were encountered: