Skip to content

Remove network BootDevices before setting the boot device to prevent PXE messing things up#9

Open
watsonlu wants to merge 109 commits intotaliesins:HyperVfrom
watsonlu:RemoveNetworkBootDevices
Open

Remove network BootDevices before setting the boot device to prevent PXE messing things up#9
watsonlu wants to merge 109 commits intotaliesins:HyperVfrom
watsonlu:RemoveNetworkBootDevices

Conversation

@watsonlu
Copy link

We have a PXE environment set up on our network. We don't use it with packer, but sometimes it overrides packer and messes up the build. To get around this, I removed any network adapter from the boot devices as per this overflow answer:

http://serverfault.com/questions/619763/can-pxe-boot-of-hyper-v-vms-be-disabled

This doesn't happen on Gen1 VM's as the boot order is hardcoded on Gen1.

taliesins and others added 30 commits November 23, 2016 06:49
Remove steps that are windows specific
Move builder into correctly named folder
Use the convention for default hdd size
Tests added for builder
…s how other system like VeeWee do it.

Add support for number of cpus to use for vm
Add support for vm generation
Attempt to stop vm, before deleting it
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
…reate a dvd drive for os if it does not exist.

Allow secure boot mode to be configured from config.
Get VName out of state. This allows template replacement to be run on vmname
Don't want to be prompted for confirmation from powershell commandlets
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.
…n array. Otherwise powershell may treat it as a property.

Stop-Vm with force parameter to ensure that powershell prompts will not appear
PatrickLang and others added 28 commits November 23, 2016 06:50
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.
…eople to leave the switch in trunk mode and set a vlan for the vm.
govendor fetch golang.org/x/text/encoding/unicode
Fix code type for formatting
Remove empty space
Remove configuration elements that are no longer used.
…Server 2016 no longer come with iso. So default to not loading guest additions when the iso is missing
…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
Copy link
Owner

@watsonlu surely all we need to do is set the first boot device to the dvd drive? Some people might actually want to make use of PXE.

Set-VMFirmware -VMName $vmName -FirstBootDevice $vmDvdDrive -ErrorAction SilentlyContinue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants