Commit Graph

62 Commits

Author SHA1 Message Date
Cheng Sun
971ab83376 Fix comment typo 2014-12-11 15:40:16 +00:00
Cheng Sun
13ca6ef95b export_format: allow export format to be configured
"export_format" can be one of "xva" (default), "vdi_raw"
2014-12-11 14:30:51 +00:00
Cheng Sun
322817e827 Fix export UUID 2014-12-11 14:19:28 +00:00
Cheng Sun
783eee0a39 Add user variables to template processor 2014-12-11 12:28:25 +00:00
Cheng Sun
6180bd1ca5 Add keep_instance to example config 2014-12-10 18:32:27 +00:00
Cheng Sun
b433754c83 Factor out common port-finding code
Fixes bug where we would infinite-loop trying to find an HTTP server
port when all ports were unavailable (e.g. range [80,80] and no root
permission)

Also fixes bug where SSH port forwarding would try ports up to but not
including HostPortMax.

Also add clarification in error messages for which port range to expand
2014-12-10 16:18:54 +00:00
Cheng Sun
602255e9c1 Add keep_instance parameter
Determines when to keep the VM instance and when to clean it up
Can be one of "always", "never" (default), "on_success"
2014-12-10 12:32:41 +00:00
Cheng Sun
97ca6d5cab Also close listener connection when port forwarding fails
Follow-up to 97df6fd283
that actually fixes the "Waiting for SSH" hang
2014-12-10 12:31:02 +00:00
Cheng Sun
649798b4ac Separate config defaults from validation 2014-12-10 11:22:31 +00:00
Cheng Sun
a9fb6532ae Improve HIMN IP-finding error handling
Previous code could dereference nil if there was no error, but an
empty IP was found
2014-12-10 10:41:59 +00:00
Rob Dobson
25a2200f50 Merge pull request #6 from chengsun/master
Fixing up a lot of the ignored error handling.
2014-12-10 10:29:25 +00:00
Cheng Sun
4cd0fcf288 example config: explicitly state units in install_timeout 2014-12-10 10:25:08 +00:00
Cheng Sun
ca80e009db Fix typo 2014-12-10 10:15:33 +00:00
Cheng Sun
490ff260c2 Update README to link to centos example directly 2014-12-10 10:14:18 +00:00
Cheng Sun
97df6fd283 Close SSH connections once we're done with them
Fixes "Waiting for SSH" hang at end of install
2014-12-09 17:44:21 +00:00
Cheng Sun
1450fd0568 Clean up VM instance and root VDI 2014-12-09 16:40:32 +00:00
Cheng Sun
acd16bb984 Make HIMN IP finding and ping interruptible 2014-12-09 16:32:37 +00:00
Cheng Sun
c75b4555cc Make boot_wait interruptible 2014-12-09 16:32:37 +00:00
Cheng Sun
ba7c5ddcd2 interruptible_wait: allow nil Predicate
Allow for the case where InterruptibleWait is used purely for the
timeout.
See the documentation string for details.
2014-12-09 16:32:37 +00:00
Cheng Sun
651274e508 interruptible_wait: evaluate Predicate immediately
Previous behaviour was to wait PredicateInterval before the first
time that the Predicate is evaluated
2014-12-09 16:32:37 +00:00
Cheng Sun
94dcf160df Don't close session twice 2014-12-09 16:32:37 +00:00
Cheng Sun
8a41cc693a Add more error handling 2014-12-09 14:02:48 +00:00
Cheng Sun
70e57a2d66 Add error handling to step_wait 2014-12-09 11:48:10 +00:00
Cheng Sun
c88168f4ba Replace all Fatal calls with Error calls 2014-12-09 11:48:07 +00:00
Cheng Sun
efbc365b6d fmt step_wait, interruptible_wait 2014-12-09 11:18:35 +00:00
Cheng Sun
cadf3a5d6a Add install_timeout to stop build if step_wait takes too long
Halts the build when the VM does not shutdown within the timeout period
Implemented with interruptible_wait, so step_wait is also interruptible
2014-12-09 10:48:34 +00:00
Cheng Sun
1dd963278f Add generic interruptible wait method 2014-12-09 10:45:52 +00:00
Cheng Sun
d9757f2c38 Revert "Add a pause to ensure SSH has a chance to start. This is a tempoary workaround for the fact that the SSH tunnel code will cause packer to halt if the destination does not exist."
This reverts commit fd35d7c984.
2014-12-09 10:45:52 +00:00
Cheng Sun
6071be1572 Don't create Artifact if there were errors
Prevents nil-dereference crash when errors occur
2014-12-09 10:45:52 +00:00
Rob Dobson
50403a3ed6 Merge pull request #5 from chengsun/master
Minor cosmetic changes
2014-12-08 18:34:55 +00:00
Cheng Sun
1de826270c Capitalise SSHWaitTimeout for consistency 2014-12-08 16:12:18 +00:00
Cheng Sun
ee0d6d38e0 Replace reflect with type assertion 2014-12-08 16:01:12 +00:00
Cheng Sun
e6e8855da4 Use log.Printf instead of log.Fatalf 2014-12-08 15:56:10 +00:00
Cheng Sun
bf92b3abff Update README to reflect increased disk size
Changed in d48d46306f
2014-12-08 15:39:37 +00:00
Cheng Sun
91c1326bc4 Cosmetic: fix typo in log message 2014-12-08 15:37:36 +00:00
Cheng Sun
2dbe047d45 Cosmetic: go fmt 2014-12-08 15:36:38 +00:00
Rob Dobson
538966204c Merge branch 'examples' 2014-11-24 18:18:18 +00:00
Rob Dobson
fd35d7c984 Add a pause to ensure SSH has a chance to start. This is a tempoary workaround for the fact that the SSH tunnel code will cause packer to halt if the destination does not exist.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-24 18:16:56 +00:00
Rob Dobson
68ccc25108 Merge pull request #4 from rdobson/examples
Give some examples.
2014-11-21 18:11:53 +00:00
Rob Dobson
d48d46306f Increase the disk size as LVM sometimes complains. 2014-11-21 18:11:36 +00:00
Rob Dobson
d0746481e7 Updating example file and README.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-21 17:49:25 +00:00
Rob Dobson
8bf2609a7f Adding static memory config to the template.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-21 17:49:25 +00:00
Rob Dobson
4dd435dafe Adding defaults for Clone template, Network and Storage to avoid having to configure it in the packer file.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-21 17:49:24 +00:00
Rob Dobson
e69f739d19 Merge pull request #3 from rdobson/defaults
Set a number of parameters as defaults
2014-11-21 17:32:42 +00:00
Rob Dobson
1daab4ef1a Adding static memory config to the template.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-21 13:48:57 +00:00
Rob Dobson
74cfea407d Adding defaults for Clone template, Network and Storage to avoid having to configure it in the packer file.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-21 13:39:25 +00:00
Rob Dobson
4746a397be Merge pull request #1 from rdobson/himn
Use the host internal management interface to obtain VM IP
2014-11-20 18:57:59 +00:00
Rob Dobson
6538c248fd Add a wait for the VM to boot properly.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-20 18:54:23 +00:00
Rob Dobson
d64357bc71 Skip the uploading ISO step for the moment until it is fully implemented.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-20 18:53:05 +00:00
Rob Dobson
d0dd202829 Remove old file.
Signed-off-by: Rob Dobson <rob.dobson@citrix.com>
2014-11-18 18:49:22 +00:00