Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigSpec ¶
func TaskConfigSpec ¶
Types ¶
type Config ¶
type Config struct {
Emulator *Emulator `codec:"emulator"`
Provider *Provider `codec:"provider"`
DataDir string `codec:"data_dir"`
ImagePaths []string `codec:"image_paths"` // allow-list of host paths to load
StoragePools *storage.Config `codec:"storage_pools"`
}
Config contains configuration information for the plugin
type TaskConfig ¶
type TaskConfig struct {
ImagePath string `codec:"image"`
Hostname string `codec:"hostname"`
OS *OS `codec:"os"`
UserData string `codec:"user_data"`
TimeZone *time.Location `codec:"timezone"`
CMDs []string `codec:"cmds"`
DefaultUserSSHKey string `codec:"default_user_authorized_ssh_key"`
DefaultUserPassword string `codec:"default_user_password"`
UseThinCopy bool `codec:"use_thin_copy"`
PrimaryDiskSize uint64 `codec:"primary_disk_size"`
Disks disks.Disks `codec:"disk"`
// The list of network interfaces that should be added to the VM.
net.NetworkInterfacesConfig `codec:"network_interface"`
}
TaskConfig contains configuration information for a task that runs within this plugin.
type VMGetter ¶
type VMGetter interface {
// GetVM gets information about the named virtual machine.
GetVM(name string) (*vm.Info, error)
}
VMGetter is a slim interface for retrieving information about virtual machines.
type Virtualizer ¶
type Virtualizer interface {
// Init is responsible for initialzing the virtualization
// provider. This is handled with a dedicated function to
// allow errors to be properly returned.
Init() error
// CreateVM creates new virtual machine using the provided
// configuration.
CreateVM(config *vm.Config) error
// StopVM stops the named virtual machine.
StopVM(name string) error
// DestroyVM destroys the named virtual machine.
DestroyVM(name string) error
// GetInfo returns information about the virtualization provider.
GetInfo() (vm.VirtualizerInfo, error)
// GetNetworkInterfaces returns the network interfaces for the
// named virtual machine.
GetNetworkInterfaces(name string) ([]vm.NetworkInterface, error)
// UseCloudInit informs if the provider supports cloud-init.
UseCloudInit() bool
// Networking returns the interface to the networking subsystem
Networking() (net.Net, error)
// Fingerprint returns fingerprint attributes for the provider
Fingerprint() (map[string]*structs.Attribute, error)
// SetupStorage prepares the configured storage pools for usage
SetupStorage(config *storage.Config) error
// Storage returns the storage interface
Storage() storage.Storage
// GenerateMountCommands generates the commands required to mount
// the provided mount configurations in the virtual machine.
GenerateMountCommands([]*vm.MountFileConfig) ([]string, error)
VMGetter
}
Provider is the interface that defins the virtualization system.
Click to show internal directories.
Click to hide internal directories.