vmware-archive / kubernetes-archived

This repository is archived. Please file in-tree vSphere Cloud Provider issues at https://github.com/kubernetes/kubernetes/issues . CSI Driver for vSphere is available at https://github.com/kubernetes/cloud-provider-vsphere
Apache License 2.0
46 stars 31 forks source link

Cannot complete the operation because the file or folder [Datastore1] kubevols/kubernetes-dynamic-pvc-xxxxx.vmdk already exists. #504

Open dkirrane opened 6 years ago

dkirrane commented 6 years ago

Is this a BUG REPORT or FEATURE REQUEST?: /kind bug

What happened: vSphere Web Client Recent Tasks filling up with these errors

Task Name Status
Reconfigure virtual machine Failed to add disk 'scsi0:2'
Create virtual Disk Cannot complete the operation because the file or folder [Datastore1] kubevols/kubernetes-dynamic-pvc-ca5f601a-a7a6-11e8-85c4-00505680e70a.vmdk already exists.

What you expected to happen: No errors

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?: vCenter Version 6.5.0 Build 8024368 Datastore Type VMFS 5 K8s Worker node on VMware ESXi, 5.5.0, 6480324 K8s Worker node is CentOS 7.4

Environment:

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"


- Kernel (e.g. `uname -a`):
`Linux master1-lima169 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux`
- Install tools:
`kubeadm version: &version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}`
- Others:
divyenpatel commented 6 years ago

@dkirrane Can you share YAMLs you are using to create Storage Class, PVC and PV? Are you using storagepolicyName in the StorageClass to provision PV?

gcabrerap commented 6 years ago

Hello, we have the same problem. A very simple StorageClass was created:

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: slow
provisioner: kubernetes.io/vsphere-volume
parameters:
    diskformat: thin
    fstype:     ext3

And a PVC with simple data was created:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: tester
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 1Gi
  storageClassName: slow

And when reviewing the PVC delivers the following comment:

# kubectl describe pvc tester
Name:          tester
Namespace:     default
StorageClass:  slow
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/vsphere-volume
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
Events:
  Type     Reason              Age   From                         Message
  ----     ------              ----  ----                         -------
  Warning  ProvisioningFailed  7s    persistentvolume-controller  Failed to provision volume with StorageClass "slow": No se puede completar la operación porque el archivo o la carpeta [DATASTORE-01] kubevols/k8scl-dynamic-pvc-d90c343d-bdb9-11e8-9cb4-0050569e2253.vmdk ya existen.

The Volume in the DataStore is created at the moment of executing the pvc, but for some reason it reflects that it is already created.

nelsonyaccuzzi commented 6 years ago

I have a similar problem with my kubespray deployment, and I resolve it by creating a kube-dummyDisk.vmdk in the kubevols folder. Try this

vmkfstools -c 5G –diskformat thin vmfs/volumes/<your datastore>/kubevols/kube-dummyDisk.vmdk

I think this have to do with some wrong permission privileges during the deployment of the cluster.