Documentation
¶
Index ¶
- func BuildConnection() libvirt.VirConnection
- func CopyFile(src, dst string) error
- func CopyImage(imgName, vmName, size string) error
- func CreateCloudConfig(vmName, userData string) (string, error)
- func DeleteNetwork(uuid string)
- func DownloadImage(path, name string) error
- func GenerateMAC() string
- func GetAvailableImages() []string
- func GetImagePath(name string) string
- func GetVMPrimaryDiskName(vmName string) string
- func InitStorage()
- func StartVM(name string)
- func StopVM(name string)
- type Bridge
- type DHCPRange
- type Disk
- type Forward
- type Graphics
- type IPAddress
- type Interface
- type MAC
- type Model
- type Network
- type Source
- type Target
- type VM
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConnection ¶
func BuildConnection() libvirt.VirConnection
BuildConnection builds a local libvirt connection to qemu
func CreateCloudConfig ¶
CreateCloudConfig generates valid cloud-init images for vms
func DeleteNetwork ¶
func DeleteNetwork(uuid string)
func DownloadImage ¶
func GetAvailableImages ¶
func GetAvailableImages() []string
func GetImagePath ¶
func GetVMPrimaryDiskName ¶
func InitStorage ¶
func InitStorage()
Types ¶
type Network ¶
type Network struct {
XMLName xml.Name `xml:"network" json:"-"`
Name string `xml:"name" json:"name"`
UUID string `xml:"uuid" json:"uuid"`
Forward Forward `xml:"forward" json:"forward"`
Bridge Bridge `xml:"bridge" json:"bridge"`
IPs []IPAddress `xml:"ip" json:"ip"`
Active bool `json:"active"`
}
func CreateBridgedNetwork ¶
func CreateNATNetwork ¶
CreateNATNetwork creates a new NAT network
type VM ¶
type VM struct {
XMLName xml.Name `xml:"domain" json:"-"`
Name string `xml:"name" json:"name"`
UUID string `xml:"uuid" json:"uuid"`
Memory int `xml:"memory" json:"memory"`
Cpus int `xml:"vcpu" json:"cpus"`
Active bool `json:"active"`
Disks []Disk `xml:"devices>disk" json:"disks"`
Interface []Interface `xml:"devices>interface" json:"interfaces"`
Graphics Graphics `xml:"devices>graphics" json:"graphics"`
}
Click to show internal directories.
Click to hide internal directories.