Documentation ¶
Overview ¶
Package host provides utilities and data structures in relation to a libvirt host. This includes getting a list of virtual machines running on a host, launching a new virtual machine on a host, triggering a virtual machine migration to another host, getting hardware and resource usage from a host, and eventually more. Most of this is data at the moment, ensuring data can be gathered efficiently without slowing down the host from it's main job of running virtual machines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // XML errors ErrGetXML = errors.New("error getting XML") ErrParseXML = errors.New("error parsing XML") // Hostinfo errors ErrHostInfo = errors.New("error processing HostInfo") )
var ( URI_QEMU_LOCAL = Define("qemu", "local", "system") URI_QEMU_SSH = Define("qemu", "ssh", "system") )
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct { // HostName used to make the connection HostName string // SystemHostName is the hostname as reported by the system itself SystemHostName string // LibVersion is the version of Libvirt on the host LibVersion uint32 // SysInfo is the XML representation of the host system information SysInfo string // Alive indicates if the connection is alive Alive bool // Encrypted indicates if the connection is encrypted Encrypted bool // Secure indicates if the connection is secure Secure bool // HostInfo provides basic HW information about a host HostInfo *libvirtxml.CapsHost // NodeMemory provides basic memory information about the Host NodeMemory *NodeMemoryInfo // VMList is the list of virtual machines available to the host VMList []*libvirtxml.Domain // NetIfList is the list of network interfaces on the host NetIfFList []*libvirtxml.Interface // NetworkList is the list of defined networks on the host NetworkList []*libvirtxml.Network // DeviceList is the list of devices on the host DeviceList []*libvirtxml.NodeDevice // SecretList provides a list of secrets available to the host SecretList []*libvirtxml.Secret // StoragePoolList provides the list of stoarge ppols available to the host StoragePoolList []*libvirtxml.StoragePool // VolumeList is the list of volumes available on the host VolumeList []*libvirtxml.StorageVolume // contains filtered or unexported fields }
Host holds information and acts as a connection handle for a Host If a connection is closed prematurely, will re-open the connection and try the attempted method again
func ConnectHost ¶
ConnectHost creates a host connection wrapper that can be used regularly
type HostStats ¶
type HostStats struct {
// contains filtered or unexported fields
}
HostStats works as a handler that can be subscribed to. It runs a go routine that sends Stats via a channel when subscribed to
type NodeMemoryInfo ¶
NodeMemoryInfo provides statistis about node memory usage from libvirt.NodeMemoryStats
type Stats ¶
type Stats struct { Memory NodeMemoryInfo VMs []*libvirtxml.Domain StoragePools []*libvirtxml.StoragePool }
type URI ¶
URI is a string type, accessed via the pre-defined variables, and represent the URI pattern used to connect to a host. Example: Driver[+Transport]://<host or empty for local>[:PORT]/<path>[?Options&in=uri&format]
func Define ¶
Define create and return a custom URI method, following RFC2396, keeping in mind that the hostname will be inserted between the transport and path
func (*URI) ConnectionString ¶
ConnectionString takes a host name to interpolate into a URI and returns the string