hostinfo

package
v0.3.11-8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 61 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KVM_GET_API_VERSION = uintptr(44544)
	KVM_CREATE_VM       = uintptr(44545)
	KVM_CHECK_EXTENSION = uintptr(44547)

	KVM_CAP_NR_VCPUS  = 9
	KVM_CAP_MAX_VCPUS = 66
)
View Source
const (
	ErrOvnService = errors.Error("ovn controller")
	ErrOvnConfig  = errors.Error("ovn controller configuration")
)

Variables

This section is empty.

Functions

func IsRootPartition

func IsRootPartition(path string) bool

func StartDetachStorages

func StartDetachStorages(hs []jsonutils.JSONObject)

func Stop

func Stop()

Types

type OvnHelper

type OvnHelper struct {
	// contains filtered or unexported fields
}

func NewOvnHelper

func NewOvnHelper(hi *SHostInfo) *OvnHelper

func (*OvnHelper) Init

func (oh *OvnHelper) Init() (err error)

type QemuCaps

type QemuCaps struct {
	QemuVersion     string
	MachineInfoList []monitor.MachineInfo
}

type SCPUInfo

type SCPUInfo struct {
	CpuCount int

	CpuArchitecture string
	// contains filtered or unexported fields
}

func DetectCpuInfo

func DetectCpuInfo() (*SCPUInfo, error)

type SHostInfo

type SHostInfo struct {
	Cpu *SCPUInfo
	Mem *SMemory

	IsolatedDeviceMan isolated_device.IsolatedDeviceManager

	MasterNic *netutils2.SNetInterface
	Nics      []*SNIC

	HostId         string
	Zone           string
	ZoneId         string
	Cloudregion    string
	CloudregionId  string
	ZoneManagerUri string
	Project_domain string
	Domain_id      string

	FullName string
	SysError map[string][]api.HostError

	IoScheduler string
	// contains filtered or unexported fields
}

func Instance

func Instance() *SHostInfo

func NewHostInfo

func NewHostInfo() (*SHostInfo, error)

func (*SHostInfo) AppendError

func (h *SHostInfo) AppendError(content, errType, id, name string)

func (*SHostInfo) AppendHostError

func (h *SHostInfo) AppendHostError(content string)

func (*SHostInfo) CpuCmtBound

func (h *SHostInfo) CpuCmtBound() int

func (*SHostInfo) DisableHugepages

func (h *SHostInfo) DisableHugepages()

func (*SHostInfo) DisableKsm

func (h *SHostInfo) DisableKsm()

func (*SHostInfo) EnableKsm

func (h *SHostInfo) EnableKsm(sleepSec int)

func (*SHostInfo) EnableNativeHugepages

func (h *SHostInfo) EnableNativeHugepages()

func (*SHostInfo) EnableTransparentHugepages

func (h *SHostInfo) EnableTransparentHugepages()

func (*SHostInfo) GetBridgeDev

func (h *SHostInfo) GetBridgeDev(bridge string) hostbridge.IBridgeDriver

func (*SHostInfo) GetCpuArchitecture

func (h *SHostInfo) GetCpuArchitecture() string

func (*SHostInfo) GetHostId

func (h *SHostInfo) GetHostId() string

func (*SHostInfo) GetHostTopology

func (h *SHostInfo) GetHostTopology() *hostapi.HostTopology

func (*SHostInfo) GetId

func (h *SHostInfo) GetId() string

func (*SHostInfo) GetIsolatedDeviceManager

func (h *SHostInfo) GetIsolatedDeviceManager() isolated_device.IsolatedDeviceManager

func (*SHostInfo) GetKVMMaxCpus

func (h *SHostInfo) GetKVMMaxCpus() uint

func (*SHostInfo) GetKernelVersion

func (h *SHostInfo) GetKernelVersion() string

func (*SHostInfo) GetKubeletConfig

func (h *SHostInfo) GetKubeletConfig() kubelet.KubeletConfig

func (*SHostInfo) GetMasterIp

func (h *SHostInfo) GetMasterIp() string

func (*SHostInfo) GetMasterMac

func (h *SHostInfo) GetMasterMac() string

func (*SHostInfo) GetMasterNicIpAndMask

func (h *SHostInfo) GetMasterNicIpAndMask() (string, int)

func (*SHostInfo) GetMemory

func (h *SHostInfo) GetMemory() int

func (*SHostInfo) GetMemoryTotal

func (h *SHostInfo) GetMemoryTotal() int

func (*SHostInfo) GetName

func (h *SHostInfo) GetName() string

func (*SHostInfo) GetNodeHugepages

func (h *SHostInfo) GetNodeHugepages() error

func (*SHostInfo) GetQemuMachineInfoList

func (h *SHostInfo) GetQemuMachineInfoList() []monitor.MachineInfo

func (*SHostInfo) GetReservedCpusInfo

func (h *SHostInfo) GetReservedCpusInfo() *cpuset.CPUSet

