Commit Graph

31 Commits (b2b079b95a867b560fd327cba56e7d3878f43dc3)

Author SHA1 Message Date
Mitsuhiro Tanino 285ac8935f iSCSi plugin: Remove redundant nil check 2017-06-15 18:00:29 -04:00
mtanino b1f06aaed5 iSCSI plugin: Update devicepath with filepath.Glob result
If iscsiTransport is not tcp, iSCSI plugin tries to
find devicepath using filepath.Glob but never updates
devicepath with the filepath.Glob result.

This patch fixes the problem.

Fixes #47253
2017-06-09 22:54:25 -04:00
mtanino 82ce37d973 bkpPortal should be initialized beforehand
This patch is a follow up patch for the PR#46239.
The bkpPortal in DetachDisk() path should be initialized
before using it.
2017-06-05 10:22:57 -04:00
mtanino aebaee39d5 Log out from multiple portals with iscsi storage plugin
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 #45394
2017-05-31 16:53:47 -04:00
Huamin Chen 8eb6d6cfa7 update iSCSI README with CHAP instruction
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-04-07 16:38:29 +00:00
Huamin Chen 9298217126 Add iSCSI CHAP authentication
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-04-07 16:38:29 +00:00
yupengzte 363f321f32 should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-03-06 09:14:48 +08:00
Cristian Pop b23b475498 Implemented suggestions for #39202 fix to facilitate kubelet upgrade. The detachDisk behavior is now preserved for pods that were created before the kubelet upgrade. 2017-02-14 22:50:26 +02:00
Cristian Pop b0d285c706 Fix for Premature iSCSI logout #39202. 2017-02-14 11:34:03 +02:00
Humble Chirammal 332e26dc8c Add portals field to iscsi volume source to achieve multipathing.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-06 17:06:33 +05:30
forrestchen 1d9f754565 no need to sleep for last retry
Signed-off-by: forrestchen <forrestchen@tencent.com>
2016-12-21 17:52:01 +08:00
Anish Bhatt 531a961a96 Check iscsi iface file for transport name 2016-07-25 18:15:25 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
tobad357 1811ded396 This is an update that allows the iscsi volume to check if a iscsi device belongs to a mpio device
If it does belong to the device then we make sure we mount the mpio device instead of
the raw device.

Heuristics
Login into /dev/disk/by-path/iqn-example.com.2999 -> /dev/sde
Check if sde existsin in /sys/block/[dm-X]/slaves/xx
If it does mount /dev/[dm-x] which will look like /dev/mapper/mpiodevicename in mount

examples/iscsi has more details
2016-04-20 09:42:11 +08:00
saadali 79012f6d53 Rename volume.Builder to Mounter and volume.Cleaner to Unmounter 2016-03-25 11:29:58 -07:00
Anish Bhatt 6e46fa1fd4 Add support for open-iscsi transports.
This enables use of software or hardware transports viz. be2iscsi,
bnx2i, cxgb3i, cxgb4i, qla4xx, iser and ocs. The default transport
(tcp) happens to be called "default".

Use of non-default transports changes the disk path to the following format:
/dev/disk/by-path/pci-<pci_id>-ip-<portal>-iscsi-<iqn>-lun-<lun_id>
2015-12-08 17:28:06 -08:00
k8s-merge-robot 13b0fd3cda Merge pull request #16942 from swagiaal/distinguish-format-and-mount
Auto commit by PR queue bot
2015-12-03 10:51:26 -08:00
Sami Wagiaalla 66c905d63e Distinguish normal mount from format and mount in SafeFormatAndMount 2015-12-02 11:16:00 -05:00
Anish Bhatt 18c82f743c Support iqn as well as eui format for iSCSI entity names.
Supported formats are :
iqn.<date code>.<reversed domain>[:<optional suffix>]

eui.<eui-64 identifier>
2015-11-24 00:13:59 -08:00
Huamin Chen 9ca96abd46 iscsi: use global path to retrieve iscsi portal and iqn
Signed-off-by: Huamin Chen <hchen@redhat.com>
2015-10-14 09:48:07 -04:00
Anish Bhatt 6d9e9561e8 Fix extraneous entries in iscsi path format
Code comments currently claim the default iscsi mount path as

kubernetes.io/pod/iscsi/<portal>-iqn-<iqn>-lun-<id>, however actual
path being used is
kubernetes.io/iscsi/iscsi/<portal>-iqn-<iqn>-lun-<id>

This leads to ultimate path being similar to this :

kubernetes.io/iscsi/iscsi/...iqn-iqn...-lun-N

Both iscsi and iqn are repated twice for no reason, since "iqn" is
required by spec to be part of an iqn. This is also  wrong on
multiple leves as actual allowed naming formats are :

iqn.2001-04.com.example:storage:diskarrays-sn-a8675309
eui.02004567A425678D
(RFC 3720 3.2.6.3)

and in the second case "iqn-eui" in the path would be misleading.

Change this to a more reasonable path of
kubernetes.io/iscsi/<portal>-<iqn>-lun-<id>

which also aligns up with how the /dev/by-path and sysfs entries
are created for iscsi devices on linux

  * -- *

Update iSCSI README and sample json file

There seems to have been quite a skew in recent updates to these
files adding in wrong info or info that no longer lines up the
sample config with the README.

Fixed the following issues :
* Fix discrepancy in samples json using initiator iqn from previous
  linked example as target iqn (which was just wrong)
* Generate sample output and README from the same json config provided.
* Remove recommendation to edit initiator name, this is not required
  (open-iscsi warns against editing this manually and provides a utility
   for the same)
* Update docker inspect command to one that works.
* Use separate LUNs for separate mount points instead of re-using.
2015-10-13 10:08:52 -07:00
Eric Paris f125ad88ce Rename IsMountPoint to IsLikelyNotMountPoint
IsLikelyNotMountPoint determines if a directory is not a mountpoint.
It is fast but not necessarily ALWAYS correct. If the path is in fact
a bind mount from one part of a mount to another it will not be detected.
mkdir /tmp/a /tmp/b; mount --bin /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b")
will return true. When in fact /tmp/b is a mount point. So this patch
renames the function and switches it from a positive to a negative (I
could think of a good positive name). This should make future users of
this function aware that it isn't quite perfect, but probably good
enough.
2015-08-14 18:45:43 -04:00
Mike Danese 17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
jiangyaoguo ce52ae782d refector iscsi volume to seperate builder and cleaner 2015-07-24 16:55:56 +08:00
Vish Kannan 5f79267b97 Merge pull request #10484 from markturansky/vol_iscsi_export
Changed ISCSI plugin name from exported to private
2015-07-22 17:07:15 -07:00
markturansky 7e1eb15434 Changed plugin name from exported to private 2015-06-29 13:04:09 -04:00
Sami Wagiaalla a317b5ffc8 iscsi plugin: print error messages not just exit status.
Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
2015-06-29 11:28:56 -04:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Deyuan Deng 6897095e56 Change mount.Interface.Mount to exec('mount'), instead of syscall 2015-04-29 10:46:32 -04:00
Huamin Chen 7a82af31de add iscsi volume plugin
Signed-off-by: Huamin Chen <hchen@redhat.com>
2015-04-06 16:20:28 -04:00