acs-engine icon indicating copy to clipboard operation
acs-engine copied to clipboard

Cluster cannot mount disks into pods

Open JonathanFraser opened this issue 9 years ago • 17 comments

New kubernetes cluster '1.6.2' spun up with current head cannot mount disks or pull from azure container registries.

With regards to the disks kubernetes presents the following errors:

 FirstSeen	LastSeen	Count	From					SubObjectPath	Type		Reason		Message
  ---------	--------	-----	----					-------------	--------	------		-------
  3h		1m		102	{kubelet k8s-agentpri-1494544825-0}			Warning		FailedMount	MountVolume.SetUp failed for volume "kubernetes.io/azure-disk/423d48f9-373e-11e7-82e9-000d3af7400c-pvc-2254e86c-36a2-11e7-82e8-000d3af7400c" (spec.Name: "pvc-2254e86c-36a2-11e7-82e8-000d3af7400c") pod "423d48f9-373e-11e7-82e9-000d3af7400c" (UID: "423d48f9-373e-11e7-82e9-000d3af7400c") with: mount failed: exit status 32
Mounting command: mount
Mounting arguments: /var/lib/kubelet/plugins/kubernetes.io/azure-disk/mounts/pach147a-dynamic-pvc-2254e86c-36a2-11e7-82e8-000d3af7400c.vhd /var/lib/kubelet/pods/423d48f9-373e-11e7-82e9-000d3af7400c/volumes/kubernetes.io~azure-disk/pvc-2254e86c-36a2-11e7-82e8-000d3af7400c  [bind]
Output: mount: special device /var/lib/kubelet/plugins/kubernetes.io/azure-disk/mounts/pach147a-dynamic-pvc-2254e86c-36a2-11e7-82e8-000d3af7400c.vhd does not exist


  3h	48s	87	{kubelet k8s-agentpri-1494544825-0}		Warning	FailedMount	Unable to mount volumes for pod "etcd-0_default(423d48f9-373e-11e7-82e9-000d3af7400c)": timeout expired waiting for volumes to attach/mount for pod "default"/"etcd-0". list of unattached/unmounted volumes=[etcd-storage]
  3h	48s	87	{kubelet k8s-agentpri-1494544825-0}		Warning	FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "default"/"etcd-0". list of unattached/unmounted volumes=[etcd-storage]

Inspection of the agent node provides the following:

[  652.807603] sd 5:0:0:0: Attached scsi generic sg3 type 0
[  652.808904] sd 5:0:0:0: [sdc] 419430400 512-byte logical blocks: (215 GB/200 GiB)
[  652.809404] sd 5:0:0:0: [sdc] Write Protect is off
[  652.809407] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00
[  652.809438] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
[  652.818483] sd 5:0:0:0: [sdc] Attached SCSI disk
[  652.905648] sd 5:0:0:0: [storvsc] Sense Key : Illegal Request [current] 
[  652.905653] sd 5:0:0:0: [storvsc] Add. Sense: Invalid command operation code
[  652.905717] sd 5:0:0:0: [storvsc] Sense Key : Illegal Request [current] 
[  652.905718] sd 5:0:0:0: [storvsc] Add. Sense: Invalid command operation code

It appears the VHD is provisioned and attached to the agent, however it fails to mount in the container.

JonathanFraser avatar May 12 '17 21:05 JonathanFraser

This is a known issue we are looking into. @lachie83 is heading that. 1.5.3 is working today and 1.5.7 should also be working.

JackQuincy avatar May 12 '17 21:05 JackQuincy

Also this is an upstream issue can you also file an issue on kubernetes/kubernetes and link it here.

JackQuincy avatar May 12 '17 21:05 JackQuincy

kubernetes core issue: kubernetes/kubernetes#45750

JonathanFraser avatar May 12 '17 21:05 JonathanFraser

issues also seems to be present in 1.5.7

JonathanFraser avatar May 12 '17 22:05 JonathanFraser

issue also present in 1.5.3 as we have successfully spun up clusters for 1.5.3 I suspect the issue is either in the underlying os as determined by the acs-engine or due to changes in azure itself.

JonathanFraser avatar May 13 '17 00:05 JonathanFraser

This PR contains the regression https://github.com/Azure/acs-engine/pull/581. The cloud provider and cloud config need to be set.

lachie83 avatar May 13 '17 00:05 lachie83

Issue fixed in #626

anhowe avatar May 16 '17 16:05 anhowe

This is happening again in current master with k8s 1.8.3 and 2 agentpools

jalberto avatar Oct 20 '17 09:10 jalberto

@jalberto also in 1.7. I've tried using tectonic and acs-engine to set up my Azure K8S clusters, both have really hard time with azure-disk.

tlyng avatar Oct 20 '17 11:10 tlyng

@tlyng it works for me using acs-engine 0.7, k8s 1.7 but only one agentpool

jalberto avatar Oct 20 '17 13:10 jalberto

having same problem with 1.7.7

