Commit Graph

756 Commits

Author SHA1 Message Date
Megan Marsh dbfc1b5aff fix tests 2018-12-06 09:36:16 -08:00
Megan Marsh 0058422a5c also for vmx 2018-12-05 15:58:44 -08:00
Megan Marsh 0fe4d79bbf add validation to prevent users from being confused about format functionality 2018-12-05 15:57:45 -08: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 e0d3861e81 Updated StepCreateVMX to add the CDROM device that packer uses to the "temporaryDevices" statebag so that StepCleanVMX can unmount its ISO later. 2018-12-03 17:48:05 -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
Ali Rizvi-Santiago 27b16cee0a Added a new "temporaryDevices" key to the VMware builders' statebag in order to keep track of devices that were temporarily added during build and need to be removed later by StepCleanVMX. 2018-12-03 17:47:45 -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
Megan Marsh 89fb8f0d3e fix defaulting/lack thereof for cpu count and memory in vmware template 2018-11-27 15:43:48 -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
Ali Rizvi-Santiago 4e73c85e22 Re-sorted, grouped, and commented the options in the template VMX for the VMWare builder to keep things organized. 2018-11-16 22:20:00 -06: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 3b413d2e5e fix rebase conflicts 2018-11-12 13:24:03 -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
Adrien Delorme 78ac943679
Merge pull request #6987 from hashicorp/6624
6624
2018-11-12 15:31:36 +01:00
Megan Marsh 2e2b2cea82 add a warning that checks for collisions between packer-generated values in the default vmx file and the vmx_data 2018-11-09 15:46:52 -08:00
Megan Marsh 3cf4c63a87 Change antiquated Master/Slave terminology for disk drives to more appropriate Primary/Secondary. 2018-11-09 14:00:07 -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
Alexander Laamanen a68a639a1a Move step_export to common. 2018-10-25 12:55:10 -07:00
Alexander Laamanen 63054fb808 Fix the test. 2018-10-25 12:45:44 -07:00
Stuart Miller da5f322484 Add quotes around all filenames to prevent issues with spaces 2018-10-25 12:45:44 -07:00
Alexander Laamanen f42f5a8ad3 Remove some extra logging. 2018-10-25 12:44:29 -07:00
Alexander Laamanen e7e6a80587 No need to make upload public. 2018-10-25 12:39:51 -07:00
Alexander Laamanen c294e65c36 A separate driver file is not really needed anymore 2018-10-25 12:39:51 -07:00
Alexander Laamanen 2ed6c3ef5e Set output dir always according to the config. 2018-10-25 12:37:47 -07:00
Alexander Laamanen c940f7e754 Conditional reload. 2018-10-25 12:37:47 -07:00
Alexander Laamanen 17845beadc Fix the CommHost tests 2018-10-25 12:37:47 -07:00
Alexander Laamanen 5e74bcfb88 Fix tests, move remote_ default values to driver_config. 2018-10-25 12:30:57 -07:00
Alexander Laamanen 4d9cb19012 Refactor artifacts and output_dir implementations. 2018-10-25 12:21:24 -07:00
Alexander Laamanen 2d00dc6756 Add VMName to the vmx mods. 2018-10-25 11:17:09 -07:00
Alexander Laamanen 7b5943160b Re-enable the CommHost() call. Use common's driver factory. 2018-10-25 11:17:09 -07:00
Alexander Laamanen ba22090bc9 Move step_register and step_uload_vmx from iso to common. 2018-10-25 11:07:02 -07:00
Alexander Laamanen b5298464c5 Move the remote_driver from iso to common. 2018-10-25 11:01:22 -07:00
Alexander Laamanen 91c7089455 Implement the first version of the remote Clone(). 2018-10-25 10:37:45 -07:00
Alexander Laamanen 46cfb5a30c Move driver_esx5 to commons and allow it to be instantiated wtih NewDriver() 2018-10-25 10:33:37 -07:00
Megan Marsh fd8a85042d use strconv.Quote instead of fmt.Sprint 2018-10-22 10:59:47 -07:00
Megan Marsh 18c5e8deb8 fix 2018-10-19 13:46:55 -07:00
Megan Marsh 1e4133cbf9 quote upload path 2018-10-19 13:43:13 -07:00
Megan Marsh 3f591d78f3 quote vmx path in register function 2018-10-19 13:42:40 -07:00
Megan Marsh 8cba32d526 escape all the d.sh calls that contain paths 2018-10-19 13:42:40 -07:00
Megan Marsh 5b9adc0c48 single quotes 2018-10-19 13:42:40 -07:00
Megan Marsh e5e75df033 fix datastore path that contains spaces 2018-10-09 16:36:55 -07:00
Megan Marsh 38cc525ec7 new option allowing user to clean up the ephemeral ssh key from the authorized_keys file 2018-09-14 11:06:38 -07:00
Jeffrey Martin 1833b4edaf
validate compaction is skipped when not 'thin' 2018-08-30 16:44:00 -05:00
Jeffrey Martin b51cd22b21
document ESXi disk compaction & use verbose option 2018-08-30 16:44:00 -05:00
Jeffrey Martin 09c71f3810
add support for disk compaction to esx5 builder 2018-08-30 16:43:53 -05:00
Adrien Delorme 25de7ad1f2 PrivateKey => PrivateKeyFile 2018-08-29 14:40:33 +02:00
Adrien Delorme 5369c15459 helper: communicator.SSHFileSigner => ssh.FileSigner
* had to to avoid circular dependency
* this commit fixes #6631 ( esxi cannot be reached by ssh )
2018-08-29 14:40:33 +02:00
Adrien Delorme 51d2aac9f6 SSHPrivateKey => SSHPrivateKeyFile 2018-08-29 14:40:32 +02:00
Megan Marsh bf191d1ef6
Merge pull request #6204 from arizvisa/GH-6197
Specify "bios.hddOrder" during the CreateVMX step for the vmware-iso builder.
2018-08-24 15:46:31 -07:00
Megan Marsh 340363a649
Merge pull request #6613 from hashicorp/merge_ssh_config_funcs
Merge ssh config funcs from builders
2018-08-23 16:03:36 -07:00
Megan Marsh 31d4f8af45 use a time.Duration instead of a hardcoded ms 2018-08-23 13:16:01 -07:00
Megan Marsh 918db58604 added new template variables to replace PACKER_KEY_INTERVAL with tunable key and keygroup intervals depending on driver used 2018-08-22 11:37:56 -07:00
Adrien Delorme fa44a4546f use ssh.ParsePrivateKey where we can 2018-08-22 18:23:09 +02:00
Adrien Delorme 41f6e0334d refactor all copy pasted sshConfig with into communicator.Config.SSHConfigFunc
* still need to append the auth methods into an array for gracefullness
2018-08-22 17:02:23 +02:00
Adrien Delorme 6b3844a64f
Revert "allow to use ISO images in-place v.s. copying them" 2018-08-20 10:48:06 +02:00
Adrien Delorme 17f2949e36 remove stuttering; ISOConfig.InplaceISO -> Inplace 2018-08-15 15:51:25 +02:00
Adrien Delorme 82e480a285 allow to use ISO images inplace v.s. copying them 2018-08-15 14:37:38 +02:00
bugbuilder 2c4f703ff8 Merge 2018-07-24 20:54:08 -04:00
Megan Marsh 1d15f09e36
Merge pull request #6440 from DanHam/simplify-vmx-find-disks
Further simplify enumeration of attached disks for VMware VMX builder
2018-07-12 11:05:35 -07:00
DanHam a39c5887fb
Test we halt if a bad path is set in vmx_path 2018-07-06 10:58:25 +01:00
DanHam 21117e5d38
Test we fail if displayName is not stored in the statebag as 'display_name' 2018-07-06 10:58:25 +01:00
DanHam 88c43ec98d
Test we fail if the displayName key is not found in the VMX 2018-07-06 10:58:24 +01:00
DanHam d68d26a6e5
Fix tests: We now need to set `displayName` key/val pair in the test VMX 2018-07-06 10:58:24 +01:00
DanHam 902cea0f30
ESXi: Fix failure to export VM when `displayName` differs from `vm_name`
ovftool requires we pass in `displayName` as part of the source locator
string so that it can successfully determine the VM intended for export.
2018-07-06 10:58:17 +01:00
DanHam cd7d3812ea
ESXi: Fix failure to get VM IP when `displayName` differs from `vm_name`
The value in the Name field returned by 'esxcli network vm list'
actually returns the VMs `displayName`. As such, we need to match
against `displayName` to discover the VMs 'WorldID'.
'WorldId' is ultimately used/needed as an argument in the command that
returns the VMs IP.
2018-07-06 10:58:09 +01:00
DanHam 3eab3cc99b
ESXi builds require we store the value of displayName in the statebag
The value of displayName is needed by later steps:
* When determining the IP address of the build VM
* When exporting the VM using ovftool

