Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigureIscsi() (err error)
- func ConfigureMultipath() (err error)
- func GetConfigFile() (configFile string)
- func GetMultipathTemplateFile() (configFile string, err error)
- func GetUdevTemplateFile() (configFile string)
- func IsIscsiEnabled() (enabled bool)
- func IsMultipathRequired() (required bool, err error)
- func SetBlockDeviceRecommendations() (err error)
- func SetConfigFile(configFile string)
- func SetIscsiParamRecommendation(parameter string, recommendation string) (err error)
- func SetIscsiRecommendations(global bool) (err error)
- func SetIscsiSessionParam(target string, parameter string, value string) (err error)
- func SetMultipathRecommendations() (err error)
- func SetRecommendations(global bool) (err error)
- type Category
- type ComplianceStatus
- type DeviceMap
- type DeviceRecommendation
- type DeviceTemplate
- type HbaDriver
- type HbaVendor
- type Recommendation
- func GetBlockQueueRecommendations(device *model.Device, deviceType string) (settings []*Recommendation, err error)
- func GetDeviceRecommendations(devices []*model.Device, deviceParam ...string) (settings []*Recommendation, err error)
- func GetFcRecommendations() (settings []*Recommendation, err error)
- func GetFileSystemRecommendations(devices []*model.Device) (settings []*Recommendation, err error)
- func GetIscsiRecommendations(deviceParam ...string) (settings []*Recommendation, err error)
- func GetRecommendations(deviceParam ...string) (settings []*Recommendation, err error)
- type Severity
- type TemplateSetting
Constants ¶
const ( // Filesystem category type Filesystem = iota + 1 // Disk category type Disk // Multipath category type Multipath // Fc category type Fc // Iscsi category type Iscsi )
const ( // NotApplicable recommendation attribute not applicable NotApplicable = "n/a" // All applicable to all devices All = "all" )
const (
// UdevFilePathName path name of the udev file deployed to tune settings
UdevFilePathName = "/etc/udev/rules.d/99-nimble-tune.rules"
)
Variables ¶
var ( // ConfigFile file path of template settings for recommendation. ConfigFile = GetConfigFile() )
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 ¶
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 ¶
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 ¶
SetIscsiParamRecommendation set parameter value in iscsid.conf
func SetIscsiRecommendations ¶
SetIscsiRecommendations set iscsi param recommendations
func SetIscsiSessionParam ¶
SetIscsiSessionParam set parameter value for logged-in iscsi session
func SetMultipathRecommendations ¶
func SetMultipathRecommendations() (err error)
SetMultipathRecommendations sets multipath.conf settings
func SetRecommendations ¶
SetRecommendations set recommendations for all categories except filesystem and fc
Types ¶
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 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 )
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 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