package
4.6.0+incompatible
Repository: https://github.com/mrakopes/common-host-libs.git
Documentation: pkg.go.dev

# Functions

AreFsOptionsCompatible returns true if the FS options are compatible.
BindMount mounts a path to a mountPoint.
BindUnmount unmounts a bind mount.
ChangeMode on the device with fsMode string.
ChangeOwner on the mountpoint to user:group.
Chcon - chcon -t svirt_sandbox_file_t <mount point>.
CheckFsCreationInProgress checks if mkfs process is using the device using lsof.
CreateFileSystem : creates file system on the device.
CreateFileSystemOnDevice : create filesystem on device with serialnumber :serialnumber nolint: gocyclo.
CreateFileSystemWithOptions : creates file system on the device with creation options.
CreateLinuxDevices : attached and creates linux devices to host.
CreateMountDir creates new directory if not exists.
DeleteDevice : delete the multipath device.
EnableService enables given service type on the system, only iscsi and multipath service types are supported.
ExcludeMountDirFromUpdateDb add mountDir to PRUNEPATHS in updatedb.conf to let mlocate ignore mountDir during file search.
ExpandDevice expands device and filesystem at given targetPath to underlying volume size targetPath is /dev/dm-* for block device and mountpoint for filesystem based device.
ExpandFilesystem : expands filesystem size to underlying device size.
GetAllFcHostPorts get all the FC host port details on the host.
GetAllFcHostPortWWN get all FC host port WWN's on the host.
GetBlockSizeBytes returns the block size in bytes.
GetChapInfo gets the chap user.
GetDeletingDevices returns device serial numbers in deletion state.
GetNimbleDmDevices : get the scsi device by specified serial.
GetDeviceFromMountPoint returns the device path from /proc/mounts for the mountpoint provided.
GetDeviceFromVolume returns Linux device for given volume info.
No description provided by the author
GetDmDeviceFromSerial returns populated multipath device object for given serial.
GetFilesystemOptions applies the FS options on the filesystem of the device.
GetFilesystemType returns the filesystem type if present else empty string.
GetFsType returns filesytem type for a given mount object.
GetHostNameAndDomain : get host name and domain.
GetHostPort get the host port details for given host number from H:C:T:L of device.
GetIfaces return bound ifaces with network information.
GetInitiators : get the host initiators.
GetIPV4NetworkAddress returns network address for given ipv4 address and netmask.
GetIscsiIfacesPath returns actual path for iscsi ifaces db.
GetIscsiNodesFromIsciadm retrieves iscsi targets with iscsiadm command.
GetIscsiTargets gets targets connected on host from /dev/disk/by-path entries NOTE: this will fetch only targets with at-least one device discovered.
GetLinuxDmDevices : Gets the list of Linux Multipath Devices nolint : gocyclo.
GetLoggedInIscsiTargets returns currently logged-in iscsi targets.
GetManufacturer return manufacturer name of the system.
GetMountOptions : get options used for mount point for the Device.
GetMountOptionsForDevice : get options used for mount point for the Device.
GetMountPointFromDevice returns the FIRST mountpoint listed in /proc/mounts matching the device.
GetMountPointsForDevices : get the mount point for the Device nolint : gocyclo.
GetNetworkInterfaces : get the array of network interfaces.
GetOsInfo returns os information including distro and versions.
GetPartitionInfo for the Device dev.
GetProductName return product name of the system.
GetScsiHosts returns all SCSI adapter host objects.
GetUserFriendlyNameBySerial returns user_friendly_name for given serial.
HandleIscsiDiscovery performs iscsi target discovery and create sessions as required.
HashMountID : get hash of the string.
InstallPackage installs provided package type on the host based on OS distro.
IsBlockDevice checks if the given path is a block device.
IsFsOwnerMatch checks if the fsOwner matches with the existing FsOwner info.
IsPackageInstalled returns true if specified package type is installed on host.
IsVirtualMachine returns true if system is running as a guest on hypervisor.
MountDevice : mount device on host.
MountDeviceWithFileSystem : Mount device with filesystem at the mountPoint, if partitions are present, then largest partition will be mounted.
No description provided by the author
MultipathdReconfigure reconfigure multipathd settings.
MultipathdShowMaps output.
MultipathdShowPaths output from Linux.
OfflineDevice : offline all the scsi paths for the multipath device.
PerformDiscovery : adds iscsi targets to iscsi database after performing send targets.
RemountWithOptions : Remount mountpoint with optionsnolint : dupl.
RescanFcTarget rescans host ports for new Fibre Channel devicesnolint: dupl.
RescanSize performs size rescan of all scsi devices on host and updates applicable multipath devices TODO: replace rescan-scsi-bus.sh dependency with manual rescan of scsi devices.
RescanIscsi perform SCSI rescan on iSCSI host ports.
RescanScsiHosts rescan's all SCSI host adapters.
RetryBindMount :.
RetryBindUnmount :.
RetryCreateFileSystem : retry file system create.
RetryCreateFileSystemWithOptions : retry file system create.
SelinuxEnabled runs selinuxenabled if found and returns the result.
ServiceCommand runs service command on given service, valid service types are iscsi and multipath nolint : gocyclo.
SetFilesystemOptions applies the FS options on the filesystem of the device.
SetMountOptions : get options used for mount point for the Device.
SetupFilesystem writes the given filesystem on the given device.
SetupFilesystemWithOptions writes the given filesystem on the given device using the given options.
SetupMount creates the mountpoint with mount options.
UdevadmReloadRules trigger udev rules.
UdevadmTrigger trigger udev rules.
UnmountDevice : unmount device from host.
UnmountFileSystem : unmount the filesystemnolint: gocyclo.
AttachDevices : attached and creates scsi devices to host.
DeleteDevice : delete the multipath device.

# Constants

Btrfs B-Tree filesystem type.
No description provided by the author
Ext2 ext2 filesystem type.
Ext3 ext3 filesytem type.
Ext4 ext3 filesytem type.
FcHostLIPNameFormat :.
GroupScope scope of the device is group.
IscsiConf is configuration file for iscsid daemon.
MultipathBindings bindings file for multipathd.
MultipathConf configuration file for multipathd.
OsTypeAmazon represents Amazon OS.
OsTypeCentos represents CentOS OS.
OsTypeOracle represents Oracle Linux OS.
OsTypeRedhat represents RedHat OS.
OsTypeSuse represents SuSE OS.
OsTypeUbuntu represents Ubuntu OS.
No description provided by the author
No description provided by the author
No description provided by the author
ScsiHostPathFormat.
ScsiHostScanPathFormat.
Udevadm udev manager.
VolumeScope scope of the device is volume.
Xfs xfs filesystem type.

# Variables

OsIscsiPackageMap provides mapping of os distribution to iscsi package name.
OsMultipathPackageMap provides mapping of os distribution to multipath package name.

# Structs

DeletingDevices represents serial numbers of devices being deleted.
Mount struct.
OsInfo represents OS information.

# Type aliases

FsType indicates the filesystem type of mounted device.