block_device_utils

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Overview

*

  • Copyright 2018 IBM Corp. *
  • 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

Constants

View Source
const (
	NotMountedErrorMessage                   = "not mounted" // Error while umount device that is already unmounted
	TimeoutMilisecondMountCmdIsDeviceMounted = 20 * 1000     // max to wait for mount command
	TimeoutMilisecondMountCmdMountFs         = 120 * 1000    // max to wait for mounting device
	TimeoutMilisecondUmountCmdUmountFs       = 30 * 1000     // max wait timeout for umount command
	TimeoutMilisecondChmodCmd                = 3 * 1000
)
View Source
const CleanupTimeout = 30 * 1000
View Source
const DiscoverTimeout = 20 * 1000
View Source
const MultipathTimeout = 60 * 1000
View Source
const NoIscsiadmCommnadWarningMessage = `` /* 258-byte string literal not displayed */

Variables

View Source
var FcHostDir = "/sys/class/fc_host/"
View Source
var ScsiHostDir = "/sys/class/scsi_host/"

Functions

This section is empty.

Types

type BlockDeviceUtils

type BlockDeviceUtils interface {
	Rescan(protocol Protocol, volumes *resources.VolumeMountProperties) error
	CleanupDevices(protocol Protocol, volumes *resources.VolumeMountProperties) error
	ReloadMultipath() error
	Discover(volumeWwn string, deepDiscovery bool) (string, error)
	GetWwnByScsiInq(mpathOutput string, dev string) (string, error)
	DiscoverBySgInq(mpathOutput string, volumeWwn string) (string, error)
	Cleanup(mpath string) error
	CheckFs(mpath string) (bool, error)
	MakeFs(mpath string, fsType string) error
	MountFs(mpath string, mpoint string) error
	UmountFs(mpoint string, volumeWwn string) error
	IsDeviceMounted(devPath string) (bool, []string, error)
	IsDirAMountPoint(dirPath string) (bool, []string, error)
	SetDmsetup(mpath string) error
}

func NewBlockDeviceUtils

func NewBlockDeviceUtils() BlockDeviceUtils

func NewBlockDeviceUtilsWithExecutor

func NewBlockDeviceUtilsWithExecutor(executor utils.Executor) BlockDeviceUtils

func NewBlockDeviceUtilsWithExecutorAndConnector

func NewBlockDeviceUtilsWithExecutorAndConnector(executor utils.Executor, conns ...initiator.Connector) BlockDeviceUtils

type CommandExecuteError added in v1.2.0

type CommandExecuteError struct {
	Cmd string
	Err error
}

func (*CommandExecuteError) Error added in v1.2.0

func (e *CommandExecuteError) Error() string

type FaultyDeviceError

type FaultyDeviceError struct {
	Dev string
}

func (*FaultyDeviceError) Error

func (e *FaultyDeviceError) Error() string

type MultipathDeviceNotFoundError

type MultipathDeviceNotFoundError struct {
	Dev string
}

func (*MultipathDeviceNotFoundError) Error

type Protocol

type Protocol int
const (
	SCSI Protocol = iota
	ISCSI
)

type VolumeNotFoundError added in v1.2.0

type VolumeNotFoundError struct {
	VolName string
}

func (*VolumeNotFoundError) Error added in v1.2.0

func (e *VolumeNotFoundError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL