MAAS with existing dhcp server

Asked by drolfe

Hi All,

I'm having problems getting MAAS to work with an existing DHCP. I have a current server which is used for dhcp, PXE and tftp, I just can't figure out how to get this to work with my new MAAS server.

The wiki page below mentions that it would go into detail about this type of setup but only shows details of the dnsmasq method.

https://wiki.ubuntu.com/ServerTeam/MAAS

Any help I could get would be great

Regards, Daniel

Question information

Language:
English Edit question
Status:
Solved
For:
MAAS Edit question
Assignee:
No assignee Edit question
Solved by:
drolfe
Solved:
Last query:
Last reply:
Revision history for this message
Julian Edwards (julian-edwards) said :
#1

Hi, thanks for trying out MAAS!

It's impossible to help without knowing more about your setup. Can you say a bit more about exactly what's not working, error messages, logs etc., and describe your environment some more.

We've not really tested anything other than the internal DHCP so far, so it's very possible you found a bug.

Revision history for this message
drolfe (drolfe) said :
#2

HI,

Thanks for getting back to me,

I tried at first to use the internal dns but the pxe boot wouldn't work. The error message on the MAAS server was "dnsmasq: no address range available for DHCP request via eth0"

The scope I setup was 192.168.2.100-200

My eth0 has ip 192.168.2.213/24

Domain I set to nothing

The gateway I set to 192.168.2.1 (the router for the subnet)

This was with the default config

I'm running on a hp blade c7000, so the servers are bl460c gen1 with the BNX network cards running hp recommended firemware from 2010

I don't have a great understanding of dnsmasq and it's tftp service. Thats why I was just trying to use my existing DHCP/PXE server when the PXE failed.

I would be happy to get the internal DNS working (dnsmasq) and just go with that.

Please let me know if you need any more info.

Regards, Daniel

Revision history for this message
drolfe (drolfe) said :
#3

Sorry setting to "Still need an answer"

Revision history for this message
Dave Walker (davewalker) said :
#4

Hey Daniel,

If you have an existing DHCP server, you should *not* install maas-dhcp. You simply need to set the next-server value in your existing dhcpd to point to the MAAS server.

(note, with most DCHPd's you can set specific next-servers for varying mac address)

Alternatively, you can use avahi, as linked on the wiki.. but if you do have access to your existing dhcpd, you should really use that for a more polished experience.

Revision history for this message
drolfe (drolfe) said :
#5

HI,

I'm only running in a LAB so I've removed all other existing DHCP servers as I want to use the MAAS dhcp.

I've setup a new MAAS server install to try and get this working. Still having some problems with the PXE boot.

During the initial import of ios's I see the below error:

update-initramfs: deferring update (trigger activated)
update-rc.d: warning: open-iscsi stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6)
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-23-generic
df: Warning: cannot read table of mounted file systems: No such file or directory
df: Warning: cannot read table of mounted file systems: No such file or directory

A rerun of the ios import shows the below:

