<p>I have tectonic kubernetes cluster installed on Azure. It's made from tectonic-installer GH repo, from master (commit 0a7a1edb0a2eec8f3fb9e1e612a8ef1fd890c332).</p>

<pre><code>&gt; kubectl version                                                                       

Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.2", GitCommit:"922a86cfcd65915a9b2f69f3f193b8907d741d9c", GitTreeState:"clean", BuildDate:"2017-07-21T08:23:22Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.3+coreos.0", GitCommit:"42de91f04e456f7625941a6c4aaedaa69708be1b", GitTreeState:"clean", BuildDate:"2017-08-07T19:44:31Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

<p>On the cluster I created storage class, PVC and pod as in: <a href="https://gist.github.com/mwieczorek/28b7c779555d236a9756cb94109d6695" rel="nofollow noreferrer">https://gist.github.com/mwieczorek/28b7c779555d236a9756cb94109d6695</a></p>

<p>But the pod cannot start. When I run:</p>

<pre><code>kubectl describe pod mypod
</code></pre>

<p>I get in events:</p>

<pre><code>FailedMount     Unable to mount volumes for pod "mypod_default(afc68bee-88cb-11e7-a44f-000d3a28f26a)": 
timeout expired waiting for volumes to attach/mount for pod "default"/"mypod". list of unattached/unmounted volumes=[mypd]
</code></pre>

<p>In kubelet logs (<a href="https://gist.github.com/mwieczorek/900db1e10971a39942cba07e202f3c50" rel="nofollow noreferrer">https://gist.github.com/mwieczorek/900db1e10971a39942cba07e202f3c50</a>) I see:</p>

<pre><code>Error: Volume not attached according to node status for volume "pvc-61a8dc6a-88cb-11e7-ad19-000d3a28f2d3" 
(UniqueName: "kubernetes.io/azure-disk//subscriptions/abc/resourceGroups/tectonic-cluster-mwtest/providers/Microsoft.Compute/disks/kubernetes-dynamic-pvc-61a8dc6a-88cb-11e7-ad19-000d3a28f2d3") pod "mypod" (UID: "afc68bee-88cb-11e7-a44f-000d3a28f26a")
</code></pre>

<p>When I create PVC - new disc on Azure is created. 
And after creating pod - I see on the azure portal that the disc is attached to worker VM where the pod is scheduled.</p>

<pre><code>&gt; fdisk -l
</code></pre>

<p>shows:</p>

<pre><code>Disk /dev/sdc: 2 GiB, 2147483648 bytes, 4194304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
</code></pre>

<p>I found similar issue on GH ( kubernetes/kubernetes/issues/50150) but I have cluster built from master so it's not the udev rules (I checked - file /etc/udev/rules.d/66-azure-storage.rules exists)</p>

<hr>

<p>Does anybody knows if it's a bug (maybe know issue)?</p>

<p>Or am I doing something wrong?</p>

<p>Also: how can I troubleshoot that further? </p>

<p>I had test in lab, use your yaml file to create pod, after one hour, it still show pending.</p>

<pre><code>root@k8s-master-ED3DFF55-0:~# kubectl get pod
NAME          READY     STATUS    RESTARTS   AGE
mypod         0/1       Pending   0          1h
task-pv-pod   1/1       Running   0          2h
</code></pre>

<p>We can use this yaml file to create pod:</p>

<p><strong>PVC</strong>:</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mypvc
  namespace: kube-public
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Gi
</code></pre>

<p>Output:</p>

<pre><code>root@k8s-master-ED3DFF55-0:~# kubectl get pvc --namespace=kube-public
NAME      STATUS    VOLUME                                     CAPACITY   ACCESSMODES   STORAGECLASS   AGE
mypvc     Bound     pvc-1b097337-8960-11e7-82fc-000d3a191e6a   100Gi      RWO           default        3h
</code></pre>

<p><strong>Pod</strong>:</p>

<pre><code>kind: Pod
apiVersion: v1
metadata:
  name: task-pv-pod
spec:

  volumes:
    - name: task-pv-storage
      persistentVolumeClaim:
       claimName: task-pv-claim

  containers:
    - name: task-pv-container
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
      - mountPath: "/usr/share/nginx/html"
        name: task-pv-storage
</code></pre>

<p>Output:</p>

<pre><code>root@k8s-master-ED3DFF55-0:~# kubectl get pods
NAME          READY     STATUS    RESTARTS   AGE
task-pv-pod   1/1       Running   0          3h
</code></pre>

<p>As a <strong>workaround</strong>, we can use <code>default</code> as the <strong>storageclass</strong>.</p>

<p>In Azure, there are managed disk and unmanaged disk. if your nodes are use managed disk, two storage classes will be created to provide access to create Kubernetes persistent volumes using Azure managed disks.</p>

<p>They are <strong>managed-premium</strong> and <strong>managed-standard</strong> and map to <code>Standard_LRS</code> and <code>Premium_LRS</code> managed disk types respectively.</p>

<p>If your nodes are use non-managed disk, the default storage class will be used if persistent volume resources don't specify a storage class as part of the resource definition. </p>

<p>The default storage class uses non-managed blob storage and will provision the blob within an existing storage account present in the resource group or provision a new storage account.</p>

<p>Non-managed persistent volume types are available on all VM sizes.</p>

<p>More information about managed disk and non-managed disk, please refer to this <a href="https://github.com/Azure/acs-engine/blob/master/docs/kubernetes/features.md" rel="nofollow noreferrer">link</a>.</p>

<p>Here is the test result:</p>

<pre><code>root@k8s-master-ED3DFF55-0:~# kubectl get pvc --namespace=default
NAME            STATUS    VOLUME                                     CAPACITY   ACCESSMODES   STORAGECLASS       AGE
shared          Pending                                                                       standard-managed   2h
shared1         Pending                                                                       managed-standard   15m
shared12        Pending                                                                       standard-managed   14m
shared123       Bound     pvc-a379ced4-897c-11e7-82fc-000d3a191e6a   2Gi        RWO           default            12m
task-pv-claim   Bound     pvc-3cefd456-8961-11e7-82fc-000d3a191e6a   3Gi        RWO           default            3h
</code></pre>

<hr>

<p><strong>Update:</strong>
Here is my K8s agent's unmanaged disk:
<a href="https://i.stack.imgur.com/Ea9zA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ea9zA.png" alt="enter image description here"></a></p>
