Setting up a Chef Environment for OpenStack

At this stage, you will have a functioning OPSCODE CHEF SERVER, as well as a PUPPETLABS RAZOR ENVIRONMENT, so we can now begin to configure our OpenStack environment. For this, our Chef Server uses a .json file to define the attributes that will make up our environments, such as networks and services.

If you would like to build your career with an OpenStack certified professional, then visit Mindmajix - A Global online training platform: “OpenStack Training” Course. This course will help you to achieve excellence in this domain.

Setting up a Chef Environment for OpenStack Cookbooks

To set up our environment, first, log into the Chef Server and sudo to root:

vagrant ssh Chef 
sudo su -

How to log into Chef Server

Once logged into the Chef Server, run the following commands:

cat > /root/.chef/cookbook.json <

Once you have created the file, the next step is to import it into Chef:

knife environment from file /root/.chef/cookbook.json

OpenStack Cookbooks

The OpenStack cookbooks we imported earlier, will need details about the environment to be built. The advantage of keeping these details in Chef Server environments, is it allows you to use the same Chef Server for testing, staging, and production. Further, keeping our configuration details in a file allows us to check them into a version control system to track exactly how an environment was built and changed over time.

In the cookbook.json file we created, we provided the minimum required to stand up OpenStack. Specifically, there are several important sections. The first one configures the OpenStack Image service Glance to download the Cirros and Ubuntu Precise images. Additionally, it configures glance to allow uploads:

"glance": { "images": [
"image_upload": true

Next, we provided details for configuring the Nova Compute service. In our example, we specified that we want to use qemu as our virtualization engine. In a production environment, you would want to change this to KVM, Xen or others. Additionally, we set up an API rate limit, this is a test environment after all, and enabled volumes:

MindMajix YouTube Channel

"nova": { "libvirt": {
"virt_type": "qemu"
}, "ratelimit": {
"api": { "enabled": true
}, "volume": {
"enabled": true

Next, we specify networking details. Specifically, we specify bridge devices, DNS information, how many networks to create, the size of the network and then some:

"networks": [
"label": "public", "bridge_dev": "eth1", "dns2": "", "num_networks": "1",
"ipv4_cidr": "", "network_size": "255", "bridge": "br100",
"dns1": ""

The next several sections specify how to configure services like MySQL or Monitoring as well as provide directions for where the cookbooks can find the networks configured on our node

Course Schedule
OpenStack TrainingJul 27 to Aug 11View Details
OpenStack TrainingJul 30 to Aug 14View Details
OpenStack TrainingAug 03 to Aug 18View Details
OpenStack TrainingAug 06 to Aug 21View Details
Last updated: 01 May 2023
About Author

Ravindra Savaram is a Technical Lead at His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

read less
  1. Share:
OpenStack Articles