Documentation ¶
Index ¶
- Constants
- func CommHost(state multistep.StateBag) (string, error)
- func ExecuteGuestSSHCmd(state multistep.StateBag, cmd string) (stdout string, err error)
- func ExecuteHostSSHCmd(state multistep.StateBag, cmd string) (stdout string, err error)
- func FindPort(portMin uint, portMax uint) (net.Listener, uint)
- func HTTPUpload(import_url string, fh *os.File, state multistep.StateBag) (result *xsclient.XenAPIObject, err error)
- func HimnSSHIP(state multistep.StateBag) (string, error)
- func HimnSSHPort(state multistep.StateBag) (uint, error)
- func InstanceSSHIP(state multistep.StateBag) (string, error)
- func InstanceSSHPort(state multistep.StateBag) (uint, error)
- func InstanceVNCIP(state multistep.StateBag) (string, error)
- func InstanceVNCPort(state multistep.StateBag) (uint, error)
- func NewArtifact(dir string) (packer.Artifact, error)
- func SSHAddress(state multistep.StateBag) (string, error)
- func SSHConfigFunc(config SSHConfig) func(multistep.StateBag) (*gossh.ClientConfig, error)
- func SSHLocalAddress(state multistep.StateBag) (string, error)
- func SSHPort(state multistep.StateBag) (int, error)
- type APIResult
- type CommonConfig
- type Host
- type IPSnooper
- type InterruptedError
- type InterruptibleWait
- type LocalArtifact
- type Network
- type PIF
- type Pool
- type PredicateResult
- type SR
- type SSHConfig
- type StepAttachVdi
- type StepBootWait
- type StepDetachVdi
- type StepExport
- type StepFindVdi
- type StepForwardPortOverSSH
- type StepGetVNCPort
- type StepHTTPServer
- type StepPrepareOutputDir
- type StepSetVmHostSshAddress
- type StepShutdown
- type StepStartOnHIMN
- type StepStartVmPaused
- type StepTypeBootCommand
- type StepUploadVdi
- type StepWaitForIP
- type Task
- type TaskStatusType
- type TimeoutError
- type TransferRecord
- type VBD
- type VDI
- type VDIType
- type VIF
- type VM
- func (self *VM) CleanShutdown() (err error)
- func (self *VM) Clone(label string) (new_instance *VM, err error)
- func (self *VM) ConnectNetwork(network *Network, device string) (vif *VIF, err error)
- func (self *VM) ConnectVdi(vdi *VDI, vdiType VDIType) (err error)
- func (self *VM) Destroy() (err error)
- func (self *VM) DisconnectVdi(vdi *VDI) error
- func (self *VM) GetDisks() (vdis []*VDI, err error)
- func (self *VM) GetDomainId() (domid string, err error)
- func (self *VM) GetGuestMetrics() (metrics map[string]interface{}, err error)
- func (self *VM) GetGuestMetricsRef() (ref string, err error)
- func (self *VM) GetPowerState() (state string, err error)
- func (self *VM) GetUuid() (uuid string, err error)
- func (self *VM) GetVBDs() (vbds []VBD, err error)
- func (self *VM) GetVIFs() (vifs []VIF, err error)
- func (self *VM) HardShutdown() (err error)
- func (self *VM) SetHVMBoot(policy, bootOrder string) (err error)
- func (self *VM) SetIsATemplate(is_a_template bool) (err error)
- func (self *VM) SetPVBootloader(pv_bootloader, pv_args string) (err error)
- func (self *VM) SetPlatform(params map[string]string) (err error)
- func (self *VM) SetStaticMemoryRange(min, max uint) (err error)
- func (self *VM) Start(paused, force bool) (err error)
- func (self *VM) Unpause() (err error)
- type XenAPIClient
- func (client *XenAPIClient) APICall(result *APIResult, method string, params ...interface{}) (err error)
- func (client *XenAPIClient) CreateTask() (task *Task, err error)
- func (client *XenAPIClient) GetDefaultSR() (sr *SR, err error)
- func (client *XenAPIClient) GetHosts() (hosts []*Host, err error)
- func (client *XenAPIClient) GetNetworkByNameLabel(name_label string) (networks []*Network, err error)
- func (client *XenAPIClient) GetNetworkByUuid(network_uuid string) (network *Network, err error)
- func (client *XenAPIClient) GetPIFs() (pifs []*PIF, err error)
- func (client *XenAPIClient) GetPools() (pools []*Pool, err error)
- func (client *XenAPIClient) GetSRByNameLabel(name_label string) (srs []*SR, err error)
- func (client *XenAPIClient) GetSRByUuid(sr_uuid string) (sr *SR, err error)
- func (client *XenAPIClient) GetVMByNameLabel(name_label string) (vms []*VM, err error)
- func (client *XenAPIClient) GetVMByUuid(vm_uuid string) (vm *VM, err error)
- func (client *XenAPIClient) GetVdiByNameLabel(name_label string) (vdis []*VDI, err error)
- func (client *XenAPIClient) GetVdiByUuid(vdi_uuid string) (vdi *VDI, err error)
- func (client *XenAPIClient) Login() (err error)
- func (c *XenAPIClient) RPCCall(result interface{}, method string, params []interface{}) (err error)
- type XenAPIObject
Constants ¶
View Source
const BuilderId = "packer.xenserver"
This is the common builder ID to all of these artifacts.
View Source
const KeyLeftShift uint = 0xFFE1
Variables ¶
This section is empty.
Functions ¶
func ExecuteGuestSSHCmd ¶
func ExecuteHostSSHCmd ¶
func FindPort ¶
FindPort finds and starts listening on a port in the range [portMin, portMax] returns the listener and the port number on success, or nil, 0 on failure
func HTTPUpload ¶
func SSHConfigFunc ¶
Types ¶
type CommonConfig ¶
type CommonConfig struct { Username string `mapstructure:"remote_username"` Password string `mapstructure:"remote_password"` HostIp string `mapstructure:"remote_host"` VMName string `mapstructure:"vm_name"` VMDescription string `mapstructure:"vm_description"` SrName string `mapstructure:"sr_name"` FloppyFiles []string `mapstructure:"floppy_files"` NetworkNames []string `mapstructure:"network_names"` ExportNetworkNames []string `mapstructure:"export_network_names"` HostPortMin uint `mapstructure:"host_port_min"` HostPortMax uint `mapstructure:"host_port_max"` BootCommand []string `mapstructure:"boot_command"` ShutdownCommand string `mapstructure:"shutdown_command"` RawBootWait string `mapstructure:"boot_wait"` BootWait time.Duration ToolsIsoName string `mapstructure:"tools_iso_name"` HTTPDir string `mapstructure:"http_directory"` HTTPPortMin uint `mapstructure:"http_port_min"` HTTPPortMax uint `mapstructure:"http_port_max"` // SSHHostPortMin uint `mapstructure:"ssh_host_port_min"` // SSHHostPortMax uint `mapstructure:"ssh_host_port_max"` SSHKeyPath string `mapstructure:"ssh_key_path"` SSHPassword string `mapstructure:"ssh_password"` SSHPort uint `mapstructure:"ssh_port"` SSHUser string `mapstructure:"ssh_username"` SSHConfig `mapstructure:",squash"` RawSSHWaitTimeout string `mapstructure:"ssh_wait_timeout"` SSHWaitTimeout time.Duration OutputDir string `mapstructure:"output_directory"` Format string `mapstructure:"format"` KeepVM string `mapstructure:"keep_vm"` IPGetter string `mapstructure:"ip_getter"` }
func (CommonConfig) GetSR ¶
func (config CommonConfig) GetSR(client xsclient.XenAPIClient) (*xsclient.SR, error)
func (*CommonConfig) Prepare ¶
func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error
func (CommonConfig) ShouldKeepVM ¶
func (c CommonConfig) ShouldKeepVM(state multistep.StateBag) bool
steps should check config.ShouldKeepVM first before cleaning up the VM
type InterruptedError ¶
type InterruptedError struct{}
func (InterruptedError) Error ¶
func (err InterruptedError) Error() string
type InterruptibleWait ¶
type InterruptibleWait struct { Timeout time.Duration // optional: Predicate func() (result bool, err error) PredicateInterval time.Duration }
func (InterruptibleWait) Wait ¶
func (wait InterruptibleWait) Wait(state multistep.StateBag) error
Wait waits for up to Timeout duration, checking an optional Predicate every PredicateInterval duration.
The first run of Predicate is immediately after Wait is called. If the command is interrupted by the user, then an InterruptedError is returned. If Predicate is not nil, a timeout leads to TimeoutError being returned, and a successful Predicate run leads to nil being returned. If Predicate is nil, a timeout is not an error, and nil is returned.
type LocalArtifact ¶
type LocalArtifact struct {
// contains filtered or unexported fields
}
func (*LocalArtifact) BuilderId ¶
func (*LocalArtifact) BuilderId() string
func (*LocalArtifact) Destroy ¶
func (a *LocalArtifact) Destroy() error
func (*LocalArtifact) Files ¶
func (a *LocalArtifact) Files() []string
func (*LocalArtifact) Id ¶
func (*LocalArtifact) Id() string
func (*LocalArtifact) State ¶
func (a *LocalArtifact) State(name string) interface{}
func (*LocalArtifact) String ¶
func (a *LocalArtifact) String() string
type Network ¶
type Network XenAPIObject
type PIF ¶
type PIF XenAPIObject
type Pool ¶
type Pool XenAPIObject
type PredicateResult ¶
type PredicateResult struct {
// contains filtered or unexported fields
}
type SR ¶
type SR XenAPIObject
type SSHConfig ¶
type SSHConfig struct { Comm communicator.Config `mapstructure:",squash"` SSHHostPortMin uint `mapstructure:"ssh_host_port_min"` SSHHostPortMax uint `mapstructure:"ssh_host_port_max"` SSHSkipNatMapping bool `mapstructure:"ssh_skip_nat_mapping"` // These are deprecated, but we keep them around for BC // TODO(@mitchellh): remove SSHKeyPath string `mapstructure:"ssh_key_path"` SSHWaitTimeout time.Duration `mapstructure:"ssh_wait_timeout"` }
type StepAttachVdi ¶
type StepAttachVdi struct { VdiUuidKey string VdiType xsclient.VDIType // contains filtered or unexported fields }
func (*StepAttachVdi) Cleanup ¶
func (self *StepAttachVdi) Cleanup(state multistep.StateBag)
func (*StepAttachVdi) Run ¶
func (self *StepAttachVdi) Run(state multistep.StateBag) multistep.StepAction
type StepBootWait ¶
type StepBootWait struct{}
func (*StepBootWait) Cleanup ¶
func (self *StepBootWait) Cleanup(state multistep.StateBag)
func (*StepBootWait) Run ¶
func (self *StepBootWait) Run(state multistep.StateBag) multistep.StepAction
type StepDetachVdi ¶
type StepDetachVdi struct {
VdiUuidKey string
}
func (*StepDetachVdi) Cleanup ¶
func (self *StepDetachVdi) Cleanup(state multistep.StateBag)
func (*StepDetachVdi) Run ¶
func (self *StepDetachVdi) Run(state multistep.StateBag) multistep.StepAction
type StepExport ¶
type StepExport struct{}
func (StepExport) Cleanup ¶
func (StepExport) Cleanup(state multistep.StateBag)
func (StepExport) Run ¶
func (StepExport) Run(state multistep.StateBag) multistep.StepAction
type StepFindVdi ¶
func (*StepFindVdi) Cleanup ¶
func (self *StepFindVdi) Cleanup(state multistep.StateBag)
func (*StepFindVdi) Run ¶
func (self *StepFindVdi) Run(state multistep.StateBag) multistep.StepAction
type StepForwardPortOverSSH ¶
type StepForwardPortOverSSH struct { RemotePort func(state multistep.StateBag) (uint, error) RemoteDest func(state multistep.StateBag) (string, error) HostPortMin uint HostPortMax uint ResultKey string }
func (*StepForwardPortOverSSH) Cleanup ¶
func (self *StepForwardPortOverSSH) Cleanup(state multistep.StateBag)
func (*StepForwardPortOverSSH) Run ¶
func (self *StepForwardPortOverSSH) Run(state multistep.StateBag) multistep.StepAction
type StepGetVNCPort ¶
type StepGetVNCPort struct{}
func (*StepGetVNCPort) Cleanup ¶
func (self *StepGetVNCPort) Cleanup(state multistep.StateBag)
func (*StepGetVNCPort) Run ¶
func (self *StepGetVNCPort) Run(state multistep.StateBag) multistep.StepAction
type StepHTTPServer ¶
type StepHTTPServer struct { Chan chan<- string // contains filtered or unexported fields }
This step creates and runs the HTTP server that is serving files from the directory specified by the 'http_directory` configuration parameter in the template.
Uses:
config *config ui packer.Ui
Produces:
http_port int - The port the HTTP server started on.
func (*StepHTTPServer) Cleanup ¶
func (s *StepHTTPServer) Cleanup(multistep.StateBag)
func (*StepHTTPServer) Run ¶
func (s *StepHTTPServer) Run(state multistep.StateBag) multistep.StepAction
type StepPrepareOutputDir ¶
func (*StepPrepareOutputDir) Cleanup ¶
func (self *StepPrepareOutputDir) Cleanup(state multistep.StateBag)
func (*StepPrepareOutputDir) Run ¶
func (self *StepPrepareOutputDir) Run(state multistep.StateBag) multistep.StepAction
type StepSetVmHostSshAddress ¶
type StepSetVmHostSshAddress struct{}
func (*StepSetVmHostSshAddress) Cleanup ¶
func (self *StepSetVmHostSshAddress) Cleanup(state multistep.StateBag)
func (*StepSetVmHostSshAddress) Run ¶
func (self *StepSetVmHostSshAddress) Run(state multistep.StateBag) multistep.StepAction
type StepShutdown ¶
type StepShutdown struct{}
func (StepShutdown) Cleanup ¶
func (StepShutdown) Cleanup(state multistep.StateBag)
func (StepShutdown) Run ¶
func (StepShutdown) Run(state multistep.StateBag) multistep.StepAction
type StepStartOnHIMN ¶
type StepStartOnHIMN struct{}
func (*StepStartOnHIMN) Cleanup ¶
func (self *StepStartOnHIMN) Cleanup(state multistep.StateBag)
func (*StepStartOnHIMN) Run ¶
func (self *StepStartOnHIMN) Run(state multistep.StateBag) multistep.StepAction
type StepStartVmPaused ¶
type StepStartVmPaused struct{}
func (*StepStartVmPaused) Cleanup ¶
func (self *StepStartVmPaused) Cleanup(state multistep.StateBag)
func (*StepStartVmPaused) Run ¶
func (self *StepStartVmPaused) Run(state multistep.StateBag) multistep.StepAction
type StepTypeBootCommand ¶
type StepTypeBootCommand struct {
Ctx interpolate.Context
}
func (*StepTypeBootCommand) Cleanup ¶
func (self *StepTypeBootCommand) Cleanup(multistep.StateBag)
func (*StepTypeBootCommand) Run ¶
func (self *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction
type StepUploadVdi ¶
type StepUploadVdi struct { VdiNameFunc func() string ImagePathFunc func() string VdiUuidKey string }
func (*StepUploadVdi) Cleanup ¶
func (self *StepUploadVdi) Cleanup(state multistep.StateBag)
func (*StepUploadVdi) Run ¶
func (self *StepUploadVdi) Run(state multistep.StateBag) multistep.StepAction
type StepWaitForIP ¶
func (*StepWaitForIP) Cleanup ¶
func (self *StepWaitForIP) Cleanup(state multistep.StateBag)
func (*StepWaitForIP) Run ¶
func (self *StepWaitForIP) Run(state multistep.StateBag) multistep.StepAction
type Task ¶
type Task XenAPIObject
func (*Task) GetErrorInfo ¶
func (*Task) GetProgress ¶
func (*Task) GetResult ¶
func (self *Task) GetResult() (object *XenAPIObject, err error)
func (*Task) GetStatus ¶
func (self *Task) GetStatus() (status TaskStatusType, err error)
type TaskStatusType ¶
type TaskStatusType int
const ( Pending TaskStatusType Success Failure Cancelling Cancelled )
type TimeoutError ¶
type TimeoutError struct{}
func (TimeoutError) Error ¶
func (err TimeoutError) Error() string
type TransferRecord ¶
type TransferRecord struct {
UrlFull string `xml:"url_full,attr"`
}
type VDI ¶
type VDI XenAPIObject
type VM ¶
type VM XenAPIObject
func (*VM) CleanShutdown ¶
func (*VM) ConnectNetwork ¶
func (*VM) DisconnectVdi ¶
func (*VM) GetDomainId ¶
func (*VM) GetGuestMetrics ¶
func (*VM) GetGuestMetricsRef ¶
func (*VM) GetPowerState ¶
func (*VM) HardShutdown ¶
func (*VM) SetHVMBoot ¶
func (*VM) SetIsATemplate ¶
func (*VM) SetPVBootloader ¶
func (*VM) SetStaticMemoryRange ¶
type XenAPIClient ¶
type XenAPIClient struct { Session interface{} Host string Url string Username string Password string RPC *xmlrpc.Client }
func NewXenAPIClient ¶
func NewXenAPIClient(host, username, password string) (client XenAPIClient)
func (*XenAPIClient) APICall ¶
func (client *XenAPIClient) APICall(result *APIResult, method string, params ...interface{}) (err error)
func (*XenAPIClient) CreateTask ¶
func (client *XenAPIClient) CreateTask() (task *Task, err error)
func (*XenAPIClient) GetDefaultSR ¶
func (client *XenAPIClient) GetDefaultSR() (sr *SR, err error)
func (*XenAPIClient) GetHosts ¶
func (client *XenAPIClient) GetHosts() (hosts []*Host, err error)
func (*XenAPIClient) GetNetworkByNameLabel ¶
func (client *XenAPIClient) GetNetworkByNameLabel(name_label string) (networks []*Network, err error)
func (*XenAPIClient) GetNetworkByUuid ¶
func (client *XenAPIClient) GetNetworkByUuid(network_uuid string) (network *Network, err error)
func (*XenAPIClient) GetPIFs ¶
func (client *XenAPIClient) GetPIFs() (pifs []*PIF, err error)
func (*XenAPIClient) GetPools ¶
func (client *XenAPIClient) GetPools() (pools []*Pool, err error)
func (*XenAPIClient) GetSRByNameLabel ¶
func (client *XenAPIClient) GetSRByNameLabel(name_label string) (srs []*SR, err error)
func (*XenAPIClient) GetSRByUuid ¶
func (client *XenAPIClient) GetSRByUuid(sr_uuid string) (sr *SR, err error)
func (*XenAPIClient) GetVMByNameLabel ¶
func (client *XenAPIClient) GetVMByNameLabel(name_label string) (vms []*VM, err error)
func (*XenAPIClient) GetVMByUuid ¶
func (client *XenAPIClient) GetVMByUuid(vm_uuid string) (vm *VM, err error)
func (*XenAPIClient) GetVdiByNameLabel ¶
func (client *XenAPIClient) GetVdiByNameLabel(name_label string) (vdis []*VDI, err error)
func (*XenAPIClient) GetVdiByUuid ¶
func (client *XenAPIClient) GetVdiByUuid(vdi_uuid string) (vdi *VDI, err error)
func (*XenAPIClient) Login ¶
func (client *XenAPIClient) Login() (err error)
func (*XenAPIClient) RPCCall ¶
func (c *XenAPIClient) RPCCall(result interface{}, method string, params []interface{}) (err error)
type XenAPIObject ¶
type XenAPIObject struct { Ref string Client *XenAPIClient }
Source Files ¶
- artifact.go
- client.go
- common_config.go
- find_port.go
- http_upload.go
- interruptible_wait.go
- ssh.go
- ssh_config.go
- step_attach_vdi.go
- step_boot_wait.go
- step_detach_vdi.go
- step_export.go
- step_find_vdi.go
- step_forward_port_over_ssh.go
- step_get_vnc_port.go
- step_http_server.go
- step_prepare_output_dir.go
- step_set_vm_host_ssh_address.go
- step_shutdown.go
- step_start_on_himn.go
- step_start_vm_paused.go
- step_type_boot_command.go
- step_upload_vdi.go
- step_wait_for_ip.go
Click to show internal directories.
Click to hide internal directories.