[ 1326.369298] sd 3:0:0:0: [sdc] 20971520 512-byte logical blocks: (10.7 GB/10.0 GiB)
[ 1326.369300] sd 3:0:0:0: [sdc] 4096-byte physical blocks
[ 1326.369320] sd 3:0:0:0: [sdc] Write Protect is off
[ 1326.369321] sd 3:0:0:0: [sdc] Mode Sense: 0f 00 10 00
[ 1326.369869] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA
[ 1326.501879] sd 3:0:0:0: [sdc] Attached SCSI disk
[ 1326.713187] sd 3:0:0:0: [storvsc] Sense Key : Illegal Request [current] 
[ 1326.713189] sd 3:0:0:0: [storvsc] Add. Sense: Invalid command operation code
[ 1326.713255] sd 3:0:0:0: [storvsc] Sense Key : Illegal Request [current] 
[ 1326.713256] sd 3:0:0:0: [storvsc] Add. Sense: Invalid command operation code

@anhowe must this issue be reopen or create a new one?

jalberto avatar Oct 20 '17 16:10 jalberto

@jalberto I would like to take a look, could you provide following log:

kubectl describe pod PODNAME

it's better if you could file a new issue in https://github.com/kubernetes/kubernetes/

andyzhangx avatar Nov 09 '17 14:11 andyzhangx

sorry @andyzhangx currently not using same cluster

jalberto avatar Nov 09 '17 14:11 jalberto

Installed new 1.8.2 Cluster with latest ACS-engine 0.9.x release, running also in the same error. Did an upgrade from 1.8.1 to 1.8.2, Claims working fine....

mcops avatar Nov 10 '17 15:11 mcops

@mcops could share the details info, like os version kubectl describe pvc PVCNAME kubectl describe pod PODNAME

andyzhangx avatar Nov 11 '17 01:11 andyzhangx

Having the same issue on 1.6.13

ubuntu@bastion:~/src$ kubectl -n mgmt describe pvc
Name:           pvc-azuredisk
Namespace:      mgmt
StorageClass:   hdd
Status:         Bound
Volume:         pvc-b39bf0a7-fbc8-11e7-a64f-000d3ae0e28e
Labels:         <none>
Annotations:    pv.kubernetes.io/bind-completed=yes
                pv.kubernetes.io/bound-by-controller=yes
                volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/azure-disk
Capacity:       5Gi
Access Modes:   RWO
Events:
  FirstSeen     LastSeen        Count   From                            SubObjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  44m           44m             1       persistentvolume-controller                     Normal          ProvisioningSucceeded   Successfully provisioned volume pvc-b39bf0a7-fbc8-11e7-a64f-000d3ae0e28e using kubernetes.io/azure-disk


Name:           zinc-mink-prometheus-server
Namespace:      mgmt
StorageClass:   default
Status:         Bound
Volume:         pvc-cd08b874-fbc0-11e7-9ba8-000d3ae0e639
Labels:         app=prometheus
Annotations:    kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"labels":{"app":"prometheus"},"name":"zinc-mink-prometheus-server","name...
                pv.kubernetes.io/bind-completed=yes
                pv.kubernetes.io/bound-by-controller=yes
                volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/azure-disk
