Documentation ¶
Overview ¶
Package cluster is the unique portion of this application that implements basic cluster controls overtop of Libvirtd hosts. The controller is agnostic about where it is running, and doesn't need to be running on a host that has Libvirtd installed on it.
The cluster can be configured through the use of TOML configuration file, or with CLI flags. This is done via the itegration of the greate go libraries spf13/viper and spf13/cobra.
Index ¶
- Variables
- type CPUDiff
- type CPUStats
- type Cluster
- type ClusterBuilder
- func (c *ClusterBuilder) AddHost(h string) *ClusterBuilder
- func (c *ClusterBuilder) AddHostWithURI(h string, uri *host.URI) *ClusterBuilder
- func (c *ClusterBuilder) Build() *Cluster
- func (c *ClusterBuilder) DefaultHostURI(uri *host.URI) *ClusterBuilder
- func (c *ClusterBuilder) SetInterval(i time.Duration) *ClusterBuilder
- type ClusterStats
- type DeviceStats
- type HostDiff
- type HostStats
- type MemoryDiff
- type MemoryStats
- type NetIFStats
- type NetworkDiff
- type NetworkStats
- type SecretStats
- type StatDiff
- type StorageDiff
- type StorageStats
- type VMDiff
- type VMStats
- type VolumeDiff
- type VolumeStats
Constants ¶
This section is empty.
Variables ¶
var (
ErrHostNotFound = errors.New("host not found")
)
Errors that can happen in the cluster
Functions ¶
This section is empty.
Types ¶
type CPUStats ¶
CPUStats provides information about the number of CPUs, Cores, Threads, and Speed available to the cluster.
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is the data structure and controller for cluster access. Using it's methods, you can access hosts, virtual machines, health data, and more. Cluster implements a time.Ticker that will be used to check the connection status of hosts, and reconnect if a connection was blocked or interrupted.
type ClusterBuilder ¶
type ClusterBuilder struct {
// contains filtered or unexported fields
}
ClusterBuilder is used to build a Cluster object, which can then be used
func New ¶
func New() *ClusterBuilder
New starts the builder pattern for the Cluster. Sets the default interval time to 30 seconds.
func (*ClusterBuilder) AddHost ¶
func (c *ClusterBuilder) AddHost(h string) *ClusterBuilder
func (*ClusterBuilder) AddHostWithURI ¶
func (c *ClusterBuilder) AddHostWithURI(h string, uri *host.URI) *ClusterBuilder
func (*ClusterBuilder) Build ¶
func (c *ClusterBuilder) Build() *Cluster
Build retuns the built cluster
func (*ClusterBuilder) DefaultHostURI ¶
func (c *ClusterBuilder) DefaultHostURI(uri *host.URI) *ClusterBuilder
func (*ClusterBuilder) SetInterval ¶
func (c *ClusterBuilder) SetInterval(i time.Duration) *ClusterBuilder
SetInterval sets the check interval of the Cluster being built.
type ClusterStats ¶
type ClusterStats struct { // CPU Statistics including number of CPUs CPU CPUStats // Memory provides information about the amount of memory, including free and // allocated memory Memory MemoryStats // Storage provides information about storage pools, Only get's stats for active // pools, and will not activate pools that are not already active. // Trys to sort out shared file systems from local filesystems using the Type parameter // of Host.StoragePoolInfo Storage StorageStats // Volume provides information on allocated volumes used in the cluster Volume VolumeStats // VM provides VM specific counters for the cluster VM VMStats // Host provides Host information for the cluster Host HostStats // Network provices available networks, and how many are shared between hosts Network NetworkStats // NetIF provides information about Libvirt allocated networks, usable by the // libvirt cluster NetIF NetIFStats // contains filtered or unexported fields }
ClusterStats is used to gather stats for the entire cluster Combined with StatsDiff, we can get some basic cluster wide stats tracking
func InitStats ¶
func InitStats(c *Cluster) *ClusterStats
InitStats is given a cluster, which it then uses to load the initial statistics Does not close connections, but uses the host connections available to the cluster to add statistics together.
func (*ClusterStats) Diff ¶
func (cs *ClusterStats) Diff() StatDiff
Diff returns a map of all the field and how they changed
func (*ClusterStats) Update ¶
func (cs *ClusterStats) Update()
Update triggers the stats collector to refresh it's statistics
type DeviceStats ¶
type DeviceStats struct {
Count uint32
}
DeviceStats provides information about the number of allocatable devices in the cluster. These are PCI and USB devices.
type HostStats ¶
HostStats provides informatoin about the number of hosts defined, and how many are currently available. An unavailable host will not have it's statistics counted
type MemoryDiff ¶
type MemoryStats ¶
MemoryStats provies information about the amount of memory, including free and allocated memory. Allocated is the total allocated to Guests
type NetIFStats ¶
NetIFStats provides information about Libvirt defined networks
type NetworkDiff ¶
type NetworkStats ¶
NetworkStats provides informatoin about the available Host network connections, including bridges and ethernet devices.
type SecretStats ¶
type SecretStats struct { Count uint32 }
SecretStats provides the number of secrets defined throughout the cluster. Shared secrets are only counted once, and are recognized by their UUID
type StatDiff ¶
type StatDiff struct { CPU CPUDiff Memory MemoryDiff Storage StorageDiff Volume VolumeDiff VM VMDiff Host HostDiff Network NetworkDiff }
ClusterStats is used to gather stats for the entire cluster
type StorageDiff ¶
type StorageStats ¶
type StorageStats struct { Total uint64 Used uint64 Free uint64 Active uint32 Inactive uint32 Pools uint32 }
StorageStats provides information about the available storage pools in the cluster, including the amount of space available, allocated, and how many pools are shared between hosts All sizes are in Bytes
type VolumeDiff ¶
type VolumeStats ¶
VolumeStats provides information about the number of volumes on the cluster. Counts volumes in shared storage (as detmermined by StorageStats) only once