Documentation
¶
Overview ¶
Package virtmon watches the state changes of the libvirt domains, and publishes them as pubsub events, for the instances holding a kvm resource to evaluate their status again.
A domain changes state with no action of the node to tell: its guest shuts it down, its qemu dies, an admin destroys or migrates it by hand. Without the monitor, the change is seen at the next scheduled status: within the monitor schedule for a monitored resource, the status schedule otherwise, with the instance said up meanwhile.
It reads the event stream "virsh -r event --event lifecycle --loop" prints, on a read-only connection, while the node holds a kvm resource: a node holding none has no domain event to wait for, and the connection would keep a socket-activated libvirtd running (see package evwatch). A stream ending, as libvirtd restarting ends it, runs again after a delay, and the domains held are refreshed once it runs. Where virsh is not installed, or too old to print the events, the monitor disables itself and says so once, until no kvm resource is left.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager watches the libvirt domain events and publishes a VirtDomainUpdated message for each domain of the local instances whose state changed.
func NewManager ¶
func NewManager(drainDuration time.Duration, subQS pubsub.QueueSizer) *Manager
NewManager creates a new libvirt monitor manager