Commit Graph

10241 Commits

Author SHA1 Message Date
DanHam 3c5d7aec74
Ensure new fixer appears in 'packer fix' usage message 2018-07-20 02:12:47 +01:00
DanHam 28087cb9f7
Fixer and tests to remove deprecated 'vhd_temp_path' Hyper-V ISO setting 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 29503e453e
Update Hyper-V docs with new export behaviour 2018-07-20 02:12:46 +01:00
DanHam e42e03ef2e
Update VMCX doc: Include `temp_path`; ISO & VMCX docs: Better explain opts 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 bd5692451b
Remove deprecated `vhd_temp_path` option from documentation 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
Megan Marsh a5a6b1ab58
Merge pull request #6501 from Wenzel/expose_ansible_packer_http_addr
Expose ansible packer_http_addr extra var
2018-07-18 17:18:46 -07:00
Megan Marsh 9c2f44be83
Merge pull request #6503 from Wenzel/expose_packer_http_addr_shell_local
Expose PACKER_HTTP_ADDR environment variable for shell-local
2018-07-18 17:02:34 -07: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
Megan Marsh fe15bc53a8
Merge pull request #6450 from shadycuz/ansible_winrm
Feature: Add randomly generated win_rm password to the ansible provisioner
2018-07-18 09:49:48 -07:00
Megan Marsh e8a7d948db update docs 2018-07-18 09:42:15 -07:00
Megan Marsh e146973d08 change implementation to set winrm password in way that matches powershell and shell-local implementations; sanitize logs 2018-07-17 16:39:50 -07:00
Matthew Hooker 9384f322f6
Prevent make fmt from failing in default case
Apologies for the terrible hack. This just makes sure we always have
a default file to format, so if the unformatted list is empty
we don't error.
2018-07-17 13:30:10 -07:00
Mathieu Tarral 430d9389be website: add documentation for packer_http_addr extra variable 2018-07-17 19:58:08 +03:00
Mathieu Tarral 3450b6fd6f ansible: expose packer_http_addr extra var 2018-07-17 19:58:07 +03:00
Megan Marsh a658b4a94b
Merge pull request #6502 from neumayer/fixtypo
Fix typo in oci documentation
2018-07-17 09:37:30 -07:00
Megan Marsh 23cdaaecb4
Merge pull request #6497 from KohlsTechnology/googlecompute-import-docs-fix
Add missing link to googlecompute-import post-processor docs
2018-07-17 09:22:00 -07:00
Mathieu Tarral 221761d97a shell-local: add docs for PACKER_HTTP_ADDR env var 2018-07-17 18:50:40 +03:00
Mathieu Tarral edcc0b3853 shell-local: expose PACKER_HTTP_ADDR env var 2018-07-17 18:49:36 +03:00
Robert Neumayer 990d139d45 Fix typo in oci documentation 2018-07-17 17:46:23 +02:00
xxx 7630268e1d Incorporate review comments 2018-07-17 17:41:19 +02:00
Sean Malloy cf04fd55ea Add missing link to googlecompute-import post-processor docs 2018-07-16 20:40:19 -05:00
Levi Blaney f5e17d1cad
changed wording from builder to provisoner 2018-07-16 19:13:05 -04:00
Levi Blaney a5493e4906
added the builders that set_winrm_passwd works with 2018-07-16 17:26:38 -04:00
Megan Marsh b28098e0f7 update to version 1.2.6-dev 2018-07-16 13:25:32 -07:00