Home / OpenStack

Setting up a Chef Environment for OpenStack

Rating: 4.0Blog-star
Views: 2225
by Ravindra Savaram
Last modified: March 31st 2021

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.

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": [
"cirros",
"precise"
],
"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:

"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": "8.8.4.4", "num_networks": "1",
"ipv4_cidr": "10.10.100.0/24", "network_size": "255", "bridge": "br100",
"dns1": "8.8.8.8"
}
]

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

About Author

author
NameRavindra Savaram
Author Bio

 

Ravindra Savaram is a Content Lead at Mindmajix.com. 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.