Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openstack: Forcibly detach an attached cinder volume before attaching elsewhere #39055

Merged
merged 1 commit into from Dec 28, 2016

Conversation

anguslees
Copy link
Member

Fixes #33288

What this PR does / why we need it:
Without this fix, we can't preemptively reschedule pods with persistent volumes to other hosts (for rebalancing or hardware failure recovery).

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #33288

Special notes for your reviewer:
(This is a resurrection/cleanup of PR #33734, originally authored by @Rotwang)

Release note:

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.


If you have questions or suggestions related to this bot's behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 21, 2016
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 21, 2016
@anguslees anguslees changed the title Forcibly detach an attached volume before attaching elsewhere openstack: Forcibly detach an attached cinder volume before attaching elsewhere Dec 21, 2016
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Dec 21, 2016
@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GKE smoke e2e failed for commit 19efce6e3acc3e8c54ff9e9aed9908cede2b257b. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@thockin thockin added lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Dec 27, 2016
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 39152, 39142, 39055)

@k8s-github-robot k8s-github-robot merged commit d4bf500 into kubernetes:master Dec 28, 2016
DukeXar pushed a commit to DukeXar/kubernetes that referenced this pull request Jan 7, 2017
Automatic merge from submit-queue (batch tested with PRs 39152, 39142, 39055)

openstack: Forcibly detach an attached cinder volume before attaching elsewhere

Fixes kubernetes#33288

**What this PR does / why we need it**:
Without this fix, we can't preemptively reschedule pods with persistent volumes to other hosts (for rebalancing or hardware failure recovery).

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes#33288

**Special notes for your reviewer**:
(This is a resurrection/cleanup of PR kubernetes#33734, originally authored by @Rotwang)

**Release note**:
@xrl
Copy link

xrl commented Jan 19, 2017

How will this get moved in to a kubernetes release? I'm not familiar with the release process. @thockin @anguslees

@mikebryant
Copy link
Contributor

We're finding this issue is a big problem for us on 1.5.2 - any chance of a cherry-pick to the 1.5 series?

@codablock
Copy link
Contributor

Cherry picking this one should probably depend on cherry picking #39791 (comment) as well, as otherwise #39791 might hit you here.

}

glog.V(2).Infof("Disk %q is attached to a different compute (%q), detaching", diskName, disk.Attachments[0]["server_id"])
err = os.DetachDisk(fmt.Sprintf("%s", disk.Attachments[0]["server_id"]), diskName)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with the release process here but 100% agreed with @codablock that this should not be pulled into mainline kube in its current state. For an example, lets say you're doing a kubectl delete on a webserver that's mid transaction. My expected behavior would be for the volume to be available until my pod fully exits, so the server can complete its final set of transactions. With this patch it would lose access to its volumes the instant a new pod gets scheduled which could cause data loss.

I'd imagine there should be a check to the kube API before this detach call to verify that the volume is not in use by any active pods. If this check was added kube would simply keep retrying until the volume isn't in use, at which point it would detach and continue.

@xmik
Copy link

xmik commented Apr 9, 2017

It seems it was released in v1.6.0-alpha.1

dims pushed a commit to dims/kubernetes that referenced this pull request Feb 8, 2018
Automatic merge from submit-queue (batch tested with PRs 39152, 39142, 39055)

openstack: Forcibly detach an attached cinder volume before attaching elsewhere

Fixes kubernetes#33288



**What this PR does / why we need it**:
Without this fix, we can't preemptively reschedule pods with persistent volumes to other hosts (for rebalancing or hardware failure recovery).

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes#33288

**Special notes for your reviewer**:
(This is a resurrection/cleanup of PR kubernetes#33734, originally authored by @Rotwang)

**Release note**:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Openstack cinder volumes not detached from downed vm when pod is rescheduled to another node.
10 participants