Documentation ¶
Overview ¶
Package guest implements utilities and structured data for libvirt virtual machines
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrVMNotFound = errors.New("virtual machine not found")
ErrVMNotFound error when virtual machine is not found
Functions ¶
This section is empty.
Types ¶
type BlockIOParametersInfo ¶
type BlockIOParametersInfo struct { Weight uint DeviceWeight string DeviceReadIops string DeviceWriteIops string DeviceReadBps string DeviceWriteBps string }
BlockIOParametersInfo is the struct describing VM block IO parameters
type DiskInfo ¶
type DiskInfo struct { Name string Partition bool Alias string GuestAlias string DiskDependency []string }
DiskInfo is the struct for guest disk information, and is used in VM
type NetIFaceInfo ¶
NetIFaceInfo provides guest Network Interface information, and is used in VM
type OSInfo ¶
type OSInfo struct { ID string Name string PrettyName string Version string VersionID string KernelRelease string KernelVersion string Machine string Variant string VariantID string }
OSInfo is the struct for guest operating system information, and is used in VM
type TimeZoneInfo ¶
TimeZoneInfo provides guest timezone information, and is used in VM
type VM ¶
type VM struct { Name string HostName string ID uint BackupXML string Autostart bool BlockIOParameters BlockIOParametersInfo Disks []DiskInfo Users []UserInfo OS OSInfo TimeZone TimeZoneInfo NetIFace []NetIFaceInfo // contains filtered or unexported fields }
VM holds a handle is used to communicate to Domains
type VMState ¶
type VMState uint8
VMState represents different states a virtual machine can be in Some states are mutually exclusive, but some can be applied at the same time. ie. A machine can be running, and migrating at the same time. A machine can be running, but had a failed migration
const ( // StateStopped means the VM isn't running StateStopped VMState = iota // StateRunning means the VM is currently running StateRunning // StateFailed means the VM is in a failed state, which can indicate a few things: // The VM healthcheck (not yet defined, but will be) has failed // A Migration has failed // Adding or removing a device has failed StateFailed // StateMigrated means the VM was successfully migrated to a new host StateMigrated // StateHealthy means the VM had a successful healthcheck the last time it was done StateHealthy // StateUnhealthy means the opposite of healthy, as in the VM has failed a health check StateUnhealthy // StateStarted means the VM has been turned on, but is not nesicarily available yet StateStarted // StateRestarted means a reboot was triggered, but hasn't be finished yet StateRestarted // StatePoweroff means a shutdown was triggered, but isn't finished yet StatePoweroff // StateMigrate means a migration was started, but isn't done yet StateMigrate // StateCreate means a VM is being created StateCreate // StateInstall means a VM is being installed. This usually implies from an ISO and // not an automated installation StateInstall // StateDestroy means a VM is scheduled or is in progress of being destroyed and deleted StateDestroy // StateBackup means a VM is in process of being backed up StateBackup // StateRestore means a VM is in process of being restored StateRestore )