func (*SHostInfo) GetSession

func (h *SHostInfo) GetSession() *mcclient.ClientSession

func (*SHostInfo) GetZoneId

func (h *SHostInfo) GetZoneId() string

func (*SHostInfo) HugepageSizeKb

func (h *SHostInfo) HugepageSizeKb() int

func (*SHostInfo) Init

func (h *SHostInfo) Init() error

In this order init host service: * 1. prepare env, fix environment variable path * 2. detect hostinfo, fill host capability and custom host field * 3. prepare hostbridge, start openvswitch service * 4. parse host config, config ip address * 5. check is ovn support, setup ovn chassis

func (*SHostInfo) IsAarch64

func (h *SHostInfo) IsAarch64() bool

func (*SHostInfo) IsHugepagesEnabled

func (h *SHostInfo) IsHugepagesEnabled() bool

func (*SHostInfo) IsKvmSupport

func (h *SHostInfo) IsKvmSupport() bool

func (*SHostInfo) IsNestedVirtualization

func (h *SHostInfo) IsNestedVirtualization() bool

func (*SHostInfo) IsNumaAllocateEnabled

func (h *SHostInfo) IsNumaAllocateEnabled() bool

func (*SHostInfo) IsX8664

func (h *SHostInfo) IsX8664() bool

func (*SHostInfo) Keyword

func (h *SHostInfo) Keyword() string

func (*SHostInfo) OnCatalogChanged

func (h *SHostInfo) OnCatalogChanged(catalog mcclient.KeystoneServiceCatalogV3)

func (*SHostInfo) PreventArpFlux

func (h *SHostInfo) PreventArpFlux()

func (*SHostInfo) ProbeSyncIsolatedDevices

func (h *SHostInfo) ProbeSyncIsolatedDevices(hostId string, body jsonutils.JSONObject) (interface{}, error)

func (*SHostInfo) PutHostOnline

func (h *SHostInfo) PutHostOnline() error

func (*SHostInfo) RemoveErrorType

func (h *SHostInfo) RemoveErrorType(errType string)

func (*SHostInfo) SetOnHostDown

func (h *SHostInfo) SetOnHostDown(action string) error

func (*SHostInfo) StartDHCPServer

func (h *SHostInfo) StartDHCPServer()

func (*SHostInfo) StartRegister

func (h *SHostInfo) StartRegister(delay int)

func (*SHostInfo) UpdateSyncInfo

func (h *SHostInfo) UpdateSyncInfo(hostId string, body jsonutils.JSONObject) (interface{}, error)

type SMemory

type SMemory struct {
	Total   int
	Free    int
	Used    int
	MemInfo *types.SDMIMemInfo
}

func DetectMemoryInfo

func DetectMemoryInfo() (*SMemory, error)

func (*SMemory) GetHugepages

func (m *SMemory) GetHugepages() (sysutils.THugepages, error)

type SNIC

type SNIC struct {
	Inter  string
	Bridge string
	Ip     string
	Wire   string
	WireId string
	Mask   int

	Bandwidth int
	BridgeDev hostbridge.IBridgeDriver
	// contains filtered or unexported fields
}

func NewNIC

func NewNIC(desc string) (*SNIC, error)

func (*SNIC) EnableDHCPRelay

func (n *SNIC) EnableDHCPRelay() bool

func (*SNIC) ExitCleanup

func (n *SNIC) ExitCleanup()

func (*SNIC) SetWireId

func (n *SNIC) SetWireId(wire, wireId string, bandwidth int64) error

func (*SNIC) SetupDhcpRelay

func (n *SNIC) SetupDhcpRelay() error

type SSysInfo

type SSysInfo struct {
	*types.SSystemInfo

	Nest           string `json:"nest,omitempty"`
	OsDistribution string `json:"os_distribution"`
	OsVersion      string `json:"os_version"`
	KernelVersion  string `json:"kernel_version"`
	QemuVersion    string `json:"qemu_version"`
	OvsVersion     string `json:"ovs_version"`
	OvsKmodVersion string `json:"ovs_kmod_version"`
	KvmModule      string `json:"kvm_module"`
	CpuModelName   string `json:"cpu_model_name"`
	CpuMicrocode   string `json:"cpu_microcode"`

	StorageType string `json:"storage_type"`

	HugepagesOption string                       `json:"hugepages_option"`
	HugepageSizeKb  int                          `json:"hugepage_size_kb"`
	HugepageNr      *int                         `json:"hugepage_nr"`
	NodeHugepages   []hostapi.HostNodeHugepageNr `json:"node_hugepages"`
	EnableKsm       bool                         `json:"enable_ksm"`

	Topology        *hostapi.HostTopology `json:"topology"`
	CPUInfo         *hostapi.HostCPUInfo  `json:"cpu_info"`
	MotherboardInfo *types.SSystemInfo    `json:"motherboard_info"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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