tunelinux

package
v4.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Filesystem category type
	Filesystem = iota + 1
	// Disk category type
	Disk
	// Multipath category type
	Multipath
	// Fc category type
	Fc
	// Iscsi category type
	Iscsi
)
View Source
const (
	// NotApplicable recommendation attribute not applicable
	NotApplicable = "n/a"
	// All applicable to all devices
	All = "all"
)
View Source
const (
	// UdevFilePathName path name of the udev file deployed to tune settings
	UdevFilePathName = "/etc/udev/rules.d/99-nimble-tune.rules"
)

Variables

View Source
var (

	// ConfigFile file path of template settings for recommendation.
	ConfigFile = GetConfigFile()
)
View Source
var (
	// UdevTemplatePath is the path to template 99-nimble-tune.rules file
	UdevTemplatePath = GetUdevTemplateFile()
)

Functions

func ConfigureIscsi

func ConfigureIscsi() (err error)

ConfigureIscsi verifies and install necessary iSCSI packages if not present. It also makes sure if service is running.

func ConfigureMultipath

func ConfigureMultipath() (err error)

ConfigureMultipath ensures following 1. Service is enabled and running 2. Multipath settings are configured correctly

func GetConfigFile

func GetConfigFile() (configFile string)

GetConfigFile returns config.json file path if bundled with NLT accordingly

func GetMultipathTemplateFile

func GetMultipathTemplateFile() (configFile string, err error)

GetMultipathConfigFile returns path of the template multipath.conf file according to OS distro

func GetUdevTemplateFile

func GetUdevTemplateFile() (configFile string)

GetUdevTemplateFile returns udev template file path if bundled with NLT accordingly

func IsIscsiEnabled

func IsIscsiEnabled() (enabled bool)

IsIscsiEnabled return if iSCSI services are installed and enabled on the system

func IsMultipathRequired

func IsMultipathRequired() (required bool, err error)

IsMultipathRequired returns if multipath needs to be enabled on the system

func SetBlockDeviceRecommendations

func SetBlockDeviceRecommendations() (err error)

SetBlockDeviceRecommendations set block queue param recommendations

func SetConfigFile

func SetConfigFile(configFile string)

SetConfigFile sets the config file path (overrides the default value)

func SetIscsiParamRecommendation

func SetIscsiParamRecommendation(parameter string, recommendation string) (err error)

SetIscsiParamRecommendation set parameter value in iscsid.conf

func SetIscsiRecommendations

func SetIscsiRecommendations(global bool) (err error)

SetIscsiRecommendations set iscsi param recommendations

func SetIscsiSessionParam

func SetIscsiSessionParam(target string, parameter string, value string) (err error)

SetIscsiSessionParam set parameter value for logged-in iscsi session

func SetMultipathRecommendations

func SetMultipathRecommendations() (err error)

SetMultipathRecommendations sets multipath.conf settings

func SetRecommendations

func SetRecommendations(global bool) (err error)

SetRecommendations set recommendations for all categories except filesystem and fc

Types

type Category

type Category int

Category recommendation category type

func (Category) String

func (s Category) String() string

type ComplianceStatus

type ComplianceStatus int

ComplianceStatus of the compliance

const (
	// NotRecommended with recommended value
	NotRecommended ComplianceStatus = iota
	// Recommended with recommended value
	Recommended
)

func (ComplianceStatus) String

func (s ComplianceStatus) String() string

type DeviceMap

type DeviceMap struct {
	DeviceType string
	// contains filtered or unexported fields
}

type DeviceRecommendation

type DeviceRecommendation struct {
	DeviceType    string
	RecomendArray []*Recommendation
}

func GetMultipathRecommendations

func GetMultipathRecommendations() (settings []DeviceRecommendation, err error)

GetMultipathRecommendations obtain various recommendations for multipath settings on host

type DeviceTemplate

type DeviceTemplate struct {
	DeviceType    string
	TemplateArray []TemplateSetting
}

type HbaDriver

type HbaDriver int

HbaDriver indicates the driver name of the Fibre Channel HBA

const (
	// Qla2xxx qlogic hba driver type
	Qla2xxx HbaDriver = 1 + iota
	// Qla4xxx qlogic hba driver
	Qla4xxx
	// Lpfc emulex hba driver type
	Lpfc
	// Bfa brocade hba driver type
	Bfa
	// Fnic cisco hba driver type
	Fnic
)

