Came across this on my travels last night.
Like your style, girl. Posted without further comment (it might give the game away).
Something like Puppet could potentially make my life a lot easier.
Puppet can’t do baremetal provisioning; it needs the base OS to be Jumpstart/Kickstarted on first. Fortunately:
PXE boots require DHCP options that VMware doesn’t enable out of the box.
So I either tweak VMwares dhcpd or use Cobblers DHCP support.
Either choice is fine (they both use ISCs DHCPd anyway);
if you don’t want the overhead of running your cobbler VM all the time,
it probably makes sense to tweak VMwares dhcpd.conf.
Cobbler can add static DHCP entries for systems you define,
(and manage DNS too) so it makes life easier for me
(IRL I’ll have to bribe the DHCP guys to add some options).
EPEL is a collection of decent RPMs (including cobbler and puppet) for RHEL, Fedora and CentOS.
Tell yum about them and install cobbler :
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum install -y cobbler
(You’ll need to do this if you installed CentOS to use DHCP, which is the easiest way on VMware)
First, find out your IP, gateway and netmask.
ifconfig eth0 | grep 'inet addr'; netstat -rn | grep UG
inet addr:192.168.21.134 Bcast:192.168.21.255 Mask:255.255.255.0
0.0.0.0 192.168.21.2 0.0.0.0 UG 0 0 0 eth0
So you need to
echo "GATEWAY=192.169.21.2" >> /etc/sysconfig/network
edit /etc/sysconfig/network-scripts/ifcfg-eth0
# take this out
BOOTPROTO=dhcp
# add these
BOOTPROTO=static
IPADDR=192.168.21.134
NETMASK=255.255.255.0
Then /etc/init.d/network restart.
(NB: Other VMs won’t get DHCP responses until cobbler takes over (duh)).
comment out around line 570 of /Library/Application Support/VMware Fusion/boot.sh
569 ######
570 # let shoemaker do this
571 ### # vmnet-dhcpd puts itself in the background (daemon mode)
572 ### "$LIBDIR/vmnet-dhcpd" -cf "$LIBDIR/vmnet8/dhcpd.conf" \
573 ### -lf "$LEASEDIR"/vmnet-dhcpd-vmnet8.leases \
574 ### -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8
575 #####
(Hint: vmnet8 is the NATted subnet, vmnet1 is the host-only one. Edit the right one.)
Then sudo boot.sh –restart.
Note: docs refer to ’/var/lib/cobbler/settings’, but my RPM put it at /etc/cobbler/settings
‘cobbler check’ tells you what it needs you to edit. Obey.
Put this in settings:
manage_dhcp: 1
next_server: 'ip-of-cobbler-box'
server: 'ip-of-cobbler-box'
Finally, edit /etc/cobbler/dhcp.template
(man dhcpd.conf and/or crib from /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf) – my effort is here .
cobbler sync builds your DHCP config, /etc/init.d/dhcpd start makes it live.
If dhcpd won’t start, you cocked up the template. Check /var/log/messages, tweak, ‘cobbler sync’, rinse, repeat.
We can use the install ISO to build a distro and boot profile
mount /dev/cdrom /mnt
# copies the DVD onto disk
cobbler import --mirror=/mnt --name=centos5
cobbler sync
Make a new VM.
Change any VM settings if you like (defaults are ok).
Power up the VM. You should see it:
Choose ‘centos5’ and you’re away.
I’ll do a followup article soon with a few tricks/gotchas I’ve found so far. In the meantime: