Documentation
¶
Index ¶
Constants ¶
View Source
const ( VMStateStarting = VMState("starting") VMStateRunning = VMState("running") VMStateShutdown = VMState("shutdown") VMStatePowerOff = VMState("poweroff") VMStateSuspended = VMState("suspended") VMStatePaused = VMState("paused") VMStateError = VMState("error") VMStateUnknown = VMState("unknown") )
View Source
const ( // FingerprintAttributeKeyPrefix is the key prefix to use when creating and // adding attributes during the fingerprint process. FingerprintAttributeKeyPrefix = "driver.virt" )
Variables ¶
View Source
var ( ErrEmptyName = fmt.Errorf("%w - virtual machine name can not be empty", errs.ErrInvalidConfiguration) ErrMissingImage = fmt.Errorf("%w - image path can not be empty", errs.ErrInvalidConfiguration) ErrNotEnoughDisk = fmt.Errorf("%w - not enough disk space assigned to task", errs.ErrInvalidConfiguration) ErrNoCPUS = fmt.Errorf("%w - no cpus configured, use resources.cores to assign cores in the job spec", errs.ErrInvalidConfiguration) ErrNotEnoughMemory = fmt.Errorf("%w - not enough memory assigned to task", errs.ErrInvalidConfiguration) ErrIncompleteOSVariant = fmt.Errorf("%w - provided os information is incomplete: arch and machine are mandatory", errs.ErrInvalidConfiguration) ErrInvalidHostName = fmt.Errorf("%w - a resource name must consist of lower case alphanumeric characters or '-', must start and end with an alphanumeric character and be less than %d characters", errs.ErrInvalidConfiguration, maxNameLength+1) )
Functions ¶
func IsValidLabel ¶
IsValidLabel returns true if the string given is a valid DNS label (RFC 1123). Note: the only difference between RFC 1035 and RFC 1123 labels is that in RFC 1123 labels can begin with a number.
func ValidateHostName ¶
ValidateHostName returns an error a name is not a valid resource name. The error will contain reference to what constitutes a valid resource name.
Types ¶
type Config ¶
type Config struct {
RemoveConfigFiles bool
XMLConfig string
Name string
Memory uint
CPUset string
CPUs uint
OsVariant *OSVariant
HostName string
Timezone *time.Location
Mounts []MountFileConfig
Files []File
SSHKey string
Password string
CMDs []string
BOOTCMDs []string
CIUserData string
Volumes []storage.Volume
NetworkInterfaces net.NetworkInterfacesConfig
}
func (*Config) CloudInitConfig ¶
CloudInitConfig generates the cloud-init configuration from the configuration.
type MountFileConfig ¶
type NetworkInterface ¶
Click to show internal directories.
Click to hide internal directories.