daniel@maas:~$ sudo maas-import-isos precise-x86_64: Up to date
precise-i386: Up to date
task started: 2012-04-23_220812_sync
task started (id=Sync, time=Mon Apr 23 22:08:12 2012)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/precise-x86_64-maas-ephemeral
removing: /var/www/cobbler/images/precise-i386
removing: /var/www/cobbler/images/precise-i386-maas-ephemeral
removing: /var/www/cobbler/images/precise-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/images/memtest86+_multiboot.bin
removing: /var/lib/tftpboot/images/precise-x86_64-maas-ephemeral
removing: /var/lib/tftpboot/images/memtest86+.bin
removing: /var/lib/tftpboot/images/precise-i386
removing: /var/lib/tftpboot/images/precise-i386-maas-ephemeral
removing: /var/lib/tftpboot/images/precise-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /boot/memtest86+_multiboot.bin -> /var/lib/tftpboot/images/memtest86+_multiboot.bin
trying hardlink /boot/memtest86+.bin -> /var/lib/tftpboot/images/memtest86+.bin
copying distros to tftpboot
copying files for distro: precise-x86_64
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/linux -> /var/lib/tftpboot/images/precise-x86_64/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/initrd.gz -> /var/lib/tftpboot/images/precise-x86_64/initrd.gz
copying files for distro: precise-i386
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/linux -> /var/lib/tftpboot/images/precise-i386/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/initrd.gz -> /var/lib/tftpboot/images/precise-i386/initrd.gz
copying files for distro: precise-i386-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/kernel -> /var/lib/tftpboot/images/precise-i386-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/initrd -> /var/lib/tftpboot/images/precise-i386-maas-ephemeral/initrd
copying files for distro: precise-x86_64-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/kernel -> /var/lib/tftpboot/images/precise-x86_64-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/initrd -> /var/lib/tftpboot/images/precise-x86_64-maas-ephemeral/initrd
copying images
generating GPXE/PXE configuration files
generating PXE menu structure
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
copying files for distro: precise-x86_64
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/linux -> /var/www/cobbler/images/precise-x86_64/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/initrd.gz -> /var/www/cobbler/images/precise-x86_64/initrd.gz
copying files for distro: precise-i386
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/linux -> /var/www/cobbler/images/precise-i386/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/initrd.gz -> /var/www/cobbler/images/precise-i386/initrd.gz
copying files for distro: precise-i386-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/kernel -> /var/www/cobbler/images/precise-i386-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/initrd -> /var/www/cobbler/images/precise-i386-maas-ephemeral/initrd
copying files for distro: precise-x86_64-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/kernel -> /var/www/cobbler/images/precise-x86_64-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/initrd -> /var/www/cobbler/images/precise-x86_64-maas-ephemeral/initrd
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
rendering DHCP files
rendering DNS files
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: service dnsmasq restart
received on stdout: * Restarting DNS forwarder and DHCP server dnsmasq
   ...done.

