Skip to content

Fix config drive mount and add flag to control the search order in which the driver retrieves instance metadata#3141

Open
dgaponcic wants to merge 3 commits into
kubernetes:masterfrom
dgaponcic:manila-config-drive
Open

Fix config drive mount and add flag to control the search order in which the driver retrieves instance metadata#3141
dgaponcic wants to merge 3 commits into
kubernetes:masterfrom
dgaponcic:manila-config-drive

Conversation

@dgaponcic

@dgaponcic dgaponcic commented Jul 1, 2026

Copy link
Copy Markdown

What this PR does / why we need it:
Currently the manila csi only uses metadata service to get instance metadata, which fails when using config drive.

  • This PR adds a new flag --search-order (similar to cinder) to allow setting up the order in which the driver should try to retrieve the metadata. By default: configDrive,metadataService
  • And this PR adds the missing bits to get the config drive to work.

Which issue this PR fixes(if applicable):
fixes #3118

Special notes for reviewers:

  1. Start the node plugin without --search-order. It will use the default value of configDrive,metadataService. On a machine using metadata service, this is the output:
}
I0701 14:15:22.146174       1 driver.go:327] [ID:2] GRPC call: /csi.v1.Node/NodeGetInfo
...
I0701 14:15:22.146893       1 metadata.go:170] Attempting to mount configdrive on /tmp
I0701 14:15:22.148041       1 mount_linux.go:326] 'umount /tmp/kubelet-detect-safe-umount3371542402' failed with: exit status 1, output: umount: can't unmount /tmp/kubelet-detect-safe-umount3371542402: Invalid argument
...
E0701 14:15:22.148613       1 mount_linux.go:271] Mount failed: exit status 1


I0701 14:15:22.149110       1 metadata.go:204] Attempting to fetch metadata from http://169.254.169.254/openstack/latest/meta_data.json, ignoring proxy settings
I0701 14:15:22.288691       1 driver.go:333] [ID:2] GRPC response: {"node_id":"<node id>"}

It tried to mount the config drive, fails, and then tries the metadata service, which works.

  1. Start the node plugin with --search-order=metadataService,configDrive. On an instance using config drive, this is the output:
I0701 14:47:56.211444       1 driver.go:327] [ID:2] GRPC call: /csi.v1.Node/NodeGetInfo
I0701 14:47:56.211462       1 driver.go:328] [ID:2] GRPC request: {}
I0701 14:47:56.211486       1 metadata.go:204] Attempting to fetch metadata from http://169.254.169.254/openstack/latest/meta_data.json, ignoring proxy settings

I0701 14:48:26.212841       1 metadata.go:170] Attempting to mount configdrive /dev/disk/by-label/config-2 on /tmp
...
I0701 14:48:26.216486       1 metadata.go:182] Configdrive mounted on /tmp
I0701 14:48:26.216921       1 mount_linux.go:401] Unmounting /tmp
I0701 14:48:26.218503       1 driver.go:333] [ID:2] GRPC response: {"node_id":"<node-id>"}

It tried to use the matadata sevice, and when it didn't work, tried the config drive, which worked.

Release note:

[manila-csi-plugin] Add `--search-order` flag to control the order in which instance metadata is retrieved (configDrive, metadataService)

@kubernetes-prow kubernetes-prow Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Jul 1, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 1, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: dgaponcic / name: Diana Gaponcic (14b133e)

@kubernetes-prow

Copy link
Copy Markdown

Welcome @dgaponcic!

It looks like this is your first PR to kubernetes/cloud-provider-openstack 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-openstack has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 1, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @dgaponcic. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@kubernetes-prow

Copy link
Copy Markdown

[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 zetaab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

@kubernetes-prow kubernetes-prow Bot requested review from kayrus and zetaab July 1, 2026 14:54
@kubernetes-prow kubernetes-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 1, 2026
@gouthampacha

Copy link
Copy Markdown
Contributor

/ok-to-test

@dgaponcic - have you signed the CLA?

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 1, 2026
@dgaponcic dgaponcic force-pushed the manila-config-drive branch from 7d8c229 to 14b133e Compare July 2, 2026 07:30
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 2, 2026
@dgaponcic dgaponcic force-pushed the manila-config-drive branch from 14b133e to 70595de Compare July 2, 2026 07:33
mountPath: /var/lib/kubelet/plugins/manila.csi.openstack.org
- name: fwd-plugin-dir
mountPath: /var/lib/kubelet/plugins/FWD-NODEPLUGIN
- name: configdrive-dev

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you also adjust a corresponding helm chart template?


cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")
cmd.PersistentFlags().StringVar(&searchOrder, "search-order", "configDrive,metadataService", "The search order in which the driver retrieves metadata relating to the instance (s) in which it runs")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please adjust docs accordingly

@kayrus

kayrus commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

thanks for the PR. Please set proper Release note in your initial message.

@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jul 2, 2026
@kubernetes-prow kubernetes-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manila CSI registration failing due to non existing medata service on baremetal nodes

3 participants