Commit Graph

3662 Commits

Author SHA1 Message Date
Adrien Delorme 0938b640cc use key pair name from config 2018-08-29 14:40:33 +02:00
Adrien Delorme 1e71712cc9 builder.alicloud: stop using config from statebag 2018-08-29 14:40:33 +02:00
Adrien Delorme 4fdf5714a6 builder.scaleway: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme 0f9eddda3a builder.oracle: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme 92570a2725 builder.openstack: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme 4982627dd2 builder.gcp: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme e0e6b0b8f7 builder.cloudstack: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme ef4ca9c48e builder.amazon: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme dffcbb7a35 builder.alicloud: use c.Comm for ssh 2018-08-29 14:40:33 +02:00
Adrien Delorme 9a9b82715b config.Comm.SSHKeyPair => SSHKeyPairName 2018-08-29 14:40:33 +02:00
Adrien Delorme 3a4bb26150 builder.aws: use key pair from comm struct 2018-08-29 14:40:33 +02:00
Adrien Delorme 293c485372 builder.aws: use SSHAgentAuth from Comm 2018-08-29 14:40:33 +02:00
Adrien Delorme ef08c441c9 builder.aws: use Comm field for StepKeyPair & StepGetPassword 2018-08-29 14:40:33 +02:00
Adrien Delorme 7c358eed2f removed unused builder/azure/common/lin.StepGeneralizeOS struct 2018-08-29 14:40:33 +02:00
Adrien Delorme 3d46fbd4f2 removed unused builder/azure/common/lin.StepCreateCert struct 2018-08-29 14:40:33 +02:00
Adrien Delorme 25de7ad1f2 PrivateKey => PrivateKeyFile 2018-08-29 14:40:33 +02:00
Adrien Delorme 324c46279b up test 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 b83c72fd54 more private keys in config 2018-08-29 14:40:32 +02:00
Adrien Delorme 336cac29d4 also use config.SSHPrivateKey for azure-arm builds 2018-08-29 14:40:32 +02:00
Adrien Delorme d49ad12895 update gcp ssh tests 2018-08-29 14:40:32 +02:00
Adrien Delorme 663c8134ef GCP: put ssh public/private key in config 2018-08-29 14:40:32 +02:00
Adrien Delorme 51d2aac9f6 SSHPrivateKey => SSHPrivateKeyFile 2018-08-29 14:40:32 +02:00
Megan Marsh e4f6b6f720 fix chroot communicator to properly escape quotes 2018-08-28 09:16:43 -07:00
Matthew Hooker 7519037562
Merge pull request #6629 from hashicorp/travisbuild
travis builds go 1.11. remove 1.9
2018-08-24 20:51:31 -07:00
Matthew Hooker 3f1a9766f4
formatting verb fixes for go 1.11 2018-08-24 16:18:21 -07:00
Matthew Hooker e41e99954d
go 1.11 format rules 2018-08-24 15:56:44 -07:00
Megan Marsh c5b346b07b
Merge pull request #6393 from DanHam/fix-hyperv-export
Various improvements to Hyper-V ISO and VMCX builders
2018-08-24 15:52:49 -07: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 b35acbd879 use statebag instead of SetSharedState for winRM password 2018-08-24 13:51:16 -07:00
Rickard von Essen 23f62f221e Only filter SG's on VPC if it's set. Only use VPC's and Subnets that are available 2018-08-24 20:24:48 +02:00
Megan Marsh fa99f931b7
Merge pull request #6601 from hashicorp/fix_6536
Increase waiter timeout for AWS WaitUntilImageAvailable command
2018-08-24 09:35:58 -07:00
Adrien Delorme 6bbcd3e914
Remove remaining unused ssh config funcs and add missing calls (#6622)
* Remove duplicate unused SSHConfig funcs

* call to SSHConfigFunc() for azure/arm builder

* ncloud too

* remove empty ncloud file
2018-08-24 16:00:40 +02:00
Rickard von Essen 533967cb66 builder/amazon: Add suppport for security_group_filter
Allow selecting SG's using a filter. Also some cleanup of vpc_filter and
subnet_filter.
2018-08-24 12:42:38 +02: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 1f79b430ee
Merge pull request #6610 from hashicorp/filter_logs
Filter logs
2018-08-23 13:30:21 -07:00
Megan Marsh 7f518cc2d0
Merge pull request #6616 from hashicorp/fix_6496
added new template variables to replace PACKER_KEY_INTERVAL with tuna…
2018-08-23 13:21:31 -07:00
Megan Marsh 31d4f8af45 use a time.Duration instead of a hardcoded ms 2018-08-23 13:16:01 -07:00
Rickard von Essen 9840862757 builder/amazon: Add suppport for vpc_filter and subnet_filter
First step of adding support for discovering VPC's and Subnets using
filters.
2018-08-23 12:52:03 +02:00
Rickard von Essen 70cfafb75c
Merge pull request #6490 from tcarrio/most-recent-image-openstack
OpenStack source image search filter
2018-08-23 12:41:06 +02:00
Tom Carrio e2fe5cd775 Updated test cases to cover bad filters and empty() 2018-08-22 18:23:12 -04:00
Megan Marsh bb319fb1e8
Merge pull request #6607 from hashicorp/gcp_min_cpu_platform
GCP: min cpu platform
2018-08-22 12:58:34 -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 e5ffa9e5b3 use SSHConfigFunc on right member in builder/parallels/pvm/builder.go 2018-08-22 18:23:23 +02: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
Rickard von Essen 057a635cab
Merge pull request #6532 from sermilrod/Allowing-fixed-port-in-forwarding-rules
Cloudstack builder: adding public_ssh_port flag to use a fixed port in the forwarding rules
2018-08-22 14:27:38 +02:00
Rickard von Essen 3b49caaf40 OpenStack: refactored how source_image_filter is handled to remove reflection 2018-08-22 13:37:43 +02:00
Sergio Millan Rodriguez befdb59da6 renaming public_ssh_port to public_port 2018-08-22 10:17:46 +01:00
Rickard von Essen bd1961b927 Correctly fail if no Image matches filter 2018-08-21 12:46:42 +02:00
Adrien Delorme b038cd10f5 GCP: Allow to set MinCpuPlatform 2018-08-21 10:09:30 +02:00
Adrien Delorme e37f126cf1 update gcp google.golang.org/api/compute/v1/ 2018-08-21 10:09:01 +02:00
Megan Marsh ff6a039d5b replace scrubconfig with packer.LogSecretFilter.Set
filter winrm password from logs
Add new root-level packer template option, sensitive-variables, to tell us what user variables to mark sensitive.
2018-08-20 15:35:55 -07:00
Matthew Hooker 31fcfe4bc2 PoC for filtering logs 2018-08-20 15:20:21 -07:00
Adrien Delorme 6b3844a64f
Revert "allow to use ISO images in-place v.s. copying them" 2018-08-20 10:48:06 +02:00
Tom Carrio c5fe1e9e34 Updated to @rickard-von-essen's code review suggestions, including:
- filter build and error checking in Prepare stage (multiErr created in the original function will be returned to Prepare and appended, so all errors show).
- source_image overrides source_image_filter.
- Doc edit
2018-08-19 18:47:07 -04:00
Tom Carrio 5ca5c037eb Updated filter parser to log all invalid values/fields provided by user 2018-08-19 18:45:22 -04:00
Tom Carrio fc19cd8d28 Updated limit logic, removed limiter, updated test cases and sort field used 2018-08-19 18:45:22 -04:00
Tom Carrio 4147062802 Internally handling most_recent logic. 2018-08-19 18:45:22 -04:00
Tom Carrio 2d5d1890d4 Switching sort method 2018-08-19 18:45:22 -04:00
Tom Carrio 8d98237a15 I should have a git-status alias to make fmt 2018-08-19 18:45:22 -04:00
Tom Carrio 036918b81b Updated to comments in PR#6490 - Thanks @haxorof 2018-08-19 18:45:22 -04:00
Tom Carrio db3d2682b5 Updated allowed filters to tags, visibility, owner, and name. Test cases updated and passed 2018-08-19 18:45:22 -04:00
tcarrio e9e58e6b2b Tags field parsed from "tags" and updated test case 2018-08-19 18:45:22 -04:00
Tom Carrio c8fd53d60b make fmt 2018-08-19 18:45:22 -04:00
Tom Carrio de9999ecb9 Updated tag to slice, docs, comments, only active images, source_image_name supercedes filter name 2018-08-19 18:45:22 -04:00
tcarrio e776ad51a9 Removing statement from old image erroring logic 2018-08-19 18:45:22 -04:00
tcarrio 3a6ab0fc0e Updated test logic and Error->Errof for formatted output. 2018-08-19 18:45:22 -04:00
tcarrio 6dc71590eb Updated OpenStack Builder docs and tests 2018-08-19 18:45:22 -04:00
tcarrio 94018c691c Fixed step interface, added step to builder, passing all tests for new image_query.go 2018-08-19 18:45:22 -04:00
Tom Carrio a87c8fec38 Fixing up reflection issues on ListOpts builder 2018-08-19 18:39:42 -04:00
Tom Carrio 810a602a1b Added testing on query helper functions 2018-08-19 18:39:42 -04:00
Tom Carrio 33caed3531 Completed filters and most_recent processing using OpenStack imageservice API 2018-08-19 18:39:42 -04:00
Megan Marsh 00c6ec979f do 30 minutes not 25 2018-08-17 13:30:02 -07:00
Megan Marsh 00de0f4996 increase the timeout for waiting for an ami to become available 2018-08-17 13:27:19 -07:00
Megan Marsh 5dbd71b857
Merge pull request #6593 from hashicorp/iso_inplace
allow to use ISO images in-place v.s. copying them
2018-08-17 10:27:50 -07:00
Andrei Ozerov 6bf442f039 OpenStack builder: fix floating IP docs
Update website documentation about "floating_ip_network" parameter.
Add new inline comment about alghoritm that is used for checking
floatingIP-related configuration parameters.
2018-08-17 07:55:31 +03:00
Andrei Ozerov 103403db48 OpenStack builder: do not always use floating IPs
Only associate floating IPs if user provided "floating_ip_network" or
"floating_ip".
Remove FindExternalNetwork helper method because it won't be used.
2018-08-17 00:49:06 +03:00
Andrei Ozerov 5d6ba4301d OpenStack builder: fix floating_ip_pool validation
Only use "floating_ip_pool" if "floating_ip_network" wasn't set.
Update unit test for the OpenStack builder parameters.
2018-08-17 00:15:18 +03:00
Andrei Ozerov 1af899248b OpenStack builder: allow floating IP network name
Add support for the external network reference by it's name apart from
ID.
Include external network id in a log message of
the openstack/step_allocate_ip.
2018-08-16 23:38:41 +03:00
Andrei Ozerov c9047cbfbe OpenStack builder: update floating IP params
Rename "floating_network" to the "floating_ip_network".
Return old "floating_ip_pool" parameter for backward compatibility with
old configuration files. It's value will be passed to the
"floating_ip_network" parameter.
2018-08-16 22:18:48 +03:00
Andrei Ozerov 0eef9b4292 OpenStack builder: floating IP refactoring
Remove usage of the deprecated OpenStack Compute service floating IP
management and add methods to work with the OpenStack Networking
service floating IPs API.

Remove usage of the deprecated OpenStack Compute service floating IP
pools and add methods to work with the OpenStack Networking service
external networks API.

Move reusable logic of working with the OpenStack Networking service API
to a separate methods in the networking.go file.

Pass error messages from the API services to the ui messages in the
allocate IP step.
2018-08-16 22:15:26 +03:00
zhuzhih2017 2eafdb33a2
Merge pull request #6588 from xiaozhu36/master
Support describing and checking source image coming from marketplace
2018-08-16 20:58:52 +08:00
Andrei Ozerov 3316d40527 OpenStack builder: make volume type optional
Volume type parameter should be optional as described in API reference:
https://developer.openstack.org/api-ref/block-storage/v3/#create-a-volume

It should be enforced by the OpenStack cluster if not specified.
2018-08-16 12:40:11 +02:00
Andrei Ozerov 572cdeecd1 OpenStack builder: create image from blockstorage
Allow to create final image from the Block Storage service volume.
2018-08-16 12:40:11 +02:00
Andrei Ozerov c0ffe7eb89 OpenStack builder: add StepDetachVolume
Add a step of detaching Compute instance volume if it's created using
the Block Storage service.
It is needed to create a final image.

This commit also moves common volume functions to a different file and
fixes some messages in the StepCreateVolume.
2018-08-16 12:40:11 +02:00
Andrei Ozerov 005f7e56a7 OpenStack builder: cleanup blockDeviceMappingV2
There is no need to indicate type of the list elements, remove it.
2018-08-16 12:40:11 +02:00
Andrei Ozerov d51e683bf7 OpenStack builder: add Block Storage volumes
This commit allows user to use the Block Storage v3 volume as the
Compute instance root volume.
Also it adds new volume-related parameters to the builder.
2018-08-16 12:40:11 +02:00
Megan Marsh ac3554a37f
Merge pull request #6594 from rickard-von-essen/mode-check
Check that only certain files are executable
2018-08-15 13:07:00 -07:00
Megan Marsh 3362897c44
Merge pull request #6585 from hashicorp/do_6584
fix security hole with ami filter
2018-08-15 10:26:40 -07:00
Rickard von Essen 074b170ed4 Fixed exec bit 2018-08-15 16:13:34 +02:00
Rickard von Essen 25452945d7
Merge pull request #6546 from mzupan/do-add-tags
Add tags to DigitalOcean Droplets
2018-08-15 15:52:32 +02:00
Adrien Delorme 17f2949e36 remove stuttering; ISOConfig.InplaceISO -> Inplace 2018-08-15 15:51:25 +02:00
Rickard von Essen 889c89ec79 Validate tags 2018-08-15 15:27:00 +02:00
Adrien Delorme 82e480a285 allow to use ISO images inplace v.s. copying them 2018-08-15 14:37:38 +02:00
Rickard von Essen 9e9f0d2ab9
Merge pull request #6570 from cb-oath/openstack-builder-ports
add support for ports to the OpenStack builder
2018-08-15 13:35:48 +02:00
Rickard von Essen c962e7b856 Simplified loop code 2018-08-15 13:12:47 +02:00
Megan Marsh 71cad4f2a9 fix tests 2018-08-14 12:30:05 -07:00
He Guimin 1a17b799f1 Support describing and checking source image coming from marketplace 2018-08-15 00:14:02 +08:00
Megan Marsh 250da0ab49 fix security hole with ami filter 2018-08-13 17:01:13 -07:00
Christopher Boumenot 39fc8593de
Merge pull request #6576 from double16/vagrant-azure
Add to vagrant post-processor support for Azure
2018-08-09 12:36:22 -07:00
Patrick Double 2868971a9b Fixes per code review 2018-08-09 07:14:14 -05:00
Patrick Double d796edc783 Add to vagrant post-processor support for Azure 2018-08-08 10:04:28 -05:00
Megan Marsh 5585855265
Merge pull request #5165 from bennu/esxi-remote-cache
vmware-iso:esxi5 using ISO files uploaded by packer to datastore
2018-08-06 14:31:19 -07:00
Megan Marsh 99d1a1a297
Merge pull request #6541 from rsclarke/qemu-ssh-agent
add ssh agent support for qemu builder
2018-08-06 13:43:26 -07:00
Megan Marsh 57dd1c3ca2
Merge pull request #6543 from thedrow/lxc-root-path
Determine lxc root according to the running user
2018-08-06 11:34:01 -07:00
chbell43 aaa42543e6 fix formatting 2018-08-03 21:32:34 +00:00
chbell43 5f9d4b729f add support for ports to the OpenStack builder
For networks that have multiple subnets, we may want to target a single
subnet.  OpenStack doesn't let you target a single subnet in a network
and so you need to make a port.
2018-08-03 20:46:36 +00:00
Nye Liu 6d6212b75e Fix issue #6561 - Pass "--config" option correctly to "lxc launch" 2018-08-02 19:37:53 +00:00
Christopher Boumenot a3e6153068 azure: implement clean_image_name 2018-08-01 10:54:45 -07:00
Felix Yan f69ab4ed77
Fix a typo in config_test.go 2018-07-31 15:19:45 +08:00
Mike Zupan 11271ead59 Change name to tags 2018-07-30 07:55:06 -06:00
Mike Zupan 7081fe990b Adding in droplet tags on creation 2018-07-30 07:52:40 -06:00
Omer Katz 26dd6441e0
Locate lxc root directory when exporting as well. 2018-07-29 16:14:17 +03:00
Omer Katz 808df82eea
Remove privilege escalation with sudo when copying files. Preserve file permission mapping when copying files. 2018-07-29 16:03:01 +03:00
Omer Katz e5b740e223
Determine lxc root according to the running user. 2018-07-29 13:16:41 +03:00
rsclarke 887e694534 add ssh agent support for qemu builder 2018-07-27 20:24:06 +08:00
Anshul Sharma c1edcd3774
amazon-ebssurrogate clean up volumes 2018-07-26 09:38:59 +03:00
bugbuilder 2c4f703ff8 Merge 2018-07-24 20:54:08 -04:00
Sergio Millan Rodriguez d90dfc096a adding public_ssh_port flag to use a fixed port in the forwarding rules 2018-07-24 18:39:02 +01:00
Christopher Boumenot 9c6b4287e5
Merge pull request #6480 from hashicorp/pr-azure-password-requirements
azure: satisfy Azure password requirements
2018-07-24 09:58:54 -07:00
Megan Marsh 5bbb6633cf
Merge pull request #6279 from ChrisLundquist/clundquist/lxc-perms
[WIP] Unpriviliged LXC containers
2018-07-24 09:34:21 -07:00
Megan Marsh 07b6bc0c4f
Merge pull request #6504 from sharmaansh/6309-amazon-chroot-create-volume-tags
amazon-chroot: Add tags on CreateVolume
2018-07-23 14:58:17 -07:00
Megan Marsh d2823622e5
Merge pull request #6249 from iammattcoleman/add-use_backing_file
qemu builder: add the 'use_backing_file' setting for QCOW2 images
2018-07-23 13:40:04 -07:00
DanHam da21c25791
Convert incorrect 'vmxc' -> 'vmcx' in codebase, docs and template opts
grep -rli --exclude-dir={vendor,bin\*,\*vmware\*,\*pkg\*} vmxc . | \
xargs sed -i 's/\(vm\)\(x\)\(c\)/\1\3\2/ig'
2018-07-20 02:12:47 +01:00
DanHam 674bad0ab4
Break very long lines for readability 2018-07-20 02:12:47 +01:00
DanHam 2bb5a92755
Fix error in comment due to copy/paste from VMware step 2018-07-20 02:12:47 +01:00
DanHam 36bd2f5691
Fix an error with an error. Add some comments. 2018-07-20 02:12:46 +01:00
DanHam ee0a2469eb
Add ability to specify 'temp_path' for the build directory to VMCX builder 2018-07-20 02:12:46 +01:00
DanHam 8032c8151a
Tests for step to create output directory 2018-07-20 02:12:46 +01:00
DanHam f027585a93
Tests for step to create build directory 2018-07-20 02:12:45 +01:00
DanHam ed5bebfa8c
Change variable/statebag key name to better convey purpose 2018-07-20 02:12:45 +01:00
DanHam 00276f2f64
Change step name to better illustrate purpose of step 2018-07-20 02:12:45 +01:00
DanHam b386e567db
Change filename to better illustrate purpose of step 2018-07-20 02:12:45 +01:00
DanHam d2390f464d
Actually implement the function for the driver 2018-07-20 02:12:45 +01:00
DanHam 181bb0ba23
Add calling code and skeleton driver to make tests pass 2018-07-20 02:12:45 +01:00
DanHam 0a4ec13323
Tests for func to move VHDs to output dir when skip_export: true 2018-07-20 02:12:44 +01:00
DanHam 32148168bd
Introduce a new step to collate build artifact at the end of the build
The new step collects together all the required build artifacts and
places them in the output directory.

* Reintroduce/add the code removed from step export to preserve the
  legacy export directory structure when skip_export is unset/false
* Add a place holder for a future function that will move just the VHD
  files from the build directory to the output directory when
  skip_export is true
* Add tests for current functionality and placeholder tests for future
  functions
2018-07-20 02:12:44 +01:00
DanHam ee7fa27ada
Fix up tests. Ensure export step stores the export path in state 2018-07-20 02:12:44 +01:00
DanHam 232dd8f0a6
Remove code to preserve legacy export dir structure from the export step
Store the export path in the state bag in preparation for use in a later
step
2018-07-20 02:12:44 +01:00
DanHam c2437ba592
Remove the option to place the VHD files in a separate directory
The export process now exports the VM directly from the build directory
into the output directory. There are no intermediate steps or copying of
files involved. This means that there is no longer any benefit in having
a separate directory to house the VHD files - see #5206 for the
reasoning behind the introduction of this feature.

If a user wishes to house the build files on a separate disk from the
output directory (perhaps for performance reasons or due to disk space
limitations) they can still do so through the use of `temp_path`.
2018-07-20 02:12:43 +01:00
DanHam d5d82c32b2
Changes to the export process have made 'inline' build of disks redundant
PR #5631 introduced code to build/create disks directly in the output
directory if `skip_export` was set in an attempt to optimise the build
process. These are no longer required.
2018-07-20 02:12:43 +01:00
DanHam 35b4e87c42
Add tests for export VM step 2018-07-20 02:12:43 +01:00
DanHam 30a71da8e7
Add tests for disk compaction step 2018-07-20 02:12:43 +01:00
DanHam 09028c14a3
Reintroduce the disk compaction process as a unique step 2018-07-20 02:12:43 +01:00
DanHam da2df69301
Remove disk compaction from the export step 2018-07-20 02:12:42 +01:00
DanHam c6b9d9ce90
Add checks/error reporting to compaction process
* Report compaction results
* Failure to find any disks under the supplied path is treated as a
  'soft' error and a warning message will be printed in place of the
  compaction result. Any other failure will cause the build to fail.
2018-07-20 02:12:42 +01:00
DanHam 534fc4a473
Ensure the export directory structure matches that of previous versions
Commit 3fc2defb6 altered the directory structure associated with an
exported VM. The changes mean that the export process now stores the
exported machine files and folders under a folder with name 'vm_name' in
the output directory.
This commit restores the previous behaviour whereby the exported machine
files and folders were stored directly in the output directory. This
allows us to keep the efficiency improvements introduced with 3fc2defb6
while maintaining backward compatibility.

By default the Export-VM command creates three folders in the specified
export directory - 'Virtual Hard Disks', 'Virtual Machines' and
'Snapshots'. When a machine with no associated snapshots is exported the
'Snapshots' directory is empty.
Prior to 3fc2defb6 the Snapshots folder was not copied/incorporated into
the output directory at all. This was a bug.
This commit preserves the legacy behaviour by not including an empty
Snapshots directory in the export. However, if there *are* Snapshots
associated with the VM, they are now moved into the output directory
along with the usual directories containing disks and VM metadata. This
prevents warnings/errors on import due to missing snapshots.
2018-07-20 02:09:57 +01:00
DanHam dc46848f89
Remove now redundant function to copy exported VM files 2018-07-20 02:09:57 +01:00
DanHam 3fc2defb6d
Refactor the export step for Hyper-V ISO and VMCX builders
* Fixes a bug that caused the build to error if users did not
  explicitly set `skip_compaction:true` when setting `skip_export:
  true`. See #6392.
* Improves the efficiency of the compaction and export process by
  reordering the compaction and export steps.
* Further improves the efficiency of the compacting step through
  compacting the vmd* file directly rather than creating and then
  operating on a copy.
* The changes mean the export process now stores the exported machine
  files and folders under a folder with name 'vm_name' in the output
  directory. Previously the exported machine files and folders were
  stored directly in the output directory.
2018-07-20 02:09:54 +01:00
Matthew Hooker 814c1cf2b2
spellfix 2018-07-18 13:00:45 -07:00
Andrew Pryde 67f039509a
Merge pull request #6498 from neumayer/ocimetadata
Allow instance metadata to be specified in config
2018-07-18 18:27:27 +01:00
Anshul Sharma 885ecb0790
Issue-6309 Amazon Chroot Provider
-  Add tags on CreateVolume
2018-07-18 13:01:15 +03:00
xxx 7630268e1d Incorporate review comments 2018-07-17 17:41:19 +02:00
James Nugent 9fffe4056e
Merge pull request #5452 from smaato/tag-spot-requests
Enable tagging of spot requests
2018-07-16 13:00:07 -05:00
Sander van Harmelen 451cbd8aa9
Merge pull request #6487 from sermilrod/Honour-cloudstack-projectid
Honour cloudstack projectid
2018-07-16 13:53:06 +02:00
Sergio Millan Rodriguez f4020835d6 flag to setup networking without firewall rules 2018-07-16 13:06:51 +02:00
Sergio Millan Rodriguez 472a7820eb Using UI keypair meaningful message 2018-07-16 11:39:15 +02:00
Sergio Millan Rodriguez e729b21212 passing projectid to getRootVolumeID rather than the whole config struct 2018-07-16 11:38:14 +02:00
Mark Meyer 2fec76ea87 Check if spot price is empty, when spot_tags is set 2018-07-13 22:42:42 +02:00
Megan Marsh b6b907f523 read in the environment variables that government wait time and polling time for the AWS wait in step_stop_ebs_volume 2018-07-13 09:43:28 -07:00
Sergio Millan Rodriguez a41a4658ee make packer builder honour projectid setting if provided 2018-07-13 17:58:46 +02:00
Sergio Millan Rodriguez eae0556dc5 Add option to enable/disable create firewall/acl rules 2018-07-13 17:58:39 +02: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
Christopher Boumenot fa7f54cb55 azure: satisfy Azure password requirements 2018-07-11 15:32:45 -07:00
Megan Marsh 8e22803099 fix loading of environment variables for managing aws waiters 2018-07-11 13:10:38 -07:00
Megan Marsh 12f1b2421d
Merge pull request #6332 from hashicorp/do_6177
Replace home-grown waiters with aws sdk's built in waiters
2018-07-11 11:17:02 -07:00
Megan Marsh f657ca39c9 refactored env var code and tests so that I don't have to set env vars during tests to check logic 2018-07-11 10:36:21 -07:00
Megan Marsh 14166fdd99 update amazon import docs to include the env vars for setting aws waiter delays and timeouts 2018-07-11 10:36:21 -07:00
Megan Marsh bfbe318727 fix the homegrown waiters
fix image import; issue was with wait options not being evaluated
2018-07-11 10:36:21 -07:00
Megan Marsh f49a2d8aed move UI call to before the wait; add context to these steps 2018-07-11 10:36:21 -07:00
Megan Marsh cf63dd10bf replace AMIStateRefreshFunc, InstanceStateRefreshFunc, our spot instance waiter, our chroot volume waiter, and our snapshot waiters with waiters form AWS's SDK. 2018-07-11 10:34:20 -07:00
M. Marsh 62d9dcb822
Merge pull request #6477 from jabbera/fixMaxResourceGroupLength
managed_image_resource_group_name max length change
2018-07-11 10:23:30 -07:00
Mike 5ea6429cd6
managed_image_resource_group_name max length change 2018-07-11 11:31:51 -04:00
M. Marsh 8e852af1eb
Merge pull request #6448 from DanHam/fix-esxi-displayName
ESXi: Fix failure to discover IP or export VM when 'displayName' differs from 'vm_name'
2018-07-10 16:57:16 -07:00
Michael Gibson 7e4fb9adb5
vnc_bind_address not getting passed through to qemu
This was mostly addressed in commit
hashicorp/packer@fa273f3

Just missing vncIP from step_type_boot_command.go
2018-07-09 14:05:39 -06:00
M. Marsh adfee4933a
Merge pull request #6437 from hashicorp/retry_convert
make the convert retryable in case it takes a bit to release a lock
2018-07-09 11:09:57 -07:00
Mark Meyer 3dbf1cb371 Enable tagging of spot requests
This adds a new parameter to the EBS builders named `spot_tags'. This
parameter accepts a map of tags, much like `tags'. These tags will be
applied to a spot request that is created.

Improve visibility.
2018-07-07 16:06:51 +02: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
Edouard Bonlieu 4b1f96b527
Merge pull request #6439 from jbonachera/scaleway-config-bootscript
scaleway: add 'bootscript' configuration parameter
2018-07-04 10:10:19 +02: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
Robert Neumayer 22e5523faa Allow instance metadata to be specified in config 2018-07-02 10:48:08 +02: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
Julien BONACHERA eda85a4daf
scaleway: add 'bootscript' configuration parameter 2018-06-29 19:44:56 +02:00
Megan Marsh 2b2c860df8 make the convert retryable in case it takes a bit to release a lock 2018-06-28 14:21:28 -07:00
M. Marsh c67d59515c
Merge pull request #6370 from arizvisa/patch-1
Allow StepAttachIso in the VirtualBox builder to resolve symbolic links when processing the IsoPath.
2018-06-27 10:30:30 -07:00
Owain Lewis b600be009d Pass context into OCI client 2018-06-26 10:17:02 +01:00