hostinfo

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 61 Imported by: 0

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 HasOvnSupport

func HasOvnSupport() bool

func IsRootPartition

func IsRootPartition(path string) bool

func MustGetOvnVersion

func MustGetOvnVersion() string

func OvnControllerInsideContainer

func OvnControllerInsideContainer() 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 SCatalog

type SCatalog struct {
	Id        string      `json:"id"`
	Name      string      `json:"name"`
	Type      string      `json:"type"`
	Endpoints []SEndpoint `json:"endpoint"`
}

func NewCatalog

func NewCatalog() *SCatalog

type SEndpoint

type SEndpoint struct {
	Id        string `json:"id"`
	Interface string `json:"interface"`
	Region    string `json:"region"`
	Region_id string `json:"region_id"`
	Url       string `json:"url"`
	Name      string `json:"name"`
}

type SHostInfo

type SHostInfo struct {
	IsRegistered chan 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]string
	SysWarning map[string]string

	IoScheduler string
	// contains filtered or unexported fields
}

func Instance

func Instance() *SHostInfo

func NewHostInfo

func NewHostInfo() (*SHostInfo, error)

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) 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) GetMatchNic

func (h *SHostInfo) GetMatchNic(bridge, iface, mac string) *SNIC

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) GetQemuMachineInfoList

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

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) 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) StartDHCPServer

func (h *SHostInfo) StartDHCPServer()

func (*SHostInfo) StartPinger

func (h *SHostInfo) StartPinger()

func (*SHostInfo) StartRegister

func (h *SHostInfo) StartRegister(delay int, callback func())

func (*SHostInfo) UpdateSyncInfo

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

type SHostPingTask

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

func NewHostPingTask

func NewHostPingTask(interval int) *SHostPingTask

func (*SHostPingTask) Start

func (p *SHostPingTask) Start()

func (*SHostPingTask) Stop

func (p *SHostPingTask) Stop()

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
	Network 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)

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"`
	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"`

	Topology *hostapi.HostTopology `json:"topology"`
	CPUInfo  *hostapi.HostCPUInfo  `json:"cpu_info"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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