packer centos7 no dhcp

332 views
Skip to first unread message

Shankar Bala

unread,
Dec 14, 2017, 11:23:02 PM12/14/17
to Packer
Hi All

I have packer config file that uploads ISO to esxi server and run our kickstart file..it uses dhcp and this works perfectly on centos6 box., whereas on centos7 same config doesn't work.

I noticed that packer is created the vm and then finally it timeout while doing ssh to it.

I logged into the vm., and I noticed the vm is not getting dhcp ip ., whereas packer logs shows the ip of the vm. To fix this., I manually login to the console of the vm., then type "dhclient <interface name>"..as soon as I do this., packer continue to finish the post processor task and my template is getting created.

however I want to avoid this manual interventions..is it due to interface name of centos7 as its not eth0 by default ?

any idea on this ?

Shan


Ian W

unread,
Dec 14, 2017, 11:28:31 PM12/14/17
to Packer
Do you have something like the following in your kickstart file:

network  --bootproto=dhcp --device=<nic you want here> --activate

Rickard von Essen

unread,
Dec 15, 2017, 12:11:49 AM12/15/17
to packe...@googlegroups.com
Please supply your Kickstart file. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/f5c86a7a-beff-45d5-8d2e-b913f26765a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shankar Bala

unread,
Dec 15, 2017, 12:54:29 AM12/15/17
to Packer
hi

below is my kickstart file

===

####
# KICKSTART
####
##key --skip
rootpw xxxx
network --bootproto dhcp --hostname testserver
timezone --utc US/Pacific
eula --agreed
services --enabled=sshd
services --disabled=NetworkManager

part /tmp --fstype=xfs --size=16000 --asprimary --ondisk=sda
part swap --size=16000  --ondisk=sda
part /boot --fstype=xfs --size=256 --ondisk=sda
part /home --fstype=xfs --size=12000 --ondisk=sda
part /var/log --fstype=xfs --size=16000 --ondisk=sda
part / --fstype=xfs --size=64000 --ondisk=sda
part /apps --fstype=xfs --size=1 --grow --ondisk=sda

####
# KICKSTART COMMON
####
install
text
reboot
keyboard us
lang en_US.UTF-8
authconfig --enableshadow --enablemd5
firewall --disabled
selinux --disabled
zerombr
bootloader --location=mbr
clearpart --all --initlabel

####
# Setting Up Repos
####
repo --name="centos-7" --baseurl="http://opsrep/RHEL/centos/7/os/x86_64/"

%packages
@core
net-tools
policycoreutils
screen
tree
vim
wget
%end

%pre
wget http://kickstart/users/users.sh -O /tmp/users.sh
%end
%post --nochroot
mv /tmp/users.sh /mnt/sysimage/tmp/users.sh
%end
%post
sh /tmp/users.sh
rm -f /tmp/users.sh
%end
# EOF

====

I have tried removing biosdevname rpm and also tried adding net.ifnames=0 option in the above boot loader options..but no luck.

shan

Rickard von Essen

unread,
Dec 15, 2017, 3:20:47 AM12/15/17
to packe...@googlegroups.com
Doesn't 
services --disabled=NetworkManager
make dhcp not run automatically. I think you should get everything running before changing the default network setup.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.

Shankar Bala

unread,
Dec 16, 2017, 9:37:19 AM12/16/17
to packe...@googlegroups.com
Hi Richard

That worked...(removing network manager line)..thanks a lot for your help.

Shan
You received this message because you are subscribed to a topic in the Google Groups "Packer" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/packer-tool/qcUUStEEqF0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt9GmcHshB8FZGH2EV6qX7MkxWq%3D_nb%2Bq3PvyHW1Y%2BRd%3DA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages