Razor Server Setup for PXE Booting: A Comprehensive Guide
When managing IT infrastructure, automating the process of provisioning and booting servers can save valuable time and resources. Razor Server, when combined with PXE (Preboot Execution Environment) booting, streamlines the deployment of systems across your network. In this guide, we will walk you through the complete Razor server setup process, including installation and configuration, ensuring a seamless PXE boot experience.

What You Need to Get Started
Before diving into the setup, ensure that you have the following in place:
- Puppet Master Server running on a supported OS.
- Razor Server installed on a CentOS/Redhat 7 server.
- A Separate DHCP Network for PXE booting.
Once these prerequisites are met, you’re ready to begin the Razor server setup.
Step 1: Installing DNSMasq for PXE Booting
First, you need to install DNSMasq, which will handle DHCP and TFTP services for the Razor server.
- On your Razor server, run the following command to install DNSMasq:
yum install dnsmasq - Next, create a directory for TFTP boot and set the correct permissions:
mkdir /var/lib/tftpboot chmod 655 /var/lib/tftpboot/
Step 2: Configuring SELinux
By default, SELinux might block necessary operations for DNSMasq. Check whether SELinux is enabled:
sestatus
If it’s enabled, disable it by editing the SELinux configuration:
vi /etc/sysconfig/selinux
SELINUX=disabled
Step 3: Setting Up DNSMasq
You will need to configure DNSMasq for PXE booting.
- Set the hostname for the Razor server:
hostnamectl set-hostname razor.zippyops.com - Modify the DNSMasq configuration file (
/etc/dnsmasq.conf) to include a DHCP range and PXE boot setup:dhcp-range=10.0.0.20,10.0.0.50,24h conf-dir=/etc/dnsmasq.d - Create a configuration file for Razor in
/etc/dnsmasq.d/razorand add the following:dhcp-match=IPXEBOOT,175 dhcp-boot=net:IPXEBOOT,bootstrap.ipxe dhcp-boot=undionly-20140116.kpxe enable-tftp tftp-root=/var/lib/tftpboot
Step 4: Enabling and Starting DNSMasq
Enable DNSMasq to start on boot and start the service:
systemctl enable dnsmasq.service
systemctl start dnsmasq.service
Verify that DNSMasq is running:
systemctl status dnsmasq.service
Step 5: Installing Razor Server
On the same CentOS/Redhat 7 server, proceed to install Razor:
- Set the environment variables in the ~/.bash_profile:
RAZOR_HOSTNAME=`hostname` HTTP_PORT=8150 HTTPS_PORT=8151 - Run the installation script to install Razor from the Puppet Master:
curl -k https://puppetmaster.zippyops.com:8140/packages/current/install.bash | sudo bash
Step 6: Checking Razor Server Installation
Verify that the Razor server is up and running. You can test this by fetching the Razor API:
wget https://razor.zippyops.com:8151/api -O test.out --no-check-certificate
You should see a JSON output confirming that the server is running. Additionally, you can check the Razor server’s service status:
systemctl status pe-razor-server
Step 7: Setting Up PXE Boot Images
Next, populate the TFTP directory with necessary PXE boot images:
- Download the iPXE boot image and place it in the TFTP boot directory:
wget https://s3.amazonaws.com/pe-razor-resources/undionly-20140116.kpxe cp undionly-20140116.kpxe /var/lib/tftpboot - Fetch the PXE bootstrap script:
wget "https://razor.zippyops.com:8151/api/microkernel/bootstrap?nic_max=1&http_port=8150" -O /var/lib/tftpboot/bootstrap.ipxe --no-check-certificate
Step 8: Creating a Repository for OS Installation
Now, create a repository for an Ubuntu OS installation:
razor create-repo --name ubuntu-14.04 --task ubuntu/trusty --iso url http://releases.ubuntu.com/trusty/ubuntu-14.04.6-server-amd64.iso
This will download the Ubuntu ISO and create the repository.
Step 9: Managing Nodes and Tasks
You can now manage nodes and tasks in Razor. For example, use Razor’s API to query nodes:
razor --url https://razor.zippyops.com:8151/api nodes
Razor comes with pre-built tasks to help you automate provisioning. You can check available tasks with:
razor tasks
Link the Ubuntu 14.04 repository to the appropriate task:
razor update-repo-task --repo ubuntu-14.04 --task ubuntu/trusty
Step 10: Creating and Assigning Policies
A policy ties everything together: the repository, broker, and tags. Create a policy to link the Ubuntu repo with the PE broker:
razor create-policy --name ubuntuTest --repo ubuntu-14.04 --broker pe --tag ubuntutest --hostname 'ubuntu-test' --root-password myPassword
Conclusion: Automating PXE Boot and Razor Server Provisioning
Setting up a Razor server for PXE booting and automated provisioning simplifies server management and accelerates your infrastructure deployment. By following the steps outlined in this guide, you can configure Razor to handle PXE boot requests and provision nodes seamlessly. If you require professional DevOps, DevSecOps, or Cloud infrastructure management, ZippyOPS provides expert consulting, implementation, and managed services tailored to your needs.
To optimize your operational efficiency and manage your systems securely, explore more about ZippyOPS’s services, including AIOps, MLOps, DataOps, and more at ZippyOPS Solutions. For expert guidance, reach out to us at sales@zippyops.com.



