ceph-csi icon indicating copy to clipboard operation
ceph-csi copied to clipboard

nfs: implement ControllerModifyVolume to change NFS-server hostname

Open nixpanic opened this issue 3 weeks ago • 12 comments

The new hostname of the NFS-server is stored in a journal entry for the volume. The new NFS-server will only be used the next time the NFS Volume is mounted on a worker node.

It is not possible to update the VolumeContext of a Volume, so the old hostname of the NFS=server will be stored there forever.


Show available bot commands

These commands are normally not required, but in case of issues, leave any of the following bot commands in an otherwise empty comment in this PR:

  • /retest ci/centos/<job-name>: retest the <job-name> after unrelated failure (please report the failure too!)

nixpanic avatar Dec 04 '25 16:12 nixpanic

@nixpanic is this tested code? i dont see ControllerServiceCapability_RPC_MODIFY_VOLUME capability is exposed for nFS

Still trying to add some e2e tests, the csi-provisioner and csi-resizer sidecars have just gained the ability to pass credentials to the ControllerModifyVolume request.

nixpanic avatar Dec 10 '25 14:12 nixpanic

/test ci/centos/mini-e2e-helm/k8s-1.34/nfs

nixpanic avatar Dec 12 '25 10:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34/nfs

nixpanic avatar Dec 12 '25 10:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34

nixpanic avatar Dec 12 '25 11:12 nixpanic

@nixpanic is this tested code? i dont see ControllerServiceCapability_RPC_MODIFY_VOLUME capability is exposed for nFS

Verified :stuck_out_tongue_winking_eye: that it fails with this:

  I1212 12:26:38.595866 75590 pvc.go:85] PVC cephcsi-nfs-pvc Event: ProvisioningFailed - CSI driver does not support VolumeAttributesClass: controller MODIFY_VOLUME capability is not reported

nixpanic avatar Dec 12 '25 12:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34

nixpanic avatar Dec 12 '25 12:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34

nixpanic avatar Dec 12 '25 12:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34

nixpanic avatar Dec 12 '25 13:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34/cephfs

nixpanic avatar Dec 16 '25 08:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34/cephfs

nixpanic avatar Dec 16 '25 15:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34/cephfs

nixpanic avatar Dec 17 '25 09:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34/cephfs

nixpanic avatar Dec 17 '25 12:12 nixpanic

Still trying to use the old nfs-server:

  Warning  FailedMount  8s (x13 over 10m)  kubelet            MountVolume.SetUp failed for volume "pvc-c64d91d7-9097-46f3-9594-eb993e5851b7" : rpc error: code = Internal desc = nfs: failed to mount "relocated.example.net:/0001-0024-e044d94f-5dfb-4f7b-a7e6-44895f196074-0000000000000001-38cbb13b-1f15-4a9b-80ff-3017574691a1" to "/var/lib/kubelet/pods/4ebe7989-0889-4af1-b138-48c67a90debd/volumes/kubernetes.io~csi/pvc-c64d91d7-9097-46f3-9594-eb993e5851b7/mount" : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs relocated.example.net:/0001-0024-e044d94f-5dfb-4f7b-a7e6-44895f196074-0000000000000001-38cbb13b-1f15-4a9b-80ff-3017574691a1 /var/lib/kubelet/pods/4ebe7989-0889-4af1-b138-48c67a90debd/volumes/kubernetes.io~csi/pvc-c64d91d7-9097-46f3-9594-eb993e5851b7/mount
Output: mount.nfs: Failed to resolve server relocated.example.net: Name or service not known
 stderr: ""

nixpanic avatar Dec 19 '25 13:12 nixpanic

It seems I missed handling of mutable_parameters in CreateVolume CSI procedure.

nixpanic avatar Dec 19 '25 13:12 nixpanic

/test ci/centos/mini-e2e/k8s-1.34/cephfs

nixpanic avatar Dec 19 '25 15:12 nixpanic