Skip to content
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

ListVolumes API doesn't list the volumes that are created in an external resource group #632

Closed
nearora-msft opened this issue Dec 18, 2020 · 3 comments · Fixed by #725
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@nearora-msft
Copy link
Contributor

What happened:
ListVolumes API doesn't list the volumes that are created in a different resource group

What you expected to happen:
ListVolumes API should list all the disks that are attached to the nodes in a resource group

How to reproduce it:

Anything else we need to know?:
With azuredisk csi driver, disks might get created in different resource groups. The current implementation of ListVolumes(#618) only supports the default case when the disks are created in the current resource group

Environment:

  • CSI Driver version:
  • Kubernetes version (use kubectl version):
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:
@nearora-msft nearora-msft changed the title ListVolumes API doesn't list the volumes that are created in a different resource group ListVolumes API doesn't list the volumes that are created in an external resource group Dec 18, 2020
@andyzhangx andyzhangx added the kind/bug Categorizes issue or PR as related to a bug. label Jan 11, 2021
@andyzhangx
Copy link
Member

andyzhangx commented Jan 11, 2021

use d.cloud.KubeClient.CoreV1().PersistentVolumes() to get all PV info and then get all diskURI from pv.csi.volumeid and then get disk.ManagedBy, that would provide complete disk list, could refer to:

this would require much more work, while it could list all disks this cluster is using, otherwise it could not cover all disks and may provide incomplete disk list, not sure what would happen if disk list is incomplete.

#618 (comment)

And we could still leverage original cloud.DisksClient.ListByResourceGroup API to get disk's ManagedBy property in batch.

@andyzhangx andyzhangx added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 11, 2021
@andyzhangx
Copy link
Member

the above proposal would introduce d.cloud.KubeClient dependency, if user's cluster does not set kubeconfig, then it could fall back to use original ListVolumes way, that would be robust

@sunpa93
Copy link
Contributor

sunpa93 commented Jan 12, 2021

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
3 participants