I'm having fits with a new section that I've added to a working kickstart file. The new section is supposed to retrieve the MAC address for vmnic0 and then grep the MAC address from a file to obtain the server's hostname and other IP addresses.
Appears I have fixed my own problem here.
A couple of notes:
First off...in setting my variables, I had some redundant grep commands in there. Wasn't causing anything to fail, but just making note.
Secondly, the section "network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0" appears to have been the culprit. I can't say exactly where it was causing my script to fail, but when using DHCP, the server was receiving different DNS servers that caused the script to fail. I tried using IP addresses instead in my wget line, but it would still fail. The logs didn't help to clue me in as to why this occurred either. Quite bizarre.
Anyhow, I decided to just change the line to use a 'dummy' hostname and IP address and then execute an IP address and hostname change later based off of the txt file listing the IP addresses.
Hi,
Have you tried using the full path to the file?
Thanks for this suggestion.
It isn't the file that is the issue though as the following worked in my prior kickstart in which I hardcoded the IP address and hostname in the network section.
So to simplify my inquiry, why does calling the hostname command, $(hostname), work just fine though calling the variable, $HOSTNAME, fail? Is it due to the variables not being sourced when referenced in this manner (between ` ` s)?
Just had a look over some of my build scripts, any chance you can give this a go
Tried that as well and that format is unsuccessful as well.
I even tried the following no to avail. I just can't figure why the VMNIC0_MAC variable succeeds and I can't get the others to.
HOSTNAME=`grep $(esxcfg-nics -l |grep vmnic0| awk '{print $7}') vmknic_table | awk -F ";" {'print $1'}`
Still not having success.
What would actually be ideal is getting all of the variables and passing them into the network section.
Example:
Appears I have fixed my own problem here.
A couple of notes:
First off...in setting my variables, I had some redundant grep commands in there. Wasn't causing anything to fail, but just making note.
Secondly, the section "network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0" appears to have been the culprit. I can't say exactly where it was causing my script to fail, but when using DHCP, the server was receiving different DNS servers that caused the script to fail. I tried using IP addresses instead in my wget line, but it would still fail. The logs didn't help to clue me in as to why this occurred either. Quite bizarre.
Anyhow, I decided to just change the line to use a 'dummy' hostname and IP address and then execute an IP address and hostname change later based off of the txt file listing the IP addresses.