Open ghost opened 3 years ago
I stumbled across this thread as well as a comment on the hyperv iso builder page. As a work around, I modified the packer-hyperv-iso
virtual switch to use the External network rather than the Internal network.
After that, the build was successfully able to obtain an IP address and progress with the build of Ubuntu.
Internally, Hyper-V does not provide a DHCP-server.
I also ran into this issues recently, I don't think its related to this plugin but rather Hyper-V itself as it occurred from time to time also during VM provisioning through Vagrant. In both cases I have used the Default switch
which does provide DHCP services through ICS. In my case (Build 19042) a host reboot solved the issue.
This issue should be closed. Machine getting no DHCP lease has nothing todo with the packer plugin rather with the fact, that no DHCP server was available at build time.
This issue was originally opened by @ckl-syrocon as hashicorp/packer#8488. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
Overview of the Issue
I am trying to build a hyper-v image using a custom .iso-image. The image itself is valid and works in manual tests. However, there is no DHCP lease when using the hyper-v builder and thus our kickstarter file fails.
Reproduction Steps
Option A)
packer build .\iso.json
using the given BuildfileOption B)
dhcpclient -v etho0
Packer version
Packer v1.4.5
Simplified Packer Buildfile
Operating system and Environment details
Windows 10 Host Hyper-V Version 10.0.17763.1
Log Fragments and crash.log files
When checking through the hyper-v manager, there is no IP address allocated to the VM.
Booting into the dracut shell, we can check the network status using
ip addr
. The result shows no allocated IPv4 address for eth0.