296 Commits

Author SHA1 Message Date
Adrien Delorme
56c7593725 fix panic in StepConfigureVNC
When the driver is the esx5 driver s.l won't be set at all. Meaning this will crash.
In the esx5 driver we try to dial possible ports to see if it works so it doesn't make sense to use packer's `net.ListenRangeConfig`. It could make sense to have a net.DialRangeConfig but this sounds a bit too specific and not broad enough to do.

fix #7505
2019-04-16 15:32:05 +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
ac92916b01 StepConfigureVNC: close listener only once 2019-03-26 10:58:51 +01:00
Adrien Delorme
a3838ecfad error on negative ports 2019-03-19 15:21:09 +01:00
Adrien Delorme
5a6dffde9a use port as ints 2019-03-19 15:01:12 +01:00
Adrien Delorme
f828b72c10 step configure vnc: allow to use ESX5Driver again 2019-03-19 12:54:15 +01:00
Adrien Delorme
c214f6735b make everything a uint 2019-03-19 12:54:15 +01:00
Adrien Delorme
b5d78d47f5 vmware StepConfigureVNC: use common/net pkg to find open port 2019-03-19 12:54:15 +01:00
Eric Mowry
cef3d0eb24 Ran make fmt per Megan's request. 2019-03-01 14:16:00 -05:00
Eric Mowry
109ba2c54c After testing a ISO and VMX clone along with setting the display_name option it was determined that having no name for the .vmxf file did not work either. Updating to check if displayName is not empty before using and falling back to VMName if displayName is empty. 2019-02-28 21:36:25 -05:00
Eric Mowry
e74a81e27b Deny the copying of .vmxf from the source VM to the target VM. If this file gets copied over to the new VM once the VM gets deleted the .vmxf and the folder for the VM stay on the datastore. This causes Packer to hang because the folder on the datastore does not go away during the cleanup process. 2019-02-28 16:47:46 -05:00
Eric Mowry
1127096beb Setting extendedconfigfile to the name of the VM so that when ESXi makes the vmxf it is named after the VM and ESXi will properly delete the file when the VM gets deleted. 2019-02-28 16:43:47 -05:00
Megan Marsh
5cc442872e
Merge pull request #7314 from hashicorp/fix_7234
add noSSLVerify to ovftool args
2019-02-19 16:54:48 -08:00
Megan Marsh
bbc52f9a7d add noSSLVerify to ovftool args 2019-02-14 12:10:58 -08:00
Megan Marsh
bd3339f1f9 also strip \r to work around windows file ending strangeness 2019-02-13 15:41:37 -08:00
Megan Marsh
6ea64bc378
Merge pull request #7191 from arizvisa/GH-7190
Adds support to the vmware builders for specifying the number of cores per socket via the `cores` option.
2019-01-31 15:27:52 -08:00
Megan Marsh
ce8f5c31df escape query as suggested in issue #7200 2019-01-23 11:04:14 -08:00
Ali Rizvi-Santiago
9d2f98394e Revert "Renamed the terse option, cores, to to the less-terse version cores_per_socket."
This reverts commit 0c37a3c68fd859fd97ce645210d8bb4b19ae96dc and avoids bikeshedding from other committers.
2019-01-17 14:49:07 -06:00
Ali Rizvi-Santiago
0c37a3c68f Renamed the terse option, cores, to to the less-terse version cores_per_socket. 2019-01-17 10:39:19 -06:00
Ali Rizvi-Santiago
062c62eed8 Added support for specifying the number of cores as cores to vmware-common. 2019-01-17 10:39:19 -06:00
DanHam
0821653256
Fix 'nil' dir in VMware artifact when building locally 2018-12-14 13:21:41 +00:00
Ali Rizvi-Santiago
96bdf17d2e Added knowledge of the "temporaryDevices" statebag to the StepCleanVMX tests for the VMware builders. 2018-12-03 18:03:02 -06:00
Ali Rizvi-Santiago
fa4998e1ec Modified StepCleanVMX to walk through the "temporaryDevices" statebag so that we can disable or remove its devices cleanly. This gets rid of the regex hack that was previously used to identify a cdrom-image. 2018-12-03 17:50:40 -06:00
Ali Rizvi-Santiago
3512c3c5ea Updated StepConfigureVMX to add the floppy disk device to the "temporaryDevices" statebag so that StepCleanVMX can remove it later. 2018-12-03 17:48:05 -06:00
Megan Marsh
11ef407b4d
Merge pull request #7016 from rickard-von-essen/vmware-tech-prev
vmware: Correctly parse version for VMware Fusion Tech Preview
2018-11-28 14:59:53 -08:00
Megan Marsh
ec75913412 fix crash that occurs when dir is nil 2018-11-27 16:34:26 -08:00
Ali Rizvi-Santiago
f8c23c1808 Updated things related to the vmware-iso builder to include @azr's suggestions. 2018-11-22 21:03:06 -06:00
Ali Rizvi-Santiago
61ee3a44f5 Modified the cpus and memory options for the vmware builders to only apply them if they were specified. 2018-11-21 00:43:14 -06:00
Ali Rizvi-Santiago
fb7ce9f2b5 Renamed both cpu_count and memory_size to cpus and memory (respective). 2018-11-17 06:36:02 -06:00
Ali Rizvi-Santiago
cd45248eaa Moved common hardware config options used by the vmware-iso builder into common/hw_config and added options for the CpuCount and MemorySize. 2018-11-17 06:08:08 -06:00
Rickard von Essen
4ea3d1567a
vmware: Correctly parse version for VMware Fusion Tech Preview
Closes #5317
2018-11-17 09:32:15 +01:00
Megan Marsh
dca02c7b07
Merge pull request #6962 from hashicorp/fix_6940
escape vSphere username when putting it into the query
2018-11-13 10:15:25 -08:00
Megan Marsh
89184ae384 rework if/else to simplify main code body. 2018-11-12 13:21:25 -08:00
Megan Marsh
536e0501ac Validate username/password for ovftool during prepare.
Add template option skip_validate_credentials allowing users to skip this validation if they don't want it.
Refactor vmware-iso builder to separate out config so that it matches the vmware-vmx builder and simplifies the builder.go file
2018-11-12 13:21:25 -08:00
Megan Marsh
49b40e0789
Merge pull request #6984 from hashicorp/add_display_name_vmware
add new display_name template option
2018-11-12 08:49:38 -08:00
Adrien Delorme
f1fa28847f
remove debug line.
Co-Authored-By: SwampDragons <megan@hashicorp.com>
2018-11-12 08:07:08 -08:00
Megan Marsh
e5c4a4a6fb create export directories for vmx and ovf file types, too. 2018-11-09 11:45:36 -08:00
Megan Marsh
68c9e34bfe add new display_name template option 2018-11-09 10:54:31 -08:00
Megan Marsh
790d5661c5 escape username 2018-11-06 11:30:45 -08:00
Megan Marsh
96d628eef1 fix silliness with pointers 2018-11-06 09:50:28 -08:00
Megan Marsh
5c2ca450bd fix tests 2018-11-02 15:44:27 -07:00
Megan Marsh
5815b376b4 remove unnecessary checks; we always default format to ovf if it is unset.
fix exportoutputdir
2018-11-02 14:22:01 -07:00
Megan Marsh
c3144c2d0a add some missing template validation (copied from iso builder) and revert to current use of displayName for parsing vm ssh IP; using VMName was breaking chained builds that hadn't updated the display name from the previous build. 2018-11-02 14:22:01 -07:00
Megan Marsh
c3d6d45696 modify test so that it accesses CommConfig the same way we really do within the driver 2018-11-02 14:22:01 -07:00
Megan Marsh
f18bb19f96 remove redundant config; CommConfig was already a part of the SSSHConfig struct 2018-11-02 14:22:01 -07:00
Megan Marsh
fa12113eaf remove unused NewLocalArtifact
consolidate artifacts
entirely remove local artifact object and get artifacts in the vmx builder the same way we do in the vmware iso builder
2018-11-02 14:22:01 -07:00
Megan Marsh
2ae235a28a fix tests 2018-10-25 14:41:01 -07:00
Megan Marsh
290f4a7c4c cleanup to make it actually build after that monstrous rebase 2018-10-25 14:17:35 -07:00
Alexander Laamanen
3193f50f17 Support export with the vmx builder. 2018-10-25 13:02:37 -07:00