On Wed, Oct 17, 2012 at 3:49 PM, GordonJB <
g.bon...@gmail.com> wrote:
> So I take it that when the new VM announces itself to the network, it will
> go off to the DHCP server and pick a static IP if there is one defined
> already for it's MAC address in a config file somewhere?
Yes, that's correct. You can also set up a generic pool of addresses
that a VM may get one from if you don't know its MAC address, but then
you're not guaranteed to get the same IP address every time.
The problem I encountered with VMWare VMs was that the MAC address
wasn't generated until the VM was first powered on, so configuring
DHCP ahead of time wasn't possible. As we didn't have any automated
provisioning set up, the process was to do an initial boot and
interrupt the boot process fairly quickly and power the VM off. Then
I'd grab the MAC address from VSphere and pop it into the DHCP
server's config.
> Is there a way to have a MAC address/IP pairing generated if one does not exist?
I think the approach I'd take with this is to have a fairly small pool
of addresses used for temporary IPs while a box is being provisioned.
Once the box is up, you could have another puppet module that would
figure out, using some other policy (potentially as simple as doing a
DNS lookup on your VM's hostname), what the IP address of the box
should be, find the MAC address of the NIC (exposed by facter), then
put that in to the DHCP server's config. Automated provisioning
solutions such as Foreman or Razor
(
http://puppetlabs.com/blog/puppet-razor-module/) may have
better/other ways of doing it, but that would be my initial approach.
That Razor page also links to Puppetlabs' own DHCP module
(
https://github.com/puppetlabs/puppetlabs-dhcp), so I'd be prone to
try that for your DHCP config needs first, before looking at modules
on the Forge.
Regards,
Matt.