rancher: Unable to provision Azure Disk with Azure node driver and azure cloud provider

What kind of request is this (question/bug/enhancement/feature request): Bug

Steps to reproduce (least amount of steps as possible):

Create a pvc with azure disk storage class set. pvc deplyoment:

kind: PersistentVolumeClaim

apiVersion: v1

metadata:

  name: pvc-test

  namespace: test

  labels:

    app: test

spec:

  accessModes:

    - "ReadWriteOnce"

  resources:

    requests:

      storage: "100Gi"

Result: kubectl get pvc: NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE pvc-test Pending azure-disk-storage 31m

kubectl describe pvc test: Warning ProvisioningFailed 59s (x32 over 31m) persistentvolume-controller Error creating provisioned PV object for claim pvc-test: persistentvolumes “pvc-ad62bf5a-508f-11e9-ae0a-000d3a2fcc18” is forbidden: error querying AzureDisk volume kubernetes-dynamic-pvc-XXXXXXXXXXXXXX: invalid disk URI: https://XXXXXXXXXXXXXXXXXXXX.blob.core.windows.net/vhds/kubernetes-dynamic-pvc-XXXXXXXXXXXXXXXX.vhd. Deleting the volume.

Other details that may be helpful:

  • The pv gets created in the storage-group for dynamic pv of the cluster.
  • Works perfectly in rancher 2.1.7

Environment information

  • Rancher version (rancher/rancher/rancher/server image tag or shown bottom left in the UI):2.2
  • Installation option (single install/HA):HA

Cluster information

  • Cluster type (Hosted/Infrastructure Provider/Custom/Imported):
  • Machine type (cloud/VM/metal) and specifications (CPU/memory):
  • Kubernetes version (use kubectl version):
(paste the output here)
  • Docker version (use docker version): 18.09
(paste the output here)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 20 (8 by maintainers)

Most upvoted comments

rancher/rancher:master 5/14

  • Creating a PV from Storage Class for Azure dedicated disk works correctly
  • Creating a PV from Storage Class for Azure shared disk does not work

To reproduce

  • Deploy Rancher
  • Create Azure cluster w/ cloud provider
  • Create a storage class of type Azure Disk - Shared (Unmanaged)
  • Create a workload with a new PV from Storage Class

Workload does not provision and an error is shown: Pod has unbound immediate PersistentVolumeClaims (repeated 2 times)

The persistent volume is not created, though there is a claim.

Any update on this issue? We also noticed that the nodes created by the Azure Driver does not use managed disks.

Related: #20315

Storage type must be set in storage account setup for Azure Shared (unmanaged) disk to work in k8s versions > 1.11.x

That’s correct @davidnuzik, The controller we removed (which has been deprecated in K8s, PersistentVolumeLabel) is related to get information about Labels and Zones. And I think path is different for managed vs unmanaged disks.

We have the same issue. It was working with Rancher 2.1.x and with 2.2.x it’s broken. Tested Rancher 2.2.2 with azure cluster and kubernetes version 1.13.x and 1.12.x same issue. What i saw in the log is that the uri format changed.

// get resource group name from a managed disk URI, e.g. return {group-name} according to
// /subscriptions/{sub-id}/resourcegroups/{group-name}/providers/microsoft.compute/disks/{disk-id}
// according to https://docs.microsoft.com/en-us/rest/api/compute/disks/get

https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/azure/azure_managedDiskController.go#L263

The kube-controller-manager shows following uri in the log:

 Error creating provisioned PV object for claim default/test: persistentvolumes "pvc-{uuid}" is forbidden: error querying AzureDisk volume kubernetes-dynamic-pvc-{uuid}: invalid disk URI: https://{id}.blob.core.windows.net/vhds/kubernetes-dynamic-pvc-{uuid}.vhd. Deleting the volume.