-
Notifications
You must be signed in to change notification settings - Fork 31
Attaching and deleting volumes seems fuzzy #500
Comments
/sig vmware |
When Pod is deleted, we should not see disk deletion attempts in VC tasks. Disk should be detached and re-attached to another node, if new pod is provisioned on different node vm. If pod is in the running state, and we delete the PVC, then this is expected. Kubernetes will keep re-trying deleting PV, but since PV is already attached to the node vm and is in use, disk can not be deleted. How is the pod provisioned? If you can shared yamls, and sequence of steps we can try to reproduce it here to help debug this issue. |
Hi @divyenpatel, of course I can :) Btw - the yamls are working, had to remove sensitive data a.s.o. So, this is my example pod:kind: Deployment
This is my storageclass: This is the PersistenVolumeClaim:kind: PersistentVolumeClaim This creates this pvc: Here is a view of the vsphere logs: Here is the pv: So far, so fine. Now I delete the pod with "kubectl delete pod", and get this: When I do a "describe pod": Normal Scheduled 1m default-scheduler Successfully assigned nfs-server-for-testpods-57d466bbbc-xqp7m to "the other machines host name" And then we wait...like forever :) Kind regards, David |
Is this disk already attached to some other VM, which is powered on? Based on the error message: |
@divyenpatel - sure, but isn’t that the point? I mean a pod breaks, gets rescheduled, then the disk should be reattached, the bug you mentioned in the KB is happening, but shouldn’t it work with the VSphere storage provider code like this? We checked this with a colleague, actually it looks like the k8s api is making calls to vsphere to reattach a disk, but the disk is still in use because it hasn’t been detached correctly. This is what I mean by fuzzy :) |
@frapposelli @divyenpatel we're also hitting this in prod.
What should happen is:
Is this easily fixable / could you show us the relevant code? |
I don’t know if I mentioned that, but we also wait like 10-15 minutes until a pod finally gets its disk |
@nikopen @dgabrysch Here is my observation. Created Storage Class and Pod and PVC using following YAMLs
Tasks observed on vcenter. We can see Disk got created and pod scheduled on
After Pod is up and running. I deleted the Pod.
New Pod deployment is initiated and this time pod got provisioned on
I see couple of failed attempt to attach volume to This is because disk is already attached to node VM - Events on the new pod
I am observing few seconds of delay and not 10 to 15 minutes. |
Thank you for the detailed repro-attempt @divyenpatel ! Would you say that the delay we encounter is because of the initial VM being generally unresponsive and unable to release the VMDK because of that? And that the cloud controller code already handles volume movements like other cloud controllers? @dgabrysch can you also attempt to repro the issue? |
@divyenpatel @dgabrysch What I tried: any normal pod with a volume attached:
This should mirror a hard eviction event, by force killing the container and rescheduling it to another node. The events from kube-controller-manager about 20 seconds after the eviction:
It essentially took around 1 minute to fully reschedule, with the initial node being responsive (just cordoned). |
However, the bug is the following:
That node will 'unfreeze' only when the volume becomes available and is attached to the new node. The rescheduled pod might get stuck in a 'scheduling->eviction->scheduling' loop as the new node is 'notready'/frozen. It generally depends on how much load the cluster has, but even in a dormant situation it gives at least 1 minute of freezing. This is the bug we're hitting. Can you confirm it @divyenpatel ? |
Is #502 related/dupe? |
seems like it :) |
Fixed with kubernetes#67825 , this can be closed |
@divyenpatel , #500 (comment) in you showed that vmware quickly gives up reattaching disk, whole operation is just 1 seconds, but in our (and others) case operation was taking 25 seconds before failing, during that time original VM is frozen, in some cases it is long enough for kernel start taking CPU offline, which triggers VM restart by VSphere Although main bug is found and fixed, there is clearly a difference in the VSphere setup you have and the rest of us, something which probably let the bug slip in the first place. Do you have any information, why in your case attach operation fails fast, without causing collateral damage? |
/kind bug
What happened:
Using vsphere as cloud provider, we created a storageclass and use PersistenVolumeClaims.
VMDKs get created and attached to machines - but when a pod dies, it takes like 5-15 minutes to attach the disk to another VM. The k8s API - or the volume plugin tries to attach a disk when it is still attached to another machine, same for deletion: The volume plugin tries to delete a disk subjectively a million times, this causes error showing in the VSphere console.
Is this normal?
What you expected to happen:
No errors in VSphere
How to reproduce it (as minimally and precisely as possible):
Simply kill a pod using a volume or delete a deployment
Anything else we need to know?:
Environment:
Kubernetes version:
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.9", GitCommit:"57729ea3d9a1b75f3fc7bbbadc597ba707d47c8a", GitTreeState:"clean", BuildDate:"2018-06-29T01:14:35Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.9", GitCommit:"57729ea3d9a1b75f3fc7bbbadc597ba707d47c8a", GitTreeState:"clean", BuildDate:"2018-06-29T01:07:01Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Cloud provider or hardware configuration:
VSphere
OS:
NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.4"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.4 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.4"
Kernel:
Linux lx-k8s-x01 3.10.0-693.11.6.el7.x86_64 WIP: Address lack of support within Kubernetes to consume vSphere managed storage #1 SMP Thu Dec 28 14:23:39 EST 2017 x86_64 x86_64 x86_64 GNU/Linux
Install tools:
kubeadm
The text was updated successfully, but these errors were encountered: