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

iscsi storage plugin only logs out of primary portal #45394

Closed
tobad357 opened this issue May 5, 2017 · 8 comments · Fixed by #46239
Closed

iscsi storage plugin only logs out of primary portal #45394

tobad357 opened this issue May 5, 2017 · 8 comments · Fixed by #46239
Labels
sig/storage Categorizes an issue or PR as relevant to SIG Storage.

Comments

@tobad357
Copy link
Contributor

tobad357 commented May 5, 2017

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): iscsi


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG

Kubernetes version (use kubectl version): v1.6.0

Environment:

  • Cloud provider or hardware configuration: Bare metal
  • OS (e.g. from /etc/os-release): Centos 7.3
  • Kernel (e.g. uname -a): Linux srv02 3.10.0-514.2.2.el7.x86_64 Unit test coverage in Kubelet is lousy. (~30%) #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools: kubeadm
  • Others:

What happened:
When using iscsi storage with multiple target portal (TP) addresses + multipathing the volume manager
logs on to the IQN for all portal addresses, but when a pod gets destroyed the volume manager only logs out for the primary TP. This leaves a session dangling and the pod using the volume can't start as the SAN doesn't allow multiple hosts to connect to the same IQN

What you expected to happen:
The DetachDisk method in iscsi_utils.go should do the same as the AttachDisk which is to
iterate over all portals and log out from all of them.
Alternatively omit the -p command line to iscsiadm to log out all references to the IQN

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

  1. Create a pod with iscsi storage and list two portals in the portals property
  2. Let the pod start
  3. Delete the pod and make sure it comes up on a new node
  4. You should now see a session still active on the old node against the second TP

Anything else we need to know:

@tobad357
Copy link
Contributor Author

tobad357 commented May 5, 2017

@humblec Want me to fix this or is there other work in the pipeline?

@mleklund
Copy link

mleklund commented May 18, 2017

I am also seeing this issue. Although in my case I am not using the multiple target addresses, but my iscsi equipment (equallogic) load balances you to another portal ip.

 iscsiadm -m session -P 1
Target: iqn.2001-05.com.equallogic:0-1cb196-6bc1ed52b-fa27a36c2af591cb-kubetesting (non-flash)
	Current Portal: X.X.X.10:3260,1
	Persistent Portal: X.X.X.2:3260,1
		**********
		Interface:
		**********
		Iface Name: eno3
		Iface Transport: tcp
		Iface Initiatorname: iqn.1993-08.org.debian:01:922ec832967e
		Iface IPaddress: X.X.X.115
		Iface HWaddress: <empty>
		Iface Netdev: eno3
		SID: 17
		iSCSI Connection State: LOGGED IN
		iSCSI Session State: LOGGED_IN
		Internal iscsid Session State: NO CHANGE

@mtanino
Copy link

mtanino commented May 19, 2017

I also hit this problem. I have a plan to post a fix.

@mtanino
Copy link

mtanino commented May 21, 2017

/cc @msau42 @jingxu97
/cc @kubernetes/sig-storage-bugs

Could you add sig/storage and king/bug labels to this issue?
Thanks,

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label May 21, 2017
@k8s-ci-robot
Copy link
Contributor

@mtanino: Reiterating the mentions to trigger a notification:
@kubernetes/sig-storage-bugs.

In response to this:

/cc @msau42 @jingxu97
/cc @kubernetes/sig-storage-bugs

Could you add sig/storage and king/bug labels to this issue?
Thanks,

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@jsafrane
Copy link
Member

@rootfs, PTAL

@rootfs
Copy link
Contributor

rootfs commented May 23, 2017

@tobad357 Will review #46239 once it is ready.

/cc @humblec

@mtanino
Copy link

mtanino commented May 23, 2017

@rootfs

Thanks. I'll add test cases into #46239, then I will remove the WIP.

mtanino pushed a commit to mtanino/kubernetes that referenced this issue May 31, 2017
When using iscsi storage with multiple target portal (TP)
addresses and multipathing the volume manager logs on to
the IQN for all portal addresses, but when a pod gets
destroyed the volume manager only logs out for the primary
TP and sessions for another TPs are always remained.

This patch adds methods to store and load iscsi disk
configrations, then uses the stored config at DetachDisk
path.

Fix kubernetes#45394
k8s-github-robot pushed a commit that referenced this issue Jun 3, 2017
Automatic merge from submit-queue

Log out from multiple target portals when using iscsi storage plugin

**What this PR does / why we need it**:

When using iscsi storage with multiple target portal (TP) addresses
and multipathing the volume manager logs on to the IQN for all
portal addresses, but when a pod gets destroyed the volume manager
only logs out for the primary TP and sessions for another TPs are
always remained.

This patch adds mount points for all TPs, and then log out from all
TPs when a pod is destroyed. If a TP is referred from another pods,
the connection will be remained as usual.



**Which issue this PR fixes** 
fixes #45394

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
mtanino pushed a commit to mtanino/kubernetes that referenced this issue Jun 5, 2017
When using iscsi storage with multiple target portal (TP)
addresses and multipathing the volume manager logs on to
the IQN for all portal addresses, but when a pod gets
destroyed the volume manager only logs out for the primary
TP and sessions for another TPs are always remained.

This patch adds methods to store and load iscsi disk
configrations, then uses the stored config at DetachDisk
path.

Fix kubernetes#45394
mrIncompetent pushed a commit to kubermatic/kubernetes that referenced this issue Jun 6, 2017
When using iscsi storage with multiple target portal (TP)
addresses and multipathing the volume manager logs on to
the IQN for all portal addresses, but when a pod gets
destroyed the volume manager only logs out for the primary
TP and sessions for another TPs are always remained.

This patch adds methods to store and load iscsi disk
configrations, then uses the stored config at DetachDisk
path.

Fix kubernetes#45394
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/storage Categorizes an issue or PR as relevant to SIG Storage.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants