Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hyper-V builder #2576

Merged
merged 108 commits into from
Dec 13, 2016
Merged

Add Hyper-V builder #2576

merged 108 commits into from
Dec 13, 2016

Commits on Dec 12, 2016

  1. Port of https://github.com/pbolduc/packer-hyperv/

    Remove steps that are windows specific
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    1fe4c50 View commit details
    Browse the repository at this point in the history
  2. Use the same configuration style as existing builders

    Move builder into correctly named folder
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    ca16f33 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a422159 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    469415f View commit details
    Browse the repository at this point in the history
  5. Use the convention for default vmname

    Use the convention for default hdd size
    Tests added for builder
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    79a5f90 View commit details
    Browse the repository at this point in the history
  6. Wait until WinRM is available, before continuing with install. This i…

    …s how other system like VeeWee do it.
    
    Add support for number of cpus to use for vm
    Add support for vm generation
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    87b3dec View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    2d7cfcd View commit details
    Browse the repository at this point in the history
  8. Remove devices after it has been shut down

    Attempt to stop vm, before deleting it
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    03b0698 View commit details
    Browse the repository at this point in the history
  9. Support for boot_command

    Setup local http server
    Add compaction of hard drive
    GetHostAdapterIpAddress function added for hyperv
    renamed step step_start_vm to step_run to fall in ine with naming conventions of other builders
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    aa1f1da View commit details
    Browse the repository at this point in the history
  10. With generation 2 machine by default a dvd drive is not created. So c…

    …reate a dvd drive for os if it does not exist.
    
    Allow secure boot mode to be configured from config.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    02db768 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f3cc413 View commit details
    Browse the repository at this point in the history
  12. When redirecting local ports to hyper visor ports we need to configur…

    …e WinRM ports as well as SSH ports.
    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    bd0b119 View commit details
    Browse the repository at this point in the history
  13. Add a little safety around variables that are passed into provisioner.

    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    6c3030c View commit details
    Browse the repository at this point in the history
  14. Quote powershell so that it does not try to interpret command to be run

    Get VName out of state. This allows template replacement to be run on vmname
    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    3051ea6 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    ef507c7 View commit details
    Browse the repository at this point in the history
  16. Hyperv generation 2 machines use scsi for dvd drives. Allow gen 1 mac…

    …hines to have at least 1 iso image attached
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    e18594f View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    4e8074d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    837f9ad View commit details
    Browse the repository at this point in the history
  19. No need to remove floppy controller for 2nd generation vms

    Don't want to be prompted for confirmation from powershell commandlets
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    5f2c123 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    efafed4 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    c24c882 View commit details
    Browse the repository at this point in the history
  22. Use plain text password

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    8e18baf View commit details
    Browse the repository at this point in the history
  23. fix vagrant box structure

    vvchik authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    d57517d View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    5473332 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    9f94834 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    5285a81 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    1513731 View commit details
    Browse the repository at this point in the history
  28. Fix disk size test

    Default minimum and maximum sizes were geared towards spinning up windows server instances. Linux instances are far more efficient and make do with lower requirements. Set the minimum sizes to match this.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    730c621 View commit details
    Browse the repository at this point in the history
  29. If there is only one ip address on a card we need to force it to be a…

    …n array. Otherwise powershell may treat it as a property.
    
    Stop-Vm with force parameter to ensure that powershell prompts will not appear
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    9cf8b18 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    25baa26 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    ccf506e View commit details
    Browse the repository at this point in the history
  32. Always force turn off vm

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    9fd6357 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    cd6213e View commit details
    Browse the repository at this point in the history
  34. Make use of driver instead of directly referencing hyper

    Move inline powershell to hyperv
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    422efee View commit details
    Browse the repository at this point in the history
  35. GuestAdditionsMode and GuestAdditionsPath can be set in config. If Gu…

    …estAdditionsMode == "attach" it will mount the HyperV Integration Services ISO. If GuestAdditionsPath is set, then it will be used as an alternative to where the HyperV Integration Service ISO is.
    
    Included the build step to download ISO, so iso_urls works properly now.
    Online activation should be done via provisioner
    Installation of integration services should be done via provisioner
    Cleaned up the way dvd drives are mounted and unmounted (still need to implement feature to find unused drives before adding a new one)
    Cleaned up the way floppies are mounted and unmounted
    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    010d171 View commit details
    Browse the repository at this point in the history
  36. Forgot to check in these files.

    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    50a8d1b View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    aaf9007 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    4b6ce3d View commit details
    Browse the repository at this point in the history
  39. Setting boot drive message

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    31ac1da View commit details
    Browse the repository at this point in the history
  40. Get rid of mount and unmount that does not specify controller locatio…

    …n exactly
    
    Handle cleanup if unmount step has not already done so
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    3cb621f View commit details
    Browse the repository at this point in the history
  41. If we are not getting the exit code assigned then default to it being…

    … successful
    
    Useful to know what the exit code is if there is an error
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    fe8d99f View commit details
    Browse the repository at this point in the history
  42. Using Write-Output instead of Write-Host since PS v5 now leaks the ho…

    …st stream to stderr
    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    c42cb88 View commit details
    Browse the repository at this point in the history
  43. Write output will put ouput from function, so we don't want to be get…

    …ting line from output of function
    
    Fix unit tests for not showing progress stream when using powershell
    Ensure that progress stream does not get leaked into stdout
    Using Write-Output instead of Write-Host since PS v5 now leaks the host stream to stderr
    Taliesin Sisson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    4b394c8 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    e8c2b49 View commit details
    Browse the repository at this point in the history
  45. If exit code = 1 and the length of the stderr is 0, then we can assum…

    …e that the exit code was not set, so assume success
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    e0c10de View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    8477a0b View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    07764c6 View commit details
    Browse the repository at this point in the history
  48. Fix gen 1 creation of dvd

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    93a2615 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    18241e5 View commit details
    Browse the repository at this point in the history
  50. By default a gen 1 vm get a dvd drive. Remove it on creation so that …

    …it behaves the same as gen 2.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    f8e3970 View commit details
    Browse the repository at this point in the history
  51. Echo output when its used

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    d1961b7 View commit details
    Browse the repository at this point in the history
  52. removed unused reference

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    bda2468 View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    199bee6 View commit details
    Browse the repository at this point in the history
  54. Remove all Dvd Drives on Generation 1

    Gildas Cherruel authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    8734c5b View commit details
    Browse the repository at this point in the history
  55. Do not try to type scancodes if there are none. We haven't figured ou…

    …t how to do this on Windows 10 or Windows 7 and below. This will at least allow other types of VMs to be built.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    056fc59 View commit details
    Browse the repository at this point in the history
  56. try to get the virtual keyboard a number of different ways. This shou…

    …ld hopefully work for Windows 7, Window 10 and Windows Server 2016
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    4ab2e8b View commit details
    Browse the repository at this point in the history
  57. A workaround for bug in Windows 10 and Windows 2016 where you have to…

    … specify a path when creating a dvd drive
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    d878f4d View commit details
    Browse the repository at this point in the history
  58. Export of Hyper-V/VMCX machines

    Gildas Cherruel authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    872fc55 View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    181132f View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    de44777 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    fb098fc View commit details
    Browse the repository at this point in the history
  62. Configuration menu
    Copy the full SHA
    7c754bf View commit details
    Browse the repository at this point in the history
  63. 1 Configuration menu
    Copy the full SHA
    5d5809b View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    4d22bd1 View commit details
    Browse the repository at this point in the history
  65. On windows a lot of git clients will convert LF to CRLF. This would b…

    …e a problem where file contents are compared exactly
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    807d7ea View commit details
    Browse the repository at this point in the history
  66. Added file with correct line endings

    When dealing with windows the file url format is file:///c:/
    On windows a lot of git clients will convert LF to CRLF. This would be a problem where file contents are compared exactly
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    e551087 View commit details
    Browse the repository at this point in the history
  67. Fix duplicate imports

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    4721327 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    8c32397 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    52c6cd5 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    17597b4 View commit details
    Browse the repository at this point in the history
  71. Encode powershell using utf8

    Fix a bug in the size of string that was returned when decoding a base64 string
    Added tests around encoding and decoding powershell scripts. Used [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes('powershell commands')) | clip to generate what base 64 strings should look like
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    d61513b View commit details
    Browse the repository at this point in the history
  72. Pattern for infrastructure changed to quote filename and execute file…

    … with ampersand as everything is run in powershell now
    
    Handle powershell commands by specifying any extra infrastructure around running scripts inside of ExecuteCommand and ElevatedExecuteCommand
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    e36051d View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    f38d787 View commit details
    Browse the repository at this point in the history
  74. Builds in AppVeyor are failing as they do not have enough free memory…

    …. Drop the thresh hold a little more.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    c1538c5 View commit details
    Browse the repository at this point in the history
  75. Add type scan support for ctrl, shift, alt.

    <leftAlt>
    <leftCtrl>
    <leftShift>
    <rightAlt>
    <rightCtrl>
    <rightShift>
    
    Add type support for combinations of ctr, alt, shift with (only use lower case characters with this):
    <leftAltOn>
    <leftCtrlOn>
    <leftShiftOn>
    <leftAltOff>
    <leftCtrlOff>
    <leftShiftOff>
    <rightAltOn>
    <rightCtrlOn>
    <rightShiftOn>
    <rightAltOff>
    <rightCtrlOff>
    <rightShiftOff>
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    5f7290c View commit details
    Browse the repository at this point in the history
  76. Dvd drive creation will auto select the controller number and control…

    …ler location. This fixes the bug of first generation machines not being able to add more then 1 dvd drive.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    e636c3d View commit details
    Browse the repository at this point in the history
  77. Add special key modifiers to log output when used.

    Update documentation to include new key modifiers.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    9c53df1 View commit details
    Browse the repository at this point in the history
  78. Enable-VMIntegrationService cmdlet has a language dependent value for…

    … -Name option. So avoid using it, as it will break on machines with different languages.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    7ce9203 View commit details
    Browse the repository at this point in the history
  79. Configuration menu
    Copy the full SHA
    6342e15 View commit details
    Browse the repository at this point in the history
  80. Configuration menu
    Copy the full SHA
    f94c2cd View commit details
    Browse the repository at this point in the history
  81. Adding support for nested Hyper-V

    PatrickLang authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    6d391fc View commit details
    Browse the repository at this point in the history
  82. Fix type casting

    PatrickLang authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    1277a25 View commit details
    Browse the repository at this point in the history
  83. Add support for mac spoofing and dynamic memory.

    To enable nested virtualization, mac spoofing, no dynamic memory and at least 4gb of ram should be set for the vm. Set warning if this has not been done.
    Detected Virtualization Extensions are supported by the machine your are running on, as it only works for Windows 10 and Windows Server 2016 onwards.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    9fbd1e4 View commit details
    Browse the repository at this point in the history
  84. Add documentation for: enable_mac_spoofing, enable_dynamic_memory and…

    … enable_virtualization_extensions
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    b8554da View commit details
    Browse the repository at this point in the history
  85. Enable VlanID

    efx-jjohnson authored and taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    48b6cc0 View commit details
    Browse the repository at this point in the history
  86. Added the ability to independently configure switch vlan. This will p…

    …eople to leave the switch in trunk mode and set a vlan for the vm.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    c2d1f6b View commit details
    Browse the repository at this point in the history
  87. Add vendoring for unicode:

    govendor fetch golang.org/x/text/encoding/unicode
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    d56d683 View commit details
    Browse the repository at this point in the history
  88. Configuration menu
    Copy the full SHA
    ffc7f3f View commit details
    Browse the repository at this point in the history
  89. Fix spelling mistake

    Fix code type for formatting
    Remove empty space
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    55353fa View commit details
    Browse the repository at this point in the history
  90. Remove trailing tabs

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    c88a2ef View commit details
    Browse the repository at this point in the history
  91. Configuration menu
    Copy the full SHA
    501845c View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    a27d75f View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    d711756 View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    20643e3 View commit details
    Browse the repository at this point in the history
  95. Configuration menu
    Copy the full SHA
    0515487 View commit details
    Browse the repository at this point in the history
  96. Configuration menu
    Copy the full SHA
    3c1df5a View commit details
    Browse the repository at this point in the history
  97. Add missing configuration elements.

    Remove configuration elements that are no longer used.
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    7add6d3 View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    3f0835a View commit details
    Browse the repository at this point in the history
  99. Remove unused import

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    04a6880 View commit details
    Browse the repository at this point in the history
  100. Remove unused import

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    fb192ce View commit details
    Browse the repository at this point in the history
  101. Configuration menu
    Copy the full SHA
    44f73fa View commit details
    Browse the repository at this point in the history
  102. Run go fmt on files

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    3356154 View commit details
    Browse the repository at this point in the history
  103. Configuration menu
    Copy the full SHA
    602c207 View commit details
    Browse the repository at this point in the history
  104. Configuration menu
    Copy the full SHA
    24e9810 View commit details
    Browse the repository at this point in the history
  105. headless is no longer used

    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    143ac30 View commit details
    Browse the repository at this point in the history
  106. Be smarter about loading guest additions iso. Windows 10 and Windows …

    …Server 2016 no longer come with iso. So default to not loading guest additions when the iso is missing
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    74255c5 View commit details
    Browse the repository at this point in the history
  107. Configuration menu
    Copy the full SHA
    e357c56 View commit details
    Browse the repository at this point in the history
  108. Porting over paulmey changes to license and copyright headers. Good g…

    …uy Microsoft have changed the licensing to MPL2 and removed the copyright headers so that we can include it in the official Packer release.
    
    microsoft/packer-hyperv@1ce6ba9?diff=unified#diff-5d60887f0940c9f8d6724e59843ac1fb
    taliesins committed Dec 12, 2016
    Configuration menu
    Copy the full SHA
    e50fe9f View commit details
    Browse the repository at this point in the history