received on stderr:
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***
task started: 2012-04-23_220817_sync
task started (id=Sync, time=Mon Apr 23 22:08:17 2012)
running pre-sync triggers
cleaning trees
removing: /var/www/cobbler/images/precise-x86_64-maas-ephemeral
removing: /var/www/cobbler/images/precise-i386
removing: /var/www/cobbler/images/precise-i386-maas-ephemeral
removing: /var/www/cobbler/images/precise-x86_64
removing: /var/lib/tftpboot/pxelinux.cfg/default
removing: /var/lib/tftpboot/grub/efidefault
removing: /var/lib/tftpboot/grub/images
removing: /var/lib/tftpboot/images/memtest86+_multiboot.bin
removing: /var/lib/tftpboot/images/precise-x86_64-maas-ephemeral
removing: /var/lib/tftpboot/images/memtest86+.bin
removing: /var/lib/tftpboot/images/precise-i386
removing: /var/lib/tftpboot/images/precise-i386-maas-ephemeral
removing: /var/lib/tftpboot/images/precise-x86_64
removing: /var/lib/tftpboot/s390x/profile_list
copying bootloaders
trying hardlink /boot/memtest86+_multiboot.bin -> /var/lib/tftpboot/images/memtest86+_multiboot.bin
trying hardlink /boot/memtest86+.bin -> /var/lib/tftpboot/images/memtest86+.bin
copying distros to tftpboot
copying files for distro: precise-x86_64
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/linux -> /var/lib/tftpboot/images/precise-x86_64/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/initrd.gz -> /var/lib/tftpboot/images/precise-x86_64/initrd.gz
copying files for distro: precise-i386
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/linux -> /var/lib/tftpboot/images/precise-i386/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/initrd.gz -> /var/lib/tftpboot/images/precise-i386/initrd.gz
copying files for distro: precise-i386-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/kernel -> /var/lib/tftpboot/images/precise-i386-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/initrd -> /var/lib/tftpboot/images/precise-i386-maas-ephemeral/initrd
copying files for distro: precise-x86_64-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/kernel -> /var/lib/tftpboot/images/precise-x86_64-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/initrd -> /var/lib/tftpboot/images/precise-x86_64-maas-ephemeral/initrd
copying images
generating GPXE/PXE configuration files
generating PXE menu structure
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
copying files for distro: precise-x86_64
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/linux -> /var/www/cobbler/images/precise-x86_64/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-x86_64/initrd.gz -> /var/www/cobbler/images/precise-x86_64/initrd.gz
copying files for distro: precise-i386
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/linux -> /var/www/cobbler/images/precise-i386/linux
trying hardlink /var/www/cobbler/ks_mirror/precise-i386/initrd.gz -> /var/www/cobbler/images/precise-i386/initrd.gz
copying files for distro: precise-i386-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/kernel -> /var/www/cobbler/images/precise-i386-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/i386/20120328/initrd -> /var/www/cobbler/images/precise-i386-maas-ephemeral/initrd
copying files for distro: precise-x86_64-maas-ephemeral
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/kernel -> /var/www/cobbler/images/precise-x86_64-maas-ephemeral/kernel
trying hardlink /var/lib/maas/ephemeral/precise/server/amd64/20120328/initrd -> /var/www/cobbler/images/precise-x86_64-maas-ephemeral/initrd
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
warning: kernel option length exceeds 255
rendering DHCP files
rendering DNS files
rendering TFTPD files
generating /etc/xinetd.d/tftp
cleaning link caches
running post-sync triggers
running python triggers from /var/lib/cobbler/triggers/sync/post/*
running python trigger cobbler.modules.sync_post_restart_services
running: service dnsmasq restart
received on stdout: * Restarting DNS forwarder and DHCP server dnsmasq
   ...done.

received on stderr:
running shell triggers from /var/lib/cobbler/triggers/sync/post/*
running python triggers from /var/lib/cobbler/triggers/change/*
running python trigger cobbler.modules.scm_track
running shell triggers from /var/lib/cobbler/triggers/change/*
*** TASK COMPLETE ***

My config for dnsmasq

daniel@maas:~$ sudo cat /etc/dnsmasq.conf
# Cobbler generated configuration file for dnsmasq
# Mon Apr 23 12:08:18 2012

# resolve.conf .. ?
#no-poll
#enable-dbus
read-ethers
addn-hosts = /var/lib/cobbler/cobbler_hosts
#domain=

dhcp-range=192.168.2.220,192.168.2.245
dhcp-option=3,192.168.2.1
dhcp-lease-max=1000
dhcp-authoritative
dhcp-boot=pxelinux.0
dhcp-boot=net:normalarch,pxelinux.0
dhcp-boot=net:ia64,/var/lib/cobbler/elilo-3.6-ia64.efi

Cobbler config

daniel@maas:~$ cat /etc/cobbler/settings | grep -v "#"
---
allow_duplicate_hostnames: 0

allow_duplicate_ips: 0

allow_duplicate_macs: 0

anamon_enabled: 0

build_reporting_enabled: 0
build_reporting_sender: ""
build_reporting_email: [ 'root@localhost' ]
build_reporting_smtp_server: "localhost"
build_reporting_subject: ""

cheetah_import_whitelist:
   - "random"
   - "re"
   - "time"
   - "orchestra"

createrepo_flags: "-c cache -s sha"

default_kickstart: /var/lib/cobbler/kickstarts/ubuntu-server.preseed

default_name_servers: []

default_ownership:
    - "admin"

default_password_crypted: ""

default_virt_bridge: virbr0

default_virt_file_size: 5

default_virt_ram: 512

default_virt_type: qemu

enable_menu: 1

func_auto_setup: 0
func_master: overlord.example.org

http_port: 80

kernel_options:
    ksdevice: bootif
    lang: ' '
    text: ~
    locale: en_US
    priority: critical

kernel_options_s390x:
    RUNKS: 1
    ramdisk_size: 40000
    root: /dev/ram0
    ro: ~
    ip: off
    vnc: ~

ldap_server: "ldap.example.com"
ldap_base_dn: "DC=example,DC=com"
ldap_port: 389
ldap_tls: 1
ldap_anonymous_bind: 1
ldap_search_bind_dn: ''
ldap_search_passwd: ''
ldap_search_prefix: 'uid='

mgmt_classes: []
mgmt_parameters:
   from_cobbler: 1

puppet_auto_setup: 0

sign_puppet_certs_automatically: 0

puppetca_path: "/usr/sbin/puppetca"

remove_old_puppet_certs_automatically: 0

manage_dhcp: 1

manage_dns: 1

manage_tftpd: 1

manage_rsync: 0

manage_forward_zones: []
manage_reverse_zones: []

next_server: 192.168.2.213

power_management_default_type: 'ether_wake'

power_template_dir: "/etc/cobbler/power"

pxe_just_once: 1

pxe_template_dir: "/etc/cobbler/pxe"

consoles: "/var/consoles"

redhat_management_type: "off"

redhat_management_server: "xmlrpc.rhn.redhat.com"

redhat_management_key: ""

redhat_management_permissive: 0

register_new_installs: 0

reposync_flags: "-l -m -d"

restart_dns: 1
restart_dhcp: 1

run_install_triggers: 1

scm_track_enabled: 0
scm_track_mode: "git"

server: 192.168.2.213

snippetsdir: /var/lib/cobbler/snippets

template_remote_kickstarts: 0

use_gpxe: 0

virt_auto_boot: 1

webdir: /var/www/cobbler

xmlrpc_port: 25151

yum_post_install_mirror: 1

yum_distro_priority: 1

yumdownloader_flags: "--resolve"

daniel@maas:~$

daniel@maas:~$ sudo cobbler check
The following are potential configuration items that you may want to fix:

1 : debmirror package is not installed, it will be required to manage debian deployments and repositories
2 : One or more repos need to be processed by cobbler reposync for the first time before kickstarting against them: precise-x86_64, precise-i386, precise-i386-security, precise-x86_64-security

Restart cobblerd and then run 'cobbler sync' to apply changes.
daniel@maas:~$

open ports

daniel@maas:~$ sudo netstat -nultp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1106/apache2
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 905/epmd
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 11100/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 698/sshd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 860/postgres
tcp 0 0 127.0.0.1:5241 0.0.0.0:* LISTEN 611/python
tcp 0 0 0.0.0.0:5242 0.0.0.0:* LISTEN 1105/python
tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN 846/tgtd
tcp 0 0 127.0.0.1:25151 0.0.0.0:* LISTEN 1791/python
tcp 0 0 0.0.0.0:47457 0.0.0.0:* LISTEN 925/beam.smp
tcp6 0 0 :::53 :::* LISTEN 11100/dnsmasq
tcp6 0 0 :::22 :::* LISTEN 698/sshd
tcp6 0 0 :::3128 :::* LISTEN 844/squid3
tcp6 0 0 :::3260 :::* LISTEN 846/tgtd
tcp6 0 0 :::8000 :::* LISTEN 781/squid3
tcp6 0 0 :::5672 :::* LISTEN 925/beam.smp
udp 0 0 0.0.0.0:56110 0.0.0.0:* 650/avahi-daemon: r
udp 0 0 0.0.0.0:53 0.0.0.0:* 11100/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 11100/dnsmasq
udp 0 0 0.0.0.0:69 0.0.0.0:* 845/in.tftpd
udp 0 0 0.0.0.0:514 0.0.0.0:* 632/rsyslogd
udp 0 0 0.0.0.0:53933 0.0.0.0:* 844/squid3
udp 0 0 0.0.0.0:5353 0.0.0.0:* 650/avahi-daemon: r
udp 0 0 0.0.0.0:50462 0.0.0.0:* 781/squid3
udp6 0 0 :::60209 :::* 781/squid3
udp6 0 0 :::57023 :::* 650/avahi-daemon: r
udp6 0 0 :::53 :::* 11100/dnsmasq
udp6 0 0 :::53561 :::* 844/squid3
udp6 0 0 :::514 :::* 632/rsyslogd
udp6 0 0 :::5353 :::* 650/avahi-daemon: r

Revision history for this message
drolfe (drolfe) said :
#6

I don't have access to the server right now but I"m also seeing bootp errors similar to below in the syslog

dnsmasq BOOTP(eth0) <mac address> no address configured

However I didn't recognize the mac address that the bootP errors are coming from

Revision history for this message
Thomas Black (tsblack) said :
#7

I have the same question...

The documentation briefly mentions two dhcp scenarios but never discusses a configuration with existing DHCP server.

In my case I have an existing pfSense firewall and which to retain that. The firewall is already configured with a next-server option to point to the MaaS server as a result of my previous running Ubuntu Orchestra which I'm trying to upgrade to MaaS.

I *didn't* install the maas-dhcp server.

To add a node, I had to edit the following settings as MaaS complained otherwise:

allow_duplicate_hostnames: 0

allow_duplicate_ips: 0

allow_duplicate_macs: 0

All have now been set to 1; is that right?

When I provision a new server in MaaS, it appears as though the server is installed and comes online, but MaaS says that it's offline. If I click on the node itself, it says that it's commissioning, nothing ever changes to declared, which is what it seems to need to be.

The server itself appears to be provisioned - I have a command line, It's sitting on the network, it was assigned an IP address. How do I get it to 'declared'?

Thanks

-Thomas

Revision history for this message
Thomas Black (tsblack) said :
#8

As it turns out, my node wasn't provisioned. It wasn't because the pxelinux.cfg file for that mac still looked like this:

DEFAULT local
PROMPT 0
TIMEOUT 0
TOTALTIMEOUT 0
ONTIMEOUT local

LABEL local
        KERNEL chain.c32

Possibly that's because of the errors I received when trying to add the node. I fixed the errors by modifying those cobbler settings but possibly the node addition was incomplete.

So for starters, can someone just confirm what those cobbler settings should be when you're using an external DHCP server (with static lease defined if that matters)?

Thanks

-Thomas

Revision history for this message
sugizo (sugizo) said :
#9
Revision history for this message
drolfe (drolfe) said :
#10

I'll try MAAS server again with the full release, not the beta and see if I have the same problem. I'll close this case off

Revision history for this message
Rajasekar Karthik (karthik085) said :
#11

I am using MAAS 14.10 public release and I can confirm this problem exists. Just says commissioning. Also, very little documentation on how to setup with existing DHCP Server.

Is it possible to add an existing Ubuntu 14.10 Server or Desktop node to the Cluster. If so, how can this be done?

Revision history for this message
Rajasekar Karthik (karthik085) said :
#12

I do not know if anybody has already posted the solution earlier...hence posting it.

1. Setup Ubuntu 14.04 MAAS on a server which has two NICs
One NIC, say eth1 - Should be connected to your organization internet
Other NIC, say eth0 - This is where we will run our own DHCP Server.

2. All Nodes to be added to the cluster should be in the same switch

3. Sometimes, Ubuntu Cluster Interface - "Manage DHCP and DNS" does not work at first.
Easy to manually tweak and run DHCP Server, and then copy the effective settings to MAAS Cluster Interface.
Had to run Manual DHCP Server:
Files
/etc/dhcp/dhcpd.conf
/etc/network/interfaces
References:
https://help.ubuntu.com/community/dhcp3-server
http://maas.ubuntu.com/docs/hacking.html

3. Settings copied from /etc/dhcp/dhcpd.conf to /etc/maas/dhcpd.conf
Manual server shutdown
Cluster interface - “Manage DHCP and DNS” -> working (might require reboot)