Capacity:       8Gi
Access Modes:   RWO
Events:         <none>
ubuntu@bastion:~/src$ kubectl -n mgmt describe pod
Name:           nginx-azuredisk
Namespace:      mgmt
Node:           k8s-agentpool1-16123343-2/172.24.0.66
Start Time:     Wed, 17 Jan 2018 20:55:22 +0000
Labels:         <none>
Annotations:    <none>
Status:         Pending
IP:
Controllers:    <none>
Containers:
  nginx-azuredisk:
    Container ID:
    Image:              nginx
    Image ID:
    Port:
    Command:
      /bin/sh
      -c
      while true; do echo $(date) >> /mnt/disk/outfile; sleep 1; done
    State:              Waiting
      Reason:           ContainerCreating
    Ready:              False
    Restart Count:      0
    Environment:        <none>
    Mounts:
      /mnt/disk from disk01 (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-spz70 (ro)
Conditions:
  Type          Status
  Initialized   True
  Ready         False
  PodScheduled  True
Volumes:
  disk01:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  pvc-azuredisk
    ReadOnly:   false
  default-token-spz70:
    Type:       Secret (a volume populated by a Secret)
    SecretName: default-token-spz70
    Optional:   false
QoS Class:      BestEffort
Node-Selectors: <none>
Tolerations:    <none>
Events:
  FirstSeen     LastSeen        Count   From                                    SubObjectPath   Type            Reason          Message
  ---------     --------        -----   ----                                    -------------   --------        ------          -------
  44m           44m             1       default-scheduler                                       Normal          Scheduled       Successfully assigned nginx-azuredisk to k8s-agentpool1-16123343-2
  42m           1m              28      kubelet, k8s-agentpool1-16123343-2                      Warning         FailedMount     MountVolume.MountDevice failed for volume "kubernetes.io/azure-disk/acme-k8s-prod-dynamic-pvc-b39bf0a7-fbc8-11e7-a64f-000d3ae0e28e.vhd" (spec.Name: "pvc-b39bf0a7-fbc8-11e7-a64f-000d3ae0e28e") pod "bbd79be6-fbc8-11e7-9ba8-000d3ae0e639" (UID: "bbd79be6-fbc8-11e7-9ba8-000d3ae0e639") with: exit status 1
  42m           40s             20      kubelet, k8s-agentpool1-16123343-2                      Warning         FailedMount     Unable to mount volumes for pod "nginx-azuredisk_mgmt(bbd79be6-fbc8-11e7-9ba8-000d3ae0e639)": timeout expired waiting for volumes to attach/mount for pod "mgmt"/"nginx-azuredisk". list of unattached/unmounted volumes=[disk01]
  42m           40s             20      kubelet, k8s-agentpool1-16123343-2                      Warning         FailedSync      Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "mgmt"/"nginx-azuredisk". list of unattached/unmounted volumes=[disk01]


Name:           task-pv-pod
Namespace:      mgmt
Node:           k8s-agentpool1-16123343-0/172.24.0.4
Start Time:     Wed, 17 Jan 2018 20:09:38 +0000
Labels:         <none>
Annotations:    kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"name":"task-pv-pod","namespace":"mgmt"},"spec":{"containers":[{"image":"nginx","name":"ta...
Status:         Pending
IP:
Controllers:    <none>
Containers:
  task-pv-container:
    Container ID:
    Image:              nginx
    Image ID:
    Port:               80/TCP
    State:              Waiting
      Reason:           ContainerCreating
    Ready:              False
    Restart Count:      0
    Environment:        <none>
    Mounts:
      /usr/share/nginx/html from task-pv-storage (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-spz70 (ro)
Conditions:
  Type          Status
  Initialized   True
  Ready         False
  PodScheduled  True
Volumes:
  task-pv-storage:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  zinc-mink-prometheus-server
    ReadOnly:   false
  default-token-spz70:
    Type:       Secret (a volume populated by a Secret)
    SecretName: default-token-spz70
    Optional:   false
QoS Class:      BestEffort
Node-Selectors: <none>
Tolerations:    <none>
Events:
  FirstSeen     LastSeen        Count   From                                    SubObjectPath   Type            Reason          Message
  ---------     --------        -----   ----                                    -------------   --------        ------          -------
  1h            49m             27      kubelet, k8s-agentpool1-16123343-0                      Warning         FailedMount     MountVolume.MountDevice failed for volume "kubernetes.io/azure-disk/acme-k8s-prod-dynamic-pvc-cd08b874-fbc0-11e7-9ba8-000d3ae0e639.vhd" (spec.Name: "pvc-cd08b874-fbc0-11e7-9ba8-000d3ae0e639") pod "583b0cbc-fbc2-11e7-a6b3-000d3ae0eede" (UID: "583b0cbc-fbc2-11e7-a6b3-000d3ae0eede") with: exit status 1
  1h            48m             19      kubelet, k8s-agentpool1-16123343-0                      Warning         FailedMount     Unable to mount volumes for pod "task-pv-pod_mgmt(583b0cbc-fbc2-11e7-a6b3-000d3ae0eede)": timeout expired waiting for volumes to attach/mount for pod "mgmt"/"task-pv-pod". list of unattached/unmounted volumes=[task-pv-storage]
  1h            48m             19      kubelet, k8s-agentpool1-16123343-0                      Warning         FailedSync      Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "mgmt"/"task-pv-pod". list of unattached/unmounted volumes=[task-pv-storage]
  46m           1m              30      kubelet, k8s-agentpool1-16123343-0                      Warning         FailedMount     MountVolume.MountDevice failed for volume "kubernetes.io/azure-disk/acme-k8s-prod-dynamic-pvc-cd08b874-fbc0-11e7-9ba8-000d3ae0e639.vhd" (spec.Name: "pvc-cd08b874-fbc0-11e7-9ba8-000d3ae0e639") pod "583b0cbc-fbc2-11e7-a6b3-000d3ae0eede" (UID: "583b0cbc-fbc2-11e7-a6b3-000d3ae0eede") with: exit status 1
  45m           47s             21      kubelet, k8s-agentpool1-16123343-0                      Warning         FailedMount     Unable to mount volumes for pod "task-pv-pod_mgmt(583b0cbc-fbc2-11e7-a6b3-000d3ae0eede)": timeout expired waiting for volumes to attach/mount for pod "mgmt"/"task-pv-pod". list of unattached/unmounted volumes=[task-pv-storage]
  45m           47s             21      kubelet, k8s-agentpool1-16123343-0                      Warning         FailedSync      Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "mgmt"/"task-pv-pod". list of unattached/unmounted volumes=[task-pv-storage]
ubuntu@bastion:~/src$

mpluhar avatar Jan 17 '18 21:01 mpluhar

@mpluhar the logs provided does not have sufficient info, could you follow this guide to get kubelet logs on k8s-agentpool1-16123343-0 and k8s-agentpool1-16123343-2 ? Thanks.

andyzhangx avatar Jan 23 '18 14:01 andyzhangx