Commit Graph

478 Commits

Author SHA1 Message Date
allinwait 171c2a9a07 add the floppy label option 2019-09-12 12:25:22 +00: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 350aa54274 Update step_shutdown_test.go
bump test duration
2019-09-10 13:07:30 +02:00
Thomas Meckel 01edafb49f Cleaned up golint warnings 2019-08-19 21:36:43 +02:00
Thomas Meckel 92501cd344 target_snapshot is not optional as described in the documentation 2019-08-19 21:36:43 +02:00
Megan Marsh 06bef2844b
Merge pull request #7996 from hashicorp/fix_7925
dont bother with a targetpath for the vbox additions; use a hash like…
2019-08-19 09:45:38 -07:00
Brian Fox 47c027e5c8 Remove check/requirement for target_snapshot 2019-08-19 11:25:17 +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 822b72bd14 Added force_delete_snapshot configuration item and the corresponding checks 2019-07-26 12:34:28 +02:00
Thomas Meckel e7583de847 StepCreateSnapshot.Run() will stop and create an error if the virtual machine is still running
Removed left over code from StepCreateSnapshot.Cleanup()
2019-07-26 12:34:27 +02: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 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
Adrien Delorme 5a6dffde9a use port as ints 2019-03-19 15:01:12 +01:00
Adrien Delorme c214f6735b make everything a uint 2019-03-19 12:54:15 +01:00
Adrien Delorme f67b5ff59d virtualbox StepConfigureVRDP: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Adrien Delorme 59370986fb virtualbox StepForwardSSH: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Vadym Haidamaka 414d0750f0 Add tests to validate 'none' communicator in the virtualbox builder 2019-03-16 18:18:29 +02:00
Vadym Haidamaka 0263503c45 Validate virtualbox_version_file and guest_additions_mode when communicator is none 2019-03-16 18:15:27 +02:00
Adrien Delorme 9f82b75e57 Use the hashicorp/go-getter to download files
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Megan Marsh 3dc1dafe58
Merge pull request #7287 from stephen-fox/ephemeral-ssh-key-pair-issue-7225
virtualbox: create ephemeral SSH key pair for build process
2019-03-04 14:25:04 -08:00
Stephen Fox 7e1cbc6d89 Rename references to key pair name to comment.
Per the OpenSSH manual, the field is for a comment.
2019-03-01 10:00:29 -05:00
Stephen Fox 61a8968b22 Use 'os.OpenFile' to atomically create debug key file.
Per code review feedback.
2019-02-28 17:23:33 -05:00
Stephen Fox 094c87e395 Remove 'SSHPublicKeyUrlEncoded', use 'urlquery' instead.
Per code review feedback, the Go template library supports
encoding variables in URL query format. Instead of exposing
two different public key formats (unmodified string and a
URL encoded string), just have the user apply the 'urlquery'
modifier to their template.
2019-02-28 17:06:51 -05:00
Stephen Fox 2ef6b9247d Initial take on code review feedback from @azr.
Do not use builder pattern or interfaces; stick to structs and
some basic functions.
2019-02-25 17:16:24 -05:00
Megan Marsh 3fd589fa72 typos 2019-02-08 09:31:30 -08:00
Megan Marsh e2d8c0bfd7 docs 2019-02-08 09:28:10 -08:00
Megan Marsh 07c0c599e0 attach guest additions via SATA when necessasry 2019-02-08 09:15:15 -08:00
chris marget 53c0376dfd don't print keypair to the user's screen 2019-02-06 13:54:05 -05:00
chris marget 13cc73d600 keypair parsing and testing 2019-02-06 13:46:55 -05:00
Stephen Fox f9d24ccda0 Allow user to get public key straight up, or URL encoded. 2019-02-05 11:59:13 -05:00