VMware Cloud Community
virtualDD
Enthusiast
Enthusiast

Kickstarting ESXi 6.5: IPv4 Address not being set

Hi guys,

I'm fairly experienced doing scripted installs of esxi dating back to esxi 4.1. With the latest release (6.5.x) however I'm getting some issues.

The issue is: my ipv4 address for the management is not being set and therefore the host is not usable after the installation.

Here is what I do to install:

vmaccepteula 
rootpw --iscrypted here_is_my_password

# Install parameters
#Local Storage, HP Raid Controller Driver
install --firstdisk=hpsa,local --overwritevmfs 

network --bootproto=static --device=vmnic0 --ip=192.168.10.100 --netmask=255.255.255.0 --gateway=192.168.10.1 --nameserver=192.168.10.1 --hostname=ESXi6.virtualfrog.lab --vlanid=00 --addvmportgroup=0

reboot --noeject

This however results in my ipv4 configuration to be set to "disabled". It does not matter if I try this on a nested esxi on my VMware Fusion or if I use a HPE Bladeserver.

I have a workaround by setting the ip again during the %firstboot part of my kickstart script, but I wonder if you guys are having trouble with the 6.5 kickstart install as well or if I missed some change in 6.5 regarding kickstart installation.

Edit: Here is the link to the documentation center regarding this approach for 6.5. As far as I can see I follow the procedure accordingly: VMware vSphere 6.5 Documentation Library

Edit2: I have done some more research and found something in the "firstboot_hostd.log" after installation which confuses me:

Screen Shot 2017-06-16 at 09.39.48.png

First box: Deleting Management Interface (Why would it do that?)

Second Box: Skipping over vmknic vmk0, ip: 0.0.0.0/0 in gateway reachability test (maybe because it was deleted in the first box?)

Third box: invalid Ip Netmask: 192.168.10.255 (that would be the network address, I find this nowhere in my script so why does esxi assume this to be a netmask?)

fourth box: Tagging vmk0 as management (appears many times) failed because it is already tagged with management (why does esxi tag the same interface multiple times?

edit3: I've noticed that the IP actually gets deleted during the kickstart phase:

Screen Shot 2017-06-14 at 11.47.23.png

(if the picture is too small: in the middle it says "HostIPAddr" = 0.0.0.0", Old value "192.168.10.100")

I am disabling ipv6 in my kickstart script. I will try to see if it keeps the ip when I don't disable ipv6..

edit4: (the install without disabling ipv6 is still running..)

I found something interesting when I look at the vmkernel log during install:

Screen Shot 2017-06-16 at 15.09.28.png

here you see the "DEBUG" line with all my parameters from the network config

Screen Shot 2017-06-16 at 15.09.59.png

but then a little further into the install it says: "Network choices not specified. Using DHCP"

hmm...

edit5: the install without disabling ipv6 went through.. but other than there now is some sort of ipv6 address after the install my ipv4 address is still missing..

I'm going to have a look at those network parameters which esxi 6.5 thinks were not specified..

edit6: is anybody actually reading/following this? if you do, give me a shout^^
I checked the network parameters forwards and backwards, I  cannot find any mistakes. I even put new quotation marks around them (weren't any before) but the string where the parameters are being validated looks exactly the same and it still says it will use DHCP. my next test is to remove the rest of my script and just do a "plain install" with no additional configuration. This way I'll find out if the error is caused by something in my (quite large) %firstboot script... stay tuned (or not)

edit7:

well, it turns out my %firstboot script seems to trigger the missing ipv4.. (kind of embarrassing..^^)

Screen Shot 2017-06-16 at 15.45.06.png

Now I just have to go through 1114 lines of code to find one line that somehow offends esxi 6.5 which all prior releases were fine with. yay

I'll post my findings here..

Final Edit (and Solution):

With ESXi 6.5 VMware changed the runtime of the kickstart script and also some command line outputs. My Wrapper Scripts had piped "awk" commands which were now returning the wrong values (like the network 192.168.10.255 as I've seen in the log) and then uses those wrong values trying to recreate the vSwitch0 and the management IP.

I fixed it all now by running each command on a running ESXi 6.5 host and comparing the result with what I'm expecting in the script. I now have an if clause so that when it detects ESXi 6.5 it will use the new return values of the relevant commands. Lesson learned: Always test if your script function still work as expected with a new major release of ESXi.

The command that changed the number/order of outputs and broke my script in ESXi 6.5 were:

esxcli network vswitch standard list

esxcli network ip interface ipv4 get

0 Kudos
2 Replies
Ybbom
Contributor
Contributor

Thank you! That helps me a lot Smiley Happy

0 Kudos
NonnaU1
Contributor
Contributor

Hi, I've got similar similar Deleting vmk0 when installing ESXi6.7 on Dell hardware.

funny, but this same script works perfectly fine on Cisco hardware to install 6.5 and 6.7 ESXi

it was interesting to read your post, not i have to figure out what is wrong with mine...

0 Kudos