Merge pull request #36698 from fabiand/no-mpathconf

Automatic merge from submit-queue

fc: Drop multipath.conf snippet

**What this PR does / why we need it**:
Removes multipath.conf - The code does not make use of it - or ensure s that it's getting used - and it should in addition be handled elsewehre.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

A minimalistic multipath.conf got written, but it was useless, as
it is unclear if multipathd is running and there was also no
config reload triggered.

This patch drops this snippet. In general it's probably a better idea
to leave the multipath.conf to the component managing the host.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
This commit is contained in:
Kubernetes Submit Queue
2017-03-24 10:24:49 -07:00
committed by GitHub
2 changed files with 27 additions and 17 deletions

27
pkg/volume/README.md Normal file
View File

@@ -0,0 +1,27 @@
## Multipath
To leverage multiple paths for block storage, it is important to perform the
multipath configuration on the host.
If your distribution does not provide `/etc/multipath.conf`, then you can
either use the following minimalistic one:
defaults {
find_multipaths yes
user_friendly_names yes
}
or create a new one by running:
$ mpathconf --enable
Finally you'll need to ensure to start or reload and enable multipath:
$ systemctl enable multipathd.service
$ systemctl restart multipathd.service
**Note:** Any change to `multipath.conf` or enabling multipath can lead to
inaccessible block devices, because they'll be claimed by multipath and
exposed as a device in /dev/mapper/*.
Some additional informations about multipath can be found in the
[iSCSI documentation](iscsi/README.md)

View File

@@ -89,21 +89,6 @@ func findDisk(wwn, lun string, io ioHandler) (string, string) {
return "", ""
}
func createMultipathConf(path string, io ioHandler) {
if _, err := os.Lstat(path); err != nil {
data := []byte(`defaults {
find_multipaths yes
user_friendly_names yes
}
blacklist {
}
`)
io.WriteFile(path, data, 0664)
}
}
// rescan scsi bus
func scsiHostRescan(io ioHandler) {
scsi_path := "/sys/class/scsi_host/"
@@ -148,8 +133,6 @@ func searchDisk(wwns []string, lun string, io ioHandler) (string, string) {
break
}
// rescan and search again
// create multipath conf if it is not there
createMultipathConf("/etc/multipath.conf", io)
// rescan scsi bus
scsiHostRescan(io)
rescaned = true