Documentation
¶
Index ¶
- Constants
- Variables
- func BuildRvnDisks(topo Topo) error
- func Configure(withUserConfig bool)
- func ConfigureNode(topo Topo, node string)
- func ConfigureNodes(topo Topo, nodes []string)
- func CopyLocalFile(src, dst string) error
- func Create()
- func CreateNetbootImage() error
- func Destroy()
- func DomainInfo(topo, name string) (*xlibvirt.Domain, error)
- func DownloadFile(filepath string, url string) error
- func DownloadURL(parsedURL *url.URL, downloadPath string, imageName string) error
- func ExportNFS(topo Topo) error
- func GenConfig(h Host, topo Topo)
- func GenConfigAll(topo Topo)
- func Launch() []string
- func ListTopo()
- func ParseURL(parsedURL *url.URL) (path string, image string, err error)
- func Powerdown(nodes []string, force bool) error
- func Powerup(nodes []string) error
- func Reboot(rr RebootRequest) error
- func RecordTopo()
- func RemoveTopo()
- func RunApiserver(endpoint string)
- func RunModel() error
- func SaveTopo(t Topo) error
- func Shutdown() []error
- func SrcDir() (string, error)
- func Status() map[string]interface{}
- func UnexportNFS(topoName string) error
- func ValidateURL(input string) (*url.URL, error)
- func WipeNode(topo Topo, name string) error
- func WkDir() (string, error)
- type Alias
- type CPU
- type Disktype
- type DomStatus
- type Endpoint
- type Export
- type Host
- type Link
- type LinkStatus
- type Memory
- type Mount
- type Node
- type Options
- type Platform
- type Port
- type RebootRequest
- type Runtime
- type Topo
- type TopoInfo
- type UnitValue
- type Zwitch
Constants ¶
const ( // DefaultDiskBootOrder is used when one is not explicitly specified DefaultDiskBootOrder = 10 TopoFile = "topo.json" RavenDir = "/.rvn" )
Variables ¶
var Version = "undefined"
Version holds the raven version string
Functions ¶
func BuildRvnDisks ¶
BuildRvnDisks fills in missing disks, adding disks that do not exist.
func Configure ¶
func Configure(withUserConfig bool)
Configure runs the base and user level configurations over all nodes in a topology.
func ConfigureNode ¶
ConfigureNode runs the base and user level configuration for the specified node.
func ConfigureNodes ¶
ConfigureNodes configures a specified set of nodes.
func CopyLocalFile ¶
CopyLocalFile copies a file from point a to point b.
func Create ¶
func Create()
Create creates a libvirt definition for the supplied topology. It does not launch the system. For that functionality use the Launch function. If a topology with the same name as the topology provided as an argument exists, that topology will be overwritten by the system generated from the argument.
func CreateNetbootImage ¶
func CreateNetbootImage() error
CreateNetbootImage creates a netboot image
func Destroy ¶
func Destroy()
Destroy completely wipes out a topology with the given name. If the system is running within libvirt it is torn down. The entire definition of the system is also removed from libvirt.
func DomainInfo ¶
DomainInfo fetches the libvirt domain information about host within a raven topology
func DownloadFile ¶
DownloadFile downloads a file from a URL to the spefified path
func DownloadURL ¶
DownloadURL downloads an image from the specified URL
func GenConfigAll ¶
func GenConfigAll(topo Topo)
GenConfigAll generates base configurations for all nodes in a topology.
func Launch ¶
func Launch() []string
Launch brings up the system with the given name. This system must exist visa-vis the create function before calling Launch. The return value is a list of diagnostic strings that were provided by libvirt when launching the system. The existence of diagnostics does not necessarily indicate an error in launching. This function is asynchronous, when it returns the system is still launching. Use the Status function to check up on a the launch process.
func ParseURL ¶
ParseURL returns a path, which we will create a directory tree with path[0]/path[1]/.../path[n]/image
func RecordTopo ¶
func RecordTopo()
func RemoveTopo ¶
func RemoveTopo()
func RunApiserver ¶
func RunApiserver(endpoint string)
func RunModel ¶
func RunModel() error
RunModel executes a users raven model. Required images are downloaded. Libvirt specs are generated. Virtual disks are created. Table allocations are made.
func Status ¶
func Status() map[string]interface{}
Status returns the runtime status of a topology, node by node and network by network.
func UnexportNFS ¶
UnexportNFS removes all the NFS mount points created by a topology.
func ValidateURL ¶
ValidateURL wraps url validation with error reporting
Types ¶
type CPU ¶
type CPU struct { Sockets int `json:"sockets"` Cores int `json:"cores"` Threads int `json:"threads"` Model string `json:"arch"` Passthru bool `json:"passthru"` }
CPU describes the processor in a VM.
type Disktype ¶
type Disktype struct { Bus string `json:"bus"` Dev string `json:"dev"` Size string `json:"size"` Source string `json:"source"` BootOrder int `json:"bootorder"` }
Disktype describes a VM disk.
type DomStatus ¶
type DomStatus struct { Name string State string ConfigState string IP string Macs []string VNC int }
DomStatus encapsulates various information about a libvirt domain for purposes of serialization and presentation.
func DomainStatus ¶
DomainStatus returns the current state of a domain (host) within a libvirt topology.
type Export ¶
type Export struct {
Dir, Subnet string
}
Export encapsulates info about an NFS export
type Host ¶
type Host struct { Name string `json:"name"` Arch string `json:"arch"` Platform string `json:"platform"` Machine string `json:"machine"` Kernel string `json:"kernel"` Cmdline string `json:"cmdline"` Initrd string `json:"initrd"` Image string `json:"image"` OS string `json:"os"` Disks []*Disktype `json:"disks"` NoTestNet bool `json:"notestnet"` EBPF bool `json:"ebpf"` Mounts []Mount `json:"mounts"` CPU *CPU `json:"cpu,omitempty"` Memory *Memory `json:"memory,omitempty"` DefaultNic string `json:"defaultnic"` DefaultDisktype *Disktype `json:"defaultdisktype"` SysFirmware string `json:"firmware,omitempty"` Emulator string `json:"emulator"` Iommu bool `json:"iommu"` Video string `json:"video"` DedicatedDisk bool `json:"dedicateddisk"` DiskCache string `json:"diskcache"` VirtualClock bool `json:"vclock"` TelnetPort int // contains filtered or unexported fields }
Host describes a VM.
type Link ¶
type Link struct { Name string `json:"name"` Endpoints [2]Endpoint `json:"endpoints"` Props map[string]interface{} `json:"props"` AllowLACP bool `json:"lacp"` NoJumbo bool `json:"nojumbo"` V2V bool `json:"v2v"` }
Link descrbes a P2P link between VMs.
func (*Link) IsExternal ¶
type LinkStatus ¶
LinkStatus holds the status of a link.
type Memory ¶
type Memory struct {
Capacity UnitValue `json:"capacity"`
}
Memory describes the memory capacity of a VM.
type Node ¶
type Node struct {
Host
}
Node is a host, but carries the semantic that it is a regular node.
type Options ¶
type Options struct {
Display string `json:"display"`
}
Options contains various VM options
type Platform ¶
type Platform struct { Name string Arch string Machine string CPU *CPU Memory *Memory Kernel string Image string Cmdline string Initrd string Nic string Disktype *Disktype Emulator string DiskCache string }
Platform describes the default values for a given platform
type RebootRequest ¶
type RebootRequest struct { Topo string `json:"topo"` Nodes []string `json:"nodes"` Reset bool `json:"reset"` }
RebootRequest is used to reboot nodes.
type Runtime ¶
type Runtime struct { SubnetTable [256]bool SubnetReverseTable map[string]int TelnetPorts []int Topos map[string]TopoInfo }
Runtime tracks raven runtime state.
func (*Runtime) AllocateSubnet ¶
AllocateSubnet allocates a new subnet for a topology, updating the subnet allocation table.
func (*Runtime) FreeSubnet ¶
FreeSubnet frees a subnet from the subnet allocation table.
func (*Runtime) FreeTelnetPort ¶
FreeTelnetPort frees a telnet port, making it available again.
func (*Runtime) NewTelnetPort ¶
NewTelnetPort allocates a new telnet port for a VM.
func (*Runtime) RecordTopology ¶
func (*Runtime) RemoveTopology ¶
type Topo ¶
type Topo struct { Name string `json:"name"` Nodes []Node `json:"nodes"` Switches []Zwitch `json:"switches"` Links []Link `json:"links"` Dir string `json:"dir"` MgmtIP string `json:"mgmtip"` Options Options `json:"options"` SubnetOffset int `json:"subnetoffset"` Aliases []Alias `json:"aliases"` }
A Topo is a collection of nodes, switches an links.
func LoadTopoFile ¶
LoadTopoFile loads a topology from a json representation file at a specified path.
func (Topo) QualifyName ¶
QualifyName returns the topology qualified name of a host, link or switch.