Configure your devstack

$ git clone https://github.com/openstack-dev/devstack.git
$ cd devstack

Edit your localrc as below. Make sure to change the network and baremetal settings to your own environment, of course.

# Credentials
ADMIN_PASSWORD=yourpassword
MYSQL_PASSWORD=yourpassword
RABBIT_PASSWORD=yourpassword
SERVICE_PASSWORD=yourpassword
SERVICE_TOKEN=yourtoken

# Logging
LOGFILE=/opt/stack/data/stack.log
 
# Services
disable_service n-net
enable_service q-svc
enable_service q-agt
disable_service q-dhcp
disable_service q-l3
disable_service q-meta
enable_service neutron
ENABLED_SERVICES+=,baremetal
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
 
#Network 
HOST_IP=10.0.0.30
FIXED_RANGE=10.0.0.0/24
FIXED_NETWORK_SIZE=256
NETWORK_GATEWAY=10.0.0.1
PUBLIC_INTERFACE=eth0
 
#Neutron settings if FlatNetwork for Baremetal
PHYSICAL_NETWORK=ctlplane
OVS_PHYSICAL_BRIDGE=br-ctlplane
ALLOCATION_POOL="start=10.0.0.31,end=10.0.0.35"
 
# Baremetal Network settings
BM_DNSMASQ_IFACE=br-ctlplane
BM_DNSMASQ_RANGE=10.0.0.31,10.0.0.35

# Global baremetal settings for real nodes
BM_POWER_MANAGER=nova.virt.baremetal.ipmi.IPMI
VIRT_DRIVER=baremetal
BM_DNSMASQ_DNS=8.8.8.8

# Change at least BM_FIRST_MAC to match the MAC address of the baremetal node to deploy
BM_FIRST_MAC=AA:BB:CC:DD:EE:FF
BM_SECOND_MAC=11:22:33:44:55:66

# IPMI credentials for the baremetal node to deploy
BM_PM_ADDR=10.0.1.102
BM_PM_USER=yourlogin
BM_PM_PASS=yourpass

# Make sure to match your Devstack hostname
BM_HOSTNAME=bm-devstack

Start the stack.

$ ./stack.sh

Prevent dnsmasq to attribute other leases

As there is probably another DHCP server in the same subnet, we need to make sure local dnsmasq won't serve other PXE or DHCP requests. One workaround can be to deploy 75-filter-bootps-cronjob and filter-bootps from TripleO which iptables-blacklists all DHCP requests but the ones setup by baremetal driver.

Create a single Ubuntu image with a few additions and add it to Glance

As Devstack is only providing a CirrOS image, there is much of benefits to deploy a custom Ubuntu image. Thanks to diskimage-builder provided again by TripleO folks (thanks by the way!), we can add as many elements as we want.

 
$ git clone https://github.com/openstack/diskimage-builder.git
$ git clone https://github.com/openstack/tripleo-image-elements.git
$ export ELEMENTS_PATH=~/tripleo-image-elements/elements
$ diskimage-builder/bin/disk-image-create -u base local-config stackuser heat-cfntools -o ubuntu_xlcloud
$ diskimage-builder/bin/disk-image-get-kernel -d ./ -o ubuntu_xlcloud -i $(pwd)/ubuntu_xlcloud.qcow2
$ glance image-create --name ubuntu_xlcloud-vmlinuz --public --disk-format aki < ubuntu_xlcloud-vmlinuz
$ glance image-create --name ubuntu_xlcloud-initrd --public --disk-format ari < ubuntu_xlcloud-initrd
$ glance image-create --name ubuntu_xlcloud --public --disk-format qcow2 --container-format bare \
--property kernel_id=$UBUNTU_XLCLOUD_VMLINUZ_UUID --property ramdisk_id=$UBUNTU_XLCLOUD_INITRD_UUID < ubuntu_xlcloud.qcow2

Boot the stack !

Of course, we can provide a Heat template, but leave it simple for now :

$ nova keypair-add --pub-key ~/.ssh/id_rsa.pub sylvain
$ nova boot --flavor bm.small --image ubuntu_xlcloud --key-name sylvain mynewhost