Documentation
¶
Overview ¶
Copyright 2017 The Goock Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 The Goock Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2017 The Goock Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func CheckDevice(path string) bool
- func CheckReadWrite(path string, wwn string) bool
- func ExtendDevice(path string) (int, error)
- func FindMpathByPath(path string) string
- func FindMpathByWwn(wwn string) string
- func FindMultipathByWwn(wwn string) model.Multipath
- func FlushDeviceIO(path string) error
- func FlushPath(path string) error
- func GetDeviceInfo(path string) (model.DeviceInfo, error)
- func GetDeviceSize(path string) int
- func GetFCHBA() []model.HBA
- func GetFcWwnn() []string
- func GetFcWwpn() []string
- func GetWWN(path string) string
- func IsFCDevice(device string) bool
- func IsFCSupport() bool
- func IsMultipathEnabled() bool
- func Reconfigure() error
- func Reload() error
- func RemoveSCSIDevice(path string)
- func RescanHosts(allHct [][]int, lunID int)
- func ResizeMpath(mpathId string) error
- func ScanSCSIBus(path string, content string) error
- func SetExecutor(e exec.Interface)
- func SetLogger(l *logrus.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckReadWrite ¶
NAME RO sdb 0 └─36006016003b03a00da41ad58e6ab1cc0 0 sdd 0 └─36006016015e03a00bea7c7588c91d581 0 sde 0 sdf 0 └─36006016003b03a00da41ad58e6ab1cc0 0 sdg 0 └─36006016015e03a00bea7c7588c91d581 0 sr0 0 vda 0 └─vda1 0
func ExtendDevice ¶
Commands example: echo 1 > /sys/bus/scsi/drivers/sd/9:0:0:6/rescan
func FindMpathByPath ¶
Use multipath -l <path> to discover multipath device Valid <path> could be WWN or /dev/sdb like path
func FindMpathByWwn ¶
Return the multipath by wwn 1) When multipath friendly names are ON: a device file will show up in /dev/disk/by-id/dm-uuid-mpath-<WWN> /dev/disk/by-id/dm-name-mpath<N> /dev/disk/by-id/scsi-mpath<N> /dev/mapper/mpath<N>
2) When multipath friendly names are OFF: /dev/disk/by-id/dm-uuid-mpath-<WWN> /dev/disk/by-id/scsi-<WWN> /dev/mapper/<WWN>
func FindMultipathByWwn ¶
func FlushDeviceIO ¶
path = "/dev/sdb" or " "/dev/disk/by-path/ip-10.244.213.177:3260-iscsi-iqn.1992-04.com.emc:cx.fnm00150600267.a0-lun-10"
func GetDeviceInfo ¶
func GetDeviceInfo(path string) (model.DeviceInfo, error)
output: sudo sg_scan /dev/disk/by-path/pci-0000:05:00.1-fc-0x5006016d09200925-lun-0 /dev/disk/by-path/pci-0000:05:00.1-fc-0x5006016d09200925-lun-0: scsi9 channel=0 id=0 lun=0 [em]
func IsFCDevice ¶
func IsFCSupport ¶
func IsFCSupport() bool
func IsMultipathEnabled ¶
func IsMultipathEnabled() bool
func RemoveSCSIDevice ¶
func RemoveSCSIDevice(path string)
path = "/dev/sdb" or "sdb" Use echo 1 > /sys/block/%s/device/delete to force delete the device
func RescanHosts ¶
Do a more specific scan instead of a wildcard
func ResizeMpath ¶
func ScanSCSIBus ¶
use echo "c t l" > to /sys/class/scsi_host/%s/scan
func SetExecutor ¶
Types ¶
This section is empty.