267 Commits

Author SHA1 Message Date
Megan Marsh
127905e855 remove time flaky time limited tests (#8522)
* remove flaky test. It isn't very useful anyway given that we're slowly adding retries to the checks for lockfiles

* remove time-component from retry test; in underpowered CI builds, this can flake fairly often.
2019-12-20 08:16:18 +01:00
Moss
9216f43463 Configure NAT interface before forwarded port mapping 2019-12-19 17:03:31 +01:00
Adrien Delorme
4b7132c87c Merge remote-tracking branch 'origin/master' into sharing_info 2019-12-17 11:57:09 +01:00
Sylvia Moss
0a8b172bf9 Remove duplicated retry mechanism when deleting VM ffrom virtual box (#8485)
This retry was also added to fix a locked by session error reported in #5501 and fixed in #5512.
2019-12-16 14:31:15 +01:00
Megan Marsh
84063d2132 implement ID and Type values in the provisioner template info sharing 2019-12-13 11:57:01 -08:00
Sylvia Moss
2ee3311082
Retry command execution when VM session is locked (#8483) 2019-12-13 10:47:19 +01:00
Sylvia Moss
2f63c581a0
Remove unnecessary 1 sec sleep (#8453) 2019-12-06 11:43:28 +01:00
Sylvia Moss
5ff5623433
Add disable_shutdown option to VirtualBox builder (#8449) 2019-12-05 14:34:56 +01:00
Adrien Delorme
a36b94320a virtualbox: simplify ParseSnapshotData 2019-11-06 10:24:20 +01:00
Adrien Delorme
116a038de9 Update snapshot.go
avoid a panic on a too short slice.
2019-11-05 15:48:32 +01:00
Adrien Delorme
14243ce56a
Merge pull request #8305 from hashicorp/fix_8301
allow nvme, since virtualbox 6.0 allows it
2019-11-04 17:58:18 +01:00
Megan Marsh
6f54468dd5 fix mocks 2019-10-31 15:36:22 -07:00
Megan Marsh
9343a23021 add driver calls to enable nvme controller 2019-10-31 15:21:52 -07:00
Adrien Delorme
819329228a Change back to make sure all durations are a time.Duration
It is simply the best/simplest solution and trying to prevent users from passing and integer here would be like opening a can of worms. Because:

* we cannot make mapstructure validate our duration string ( with an UnmarshalJSON func etc.)
* we cannot make mapstructure spit a string instead of a duration and packer will decode-encode-decode config.
* the hcl2 generated code asks for a string, so this will be enforced by default.
2019-10-31 16:12:07 +01:00
Adrien Delorme
bf3d9841c6 Force durations to be passed a strings
Before this commit it was possible to set a duration using an integer or a float. Go's time.Duration is an int64 internally an mapstructure will take advantage of this and load the number as a int64 but `1` means one ns which is unexpected/confusing. To avoid confusion and enforce readability this forces users to pass a string with a unit for a duration; ex "56s".
2019-10-31 11:47:19 +01:00
Adrien Delorme
3fe9d52e3f Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config 2019-09-20 11:15:44 +02:00
Brian Fox
5b6dcb0c94 fix(virtualbox) LoadSnapshots should succeed even if VM has no snapshots 2019-09-12 10:51:12 +02:00
Adrien Delorme
597a3e323b Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config 2019-09-10 13:20:07 +02:00
Adrien Delorme
350aa54274 Update step_shutdown_test.go
bump test duration
2019-09-10 13:07:30 +02:00
Adrien Delorme
4cb7c30987 Merge remote-tracking branch 'origin/master' into scrape_doc_to_builder_struct_config 2019-08-21 16:44:23 +02:00
Megan Marsh
02399f32f6 dont bother with a targetpath for the vbox additions; use a hash like everything else 2019-08-15 15:10:25 -07:00
Thomas Meckel
d9b8623f64 StepShutdown now always waits for the shutdown of the virtual machine to complete, not only if a shutdown command is specified 2019-07-26 12:34:27 +02:00
Thomas Meckel
b873876670 Added test TestSnapshot_EnsureParents
No using asserts NotNil and Nil
2019-07-26 12:34:27 +02:00
Thomas Meckel
6fd0b3e83e Fixed a bug in ParseSnapshotData
Added fuction GetSnapshots
2019-07-26 12:34:26 +02:00
Thomas Meckel
225a140055 Applied correct source format (got fmt) to builder\virtualbox\common\driver_mock.go 2019-07-26 12:34:26 +02:00
Thomas Meckel
51e5ae69db Corrected method signatures in builder\virtualbox\common\driver_mock.go 2019-07-26 12:34:26 +02:00
Thomas Meckel
ab6a163ff2 Added missing newline at end of builder\virtualbox\common\driver_mock.go 2019-07-26 12:34:25 +02:00
Thomas Meckel
e9b5332e99 Added missing functions to builder\virtualbox\common\driver_mock.go 2019-07-26 12:34:25 +02:00
Thomas Meckel
fd5a2db58f Removed commented (obsolete) code from builder\virtualbox\common\driver_4_2.go 2019-07-26 12:34:25 +02:00
Thomas Meckel
7d3c84e5f9 Changed VirtualBox VM builder according to current builder interface 2019-07-26 12:29:48 +02:00
Thomas Meckel
2ef911f6f0 Fixed bugs in snapshot and builder code 2019-07-26 12:29:47 +02:00
Thomas Meckel
ebd2780e5d implemented first unit tests for snapshot.go 2019-07-26 12:29:46 +02:00
Thomas Meckel
f1f7c4e10c * added function ParseSnapshotData to parse a string representation of a VBox snapshot tree
* fixed bugs
2019-07-26 12:29:46 +02:00
Thomas Meckel
45e2095ae3 Moved parsing of tree string representation to new function in snapshot.go 2019-07-26 12:29:45 +02:00
Thomas Meckel
092e32fe9e First version of reworked snapshot implementation 2019-07-26 12:29:45 +02:00
Thomas Meckel
a6074894f1 Defined struct and first function for enhanced snapshot handling 2019-07-26 12:29:45 +02:00
Thomas Meckel
d3202497ae First working version of virtualbox/vm builder 2019-07-26 12:29:44 +02:00
Thomas Meckel
2a531f8ad6 Merged changes from local branch 2019-07-26 12:29:44 +02:00
Adrien Delorme
74f0d56cfc virtualbox merge vbpx manage configs 2019-06-19 17:07:23 +02:00
Adrien Delorme
01eff9472a virtualbox: merge ExportOpts and ExportConfig structs 2019-06-19 16:35:15 +02:00
Adrien Delorme
c11ef90cb6 use interpolate.NewContext() instead of testConfigTemplate(t)
because it's what's happenning there
2019-06-14 12:17:28 +02:00
Adrien Delorme
4bf6a56d71 split communitacor.SSH & communitacor.WinRM to facilitate documentation
put doc for communicator into the struct
2019-06-06 16:55:24 +02:00
Adrien Delorme
4399684372 make fmt autogenerated docs 2019-06-06 16:29:25 +02:00
Adrien Delorme
e6cbb013ba add // go:generate struct-markdown to all previously edited files 2019-06-05 16:42:18 +02:00
Adrien Delorme
f1917edd34 generate the comments for config struct of builders scraping doc website 2019-06-05 16:42:17 +02:00
Adrien Delorme
d72040f4fa move retry code into the common/retry pkg and make retry context aware 2019-04-09 17:46:38 +02:00
Adrien Delorme
f555e7a9f2 allow a provisioner to timeout
* I had to contextualise Communicator.Start and RemoteCmd.StartWithUi
NOTE: Communicator.Start starts a RemoteCmd but RemoteCmd.StartWithUi will run the cmd and wait for a return, so I renamed StartWithUi to RunWithUi so that the intent is clearer.
Ideally in the future RunWithUi will be named back to StartWithUi and the exit status or wait funcs of the command will allow to wait for a return. If you do so please read carrefully https://golang.org/pkg/os/exec/#Cmd.Stdout to avoid a deadlock
* cmd.ExitStatus to cmd.ExitStatus() is now blocking to avoid race conditions
* also had to simplify StartWithUi
2019-04-08 20:09:21 +02:00
Adrien Delorme
c4f3dccc14 rename interpolation context from ctx to ictx and contexts to ctx to avoid conflicts 2019-04-03 15:56:15 +02:00
Adrien Delorme
a4bf94dd3c change Builder to be passed a context for cancellation
we have to to give it to our hook
2019-04-03 15:55:55 +02:00
Megan Marsh
9f1a4e0fed
Merge pull request #7423 from hashicorp/lock_ports
Lock packer ports using a lock file
2019-03-26 10:35:18 -06:00