Documentation ¶
Index ¶
- Constants
- func AttachInterface(id string, nic NetworkInterface) error
- func DomainNameToID(domainname string) string
- func Ensure(instance *protos.Instance) error
- func IDToDomainName(resourceID string) string
- func Start(ctx context.Context, id string) error
- func Stop(ctx context.Context, id string, graceful bool) error
- type AllNICs
- type LegacyInstance
- func (i LegacyInstance) Create(conn *libvirt.Connect) error
- func (i LegacyInstance) DomainName() string
- func (i LegacyInstance) GetDomain(conn *libvirt.Connect) (*libvirt.Domain, error)
- func (i LegacyInstance) GetDomainXML(conn *libvirt.Connect) (libvirtxml.Domain, error)
- func (i LegacyInstance) RootVolumeName() string
- type NICFilters
- type NetworkInterface
- type SpecialCase
Constants ¶
View Source
const (
// BootstrapNetworkName is the name of the ephemeral libvirt network used for bootstrapping the cluster
BootstrapNetworkName = "rhyzome-bootstrap-network"
)
Variables ¶
This section is empty.
Functions ¶
func AttachInterface ¶
func AttachInterface(id string, nic NetworkInterface) error
AttachInterface to an existing instance if nic.Tagged and the MAC matches an existing interface, the tagged vlan will be added to the existing port
func DomainNameToID ¶
func IDToDomainName ¶
Types ¶
type AllNICs ¶
type AllNICs map[string]NICFilters
type LegacyInstance ¶
type LegacyInstance struct { ID string // The instance ID Image string // Image is the URL of the image to write to the root disk DiskSizeGB int // DiskSizeGB is the size (in gigabytes) to allocate for the root disk MemoryMB int // MemoryMB is the amount of memory (RAM) to allocate to the instance Cores int // Cores is the number of CPU cores to allocate to the instance Volumes []string // Volumes is a list of volume IDs to attach to this instance NetworkInterfaces []NetworkInterface // a list of NICs for this instance SpecialCases []SpecialCase // SpecialCase is a list of special cases to apply. See SpecialCase type for options and details. Do not allow to be written by the API. Smbios map[int]map[string]string // Smbios is the smbios data to pass to qemu. int key is type, string key is smbios field, value is value. See https://gist.github.com/smoser/290f74c256c89cb3f3bd434a27b9f64c for mappings }
LegacyInstance represents an virtual machine. But it's 2023 so we call them "instances"
func (LegacyInstance) Create ¶
func (i LegacyInstance) Create(conn *libvirt.Connect) error
Create the instance in libvirt
func (LegacyInstance) DomainName ¶
func (i LegacyInstance) DomainName() string
func (LegacyInstance) GetDomainXML ¶
func (i LegacyInstance) GetDomainXML(conn *libvirt.Connect) (libvirtxml.Domain, error)
func (LegacyInstance) RootVolumeName ¶
func (i LegacyInstance) RootVolumeName() string
RootVolumeName returns the name of the instance's root volume
type NICFilters ¶
type NetworkInterface ¶
NetworkInterface is a NIC to attach to an instance
type SpecialCase ¶
type SpecialCase string
SpecialCase are different instance configurations that can be requested
var ( // SpecialCaseRouter means the instance gets a WAN port, maybe some other stuff SpecialCaseRouter SpecialCase = "router" // SpecialCaseCloudInitNoCloud passes the configured metadata server to the instance via qemu's -smbios flag SpecialCaseCloudInitNoCloud SpecialCase = "cloud-init-nocloud" // SpecialCaseControlNetwork causes an instance to be added to the control network SpecialCaseControlNetwork SpecialCase = "control-network" )
Click to show internal directories.
Click to hide internal directories.