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 InstanceConsoleLocation(state multistep.StateBag) (string, error)
- func InstanceSSHIP(state multistep.StateBag) (string, error)
- func InstanceSSHPort(state multistep.StateBag) (uint, error)
- func InstanceVNCIP(state multistep.StateBag) (string, 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 CommonConfig
- func (config CommonConfig) GetISOSR(client xsclient.XenAPIClient) (*xsclient.SR, error)
- func (config CommonConfig) GetSR(client xsclient.XenAPIClient) (*xsclient.SR, error)
- func (c *CommonConfig) Prepare(ctx *interpolate.Context, pc *common.PackerConfig) []error
- func (c CommonConfig) ShouldKeepVM(state multistep.StateBag) bool
- type IPSnooper
- type InterruptedError
- type InterruptibleWait
- type LocalArtifact
- type PredicateResult
- type SSHConfig
- type StepAttachVdi
- type StepBootWait
- type StepDetachVdi
- type StepExport
- type StepFindVdi
- type StepForwardPortOverSSH
- type StepGetConsoleLocation
- type StepHTTPServer
- type StepPrepareOutputDir
- type StepShutdown
- type StepStartOnHIMN
- type StepStartVmPaused
- type StepTCPVNCProxy
- type StepTypeBootCommand
- type StepUploadVdi
- type StepWaitForIP
- type TimeoutError
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 InstanceConsoleLocation ¶
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"` NetworkName string `mapstructure:"network_name"` 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) GetISOSR ¶
func (config CommonConfig) GetISOSR(client xsclient.XenAPIClient) (*xsclient.SR, error)
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 PredicateResult ¶
type PredicateResult struct {
// contains filtered or unexported fields
}
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 (s *StepAttachVdi) Cleanup(state multistep.StateBag)
func (*StepAttachVdi) Run ¶
func (s *StepAttachVdi) Run(state multistep.StateBag) multistep.StepAction
type StepBootWait ¶
type StepBootWait struct{}
func (*StepBootWait) Cleanup ¶
func (s *StepBootWait) Cleanup(state multistep.StateBag)
func (*StepBootWait) Run ¶
func (s *StepBootWait) Run(state multistep.StateBag) multistep.StepAction
type StepDetachVdi ¶
type StepDetachVdi struct {
VdiUuidKey string
}
func (*StepDetachVdi) Cleanup ¶
func (s *StepDetachVdi) Cleanup(state multistep.StateBag)
func (*StepDetachVdi) Run ¶
func (s *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 (s *StepFindVdi) Cleanup(state multistep.StateBag)
func (*StepFindVdi) Run ¶
func (s *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 (s *StepForwardPortOverSSH) Cleanup(state multistep.StateBag)
func (*StepForwardPortOverSSH) Run ¶
func (s *StepForwardPortOverSSH) Run(state multistep.StateBag) multistep.StepAction
type StepGetConsoleLocation ¶
type StepGetConsoleLocation struct{}
func (*StepGetConsoleLocation) Cleanup ¶
func (s *StepGetConsoleLocation) Cleanup(state multistep.StateBag)
func (*StepGetConsoleLocation) Run ¶
func (s *StepGetConsoleLocation) 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 (s *StepPrepareOutputDir) Cleanup(state multistep.StateBag)
func (*StepPrepareOutputDir) Run ¶
func (s *StepPrepareOutputDir) 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 (s *StepStartOnHIMN) Cleanup(state multistep.StateBag)
func (*StepStartOnHIMN) Run ¶
func (s *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 StepTCPVNCProxy ¶
type StepTCPVNCProxy struct { RemoteConsole func(state multistep.StateBag) (string, error) HostPortMin uint HostPortMax uint }
func (*StepTCPVNCProxy) Cleanup ¶
func (s *StepTCPVNCProxy) Cleanup(state multistep.StateBag)
func (*StepTCPVNCProxy) Run ¶
func (s *StepTCPVNCProxy) Run(state multistep.StateBag) multistep.StepAction
type StepTypeBootCommand ¶
type StepTypeBootCommand struct { BootCommand []string VMName string Ctx interpolate.Context }
func (*StepTypeBootCommand) Cleanup ¶
func (s *StepTypeBootCommand) Cleanup(multistep.StateBag)
func (*StepTypeBootCommand) Run ¶
func (s *StepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction
type StepUploadVdi ¶
type StepUploadVdi struct { VdiNameFunc func() string ImagePathFunc func() string VdiUuidKey string }
func (*StepUploadVdi) Cleanup ¶
func (s *StepUploadVdi) Cleanup(state multistep.StateBag)
func (*StepUploadVdi) Run ¶
func (s *StepUploadVdi) Run(state multistep.StateBag) multistep.StepAction
type StepWaitForIP ¶
func (*StepWaitForIP) Cleanup ¶
func (s *StepWaitForIP) Cleanup(state multistep.StateBag)
func (*StepWaitForIP) Run ¶
func (s *StepWaitForIP) Run(state multistep.StateBag) multistep.StepAction
type TimeoutError ¶
type TimeoutError struct{}
func (TimeoutError) Error ¶
func (err TimeoutError) Error() string
Source Files ¶
- artifact.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_console_location.go
- step_http_server.go
- step_prepare_output_dir.go
- step_shutdown.go
- step_start_on_himn.go
- step_start_vm_paused.go
- step_tcp_vnc_proxy.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.