func (HbaDriver) String

func (vendor HbaDriver) String() string

type HbaVendor

type HbaVendor int

HbaVendor indicates the vendor type of the Fibre Channel HBA

const (
	// Emulex emulex hba adapter type which also indicates lpfc driver
	Emulex HbaVendor = 1 + iota
	// Qlogic qlogic hba adapter type which also indicates qla2xxx/qla4xxx driver
	Qlogic
	// Brocade brocade hba adapter type which also indicates bfa driver
	Brocade
	// Cisco cisco converged adapter type which also indicates fnic driver
	Cisco
)

func (HbaVendor) String

func (vendor HbaVendor) String() string

type Recommendation

type Recommendation struct {
	// ID unique identifier for the recommendation
	ID string `json:"id,omitempty"`
	// Category recommendation category among (filesystem, multipath, device, iscsi, fc, system)
	Category string `json:"category,omitempty"`
	// Level severity level of the recommendation
	Level string `json:"severity,omitempty"`
	// Description brief description about the recommendation
	Description string `json:"description,omitempty"`
	// Parameter parameter name for recommendation
	Parameter string `json:"parameter,omitempty"`
	// Value current parameter value
	Value string `json:"value,omitempty"`
	// Recommendation recommended parameter value
	Recommendation string `json:"recommendation,omitempty"`
	// Status compliant status of the setting
	CompliantStatus string `json:"status,omitempty"`
	// Device device name
	Device string `json:"device,omitempty"`
	// MountPoint mount point for the device
	MountPoint string `json:"mountpoint,omitempty"`
	// FsType filesystem type, one among (xfs, ext2, ext3 and brtfs)
	FsType string `json:"fstype,omitempty"`
	// Vendor fibrechannel vendor name
	Vendor string `json:"vendor,omitempty"`
}

Recommendation for the settings on the host

func GetBlockQueueRecommendations

func GetBlockQueueRecommendations(device *model.Device, deviceType string) (settings []*Recommendation, err error)

GetBlockQueueRecommendations obtain block queue settings of the device

func GetDeviceRecommendations

func GetDeviceRecommendations(devices []*model.Device, deviceParam ...string) (settings []*Recommendation, err error)

GetDeviceRecommendations obtain various recommendations for block device settings on host

func GetFcRecommendations

func GetFcRecommendations() (settings []*Recommendation, err error)

GetFcRecommendations obtain various recommendations for FC adapter settings on host

func GetFileSystemRecommendations

func GetFileSystemRecommendations(devices []*model.Device) (settings []*Recommendation, err error)

GetFileSystemRecommendations obtain various recommendations for filesystems mounted on host

func GetIscsiRecommendations

func GetIscsiRecommendations(deviceParam ...string) (settings []*Recommendation, err error)

GetIscsiRecommendations obtain various recommendations for iSCSI settings on host

func GetRecommendations

func GetRecommendations(deviceParam ...string) (settings []*Recommendation, err error)

GetRecommendations obtain various recommendations for non-compliant settings on host

type Severity

type Severity int

Severity for the recommendation made

const (
	// Info Information level
	Info Severity = 1 + iota
	// Warning level
	Warning
	// Critical level
	Critical
	// Error level
	Error
)

func (Severity) String

func (s Severity) String() string

type TemplateSetting

type TemplateSetting struct {
	// Category recommendation category among (filesystem, multipath, device, iscsi, fc, system)
	Category string `json:"category,omitempty"`
	// Level severity level of the recommendation
	Level string `json:"severity,omitempty"`
	// Description brief description about the recommendation
	Description string `json:"description,omitempty"`
	// Parameter parameter name for recommendation
	Parameter string `json:"parameter,omitempty"`
	// Recommendation recommended parameter value
	Recommendation string `json:"recommendation,omitempty"`
	// Driver driver module name
	Driver string `json:"driver,omitempty"`
}

TemplateSetting for the settings on the host

Directories

Path Synopsis
Empty go file hack to get go modules to pull this directory
Empty go file hack to get go modules to pull this directory

Jump to

Keyboard shortcuts

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