By default Packer will configure the VMX so `displayName` is equal to
the value defined for `vm_name` in the build template. However, it is
possible (and sometimes desirable) to set a custom value for
`displayName`.
Users can set a custom `displayName` through use of the `vmx_data`
option in their template.
2018-07-06 01:58:09 +01:00
M. Marsh 8658eaf1ac
Merge pull request #6424 from DanHam/fix-esxi-export-hang
Prevent hang on export when using VMware ISO builder on remote ESXi host
2018-07-02 16:42:08 -07:00
DanHam 939aa7e289
Add test: We shouldn't error when main remote options are unset 2018-07-02 18:13:19 +01:00
DanHam efcdf60d96
Add tests to ensure remote_password is set when exporting with ovftool 2018-07-02 18:13:19 +01:00
DanHam 0d9134bdbc
Fix existing tests as they were not doing what they should have been
* Fix test to check for remote_host when remote_type is set
* Fix tests by including remote_password where required
2018-07-02 18:12:41 +01:00
DanHam eee16262b6
Remove duplicate/redundant test 2018-07-02 18:10:50 +01:00
DanHam c8199458a7
Prevent hang on export for remote ESXi build due to empty remote_password 2018-07-02 18:10:50 +01:00
M. Marsh 406f4eeb93
Merge pull request #6394 from conradjones/master
Add support to vmware-vmx for linked clones
2018-07-02 09:50:24 -07:00
DanHam fff72780e1
Further simplify enumeration of attached disks for VMware VMX builder
* Collate separate regexp's into one for greater efficiency
* Inline function and remove unnecessary struct and variables
2018-07-01 16:18:33 +01:00
Conrad Jones d9b6924986 Add cloneType to fusion driver 2018-06-30 16:31:42 +01:00
Bob Brumfield 04ff0761e6 Notify that we are skipping file, but retain error message 2018-06-25 08:28:32 -07:00
Bob Brumfield 591bfe3dfa Continue searching for leases even if one of the files cannot be read. 2018-06-22 18:09:27 -07:00
Conrad Jones d05a601d00 Add support to vmware-vmx builder for linked clones. 2018-06-17 01:38:42 +01:00