Notes on Openstack

What is OpenStack and why should I need it?

In short terms: OpenStack is a collection of software, made to control resources (e.g. CPU, Harddisks, RAM, etc.) on many hosts efficiently. In other words: it’s a cloud management/orchestration system.
I use it to provision VMs.

Do you need it?
That depends.
If you are planning to go cloud native and develop all your software with solely DevOps principles in Mind (e.g. lean and agile) and to be fully stateless and REST-ified, the you might just jump to Kubernetes.
If you think another management Layer underneath it, so that you can manage (e.g.) several Kubernetes-Clusters on (e.g.) VMs and separate VMs (with a good developed Service catalogue and self service functions, etc.), wont hurt, you could give it a try.
Also be aware that this adds another level of complexity to your infrastructure (and I mean it…).

What’s this about?

In this post I’ll cover what I’ve learned about OpenStack during the installation.
This is not a HowTo per se.
An excellent HowTo (the one I worked with) can be found on the OpenStack Site:
https://docs.openstack.org/newton/install-guide-debian/
These notes are meant to be used with the above HowTo and to generally learn about the OpenStack.
Also, it pretty much compiles the more relevant (for me, at least at the moment) parts of the setup, so one gets to a working installation more quickly.

Pre-requisites

  • one will need at least two nodes (controller and worker) for a working setup
  • I recommend at least four (redundant master and workers)
  • the setup of block-/objectstorage nodes is not covered here

Installation (the Basics)

These are the most basic packages needed, categorized by node type.

CategoryItemHostNote
Basic2 NIC (Mgmt./Traffic)all1 Interface should be reserved exclusively for the communication/synchronization of the hosts.
The other is used for “normal” traffic.
BasicChronyallInstall chrony on all hosts and make sure ntp sync works and all hosts have the same time.
BasicPython-openstackclientallopenstackclient is needed on every host (read here how to install it: https://docs.openstack.org/newton/install-guide-debian/environment-packages.html)
BasicmariadbMasterthe master needs a database, I use mariadb but you may also use postgres.
BasicRabbitmq-serverMastera message broker is needed others may be used as well.
Note your username and password.
https://docs.openstack.org/newton/install-guide-debian/environment-messaging.html
BasicMemcachedMastermemcached is needed on the master to store auth tokens.
https://docs.openstack.org/newton/install-guide-debian/environment-memcached.html

Installation (ID-Service)

Now that the basic packages are installed, the Installation and Configuration of OpenStacks Services may begin. As mentioned above, OS consists of several modular Services of which some are mandatory and others optional.
The ID-Service is mandatory, runs on the master and is needed to authenticate and authorize (Tool-)users, it also manages the service catalogue (more on this later).
It’s Name ist keystone.
The relvant part of OpenStacks documentation is:
https://docs.openstack.org/newton/install-guide-debian/keystone-install.html

ID-ServiceMysql-ConfigMasterCREATE DB keystone, GRANT
ID-ServicekeystoneMasterinstall the keystone packages (keystone itself consists of several components).
ID-Servicekeystone ConfMasterconfigure the DB and the fernet token provider

The fernet tokens are bearer tokens used for authentication (more info: https://docs.openstack.org/keystone/pike/admin/identity-fernet-token-faq.html)
ID-Serviceconf apache enable wsgi-site Masterconfigure apache + enable mod-wsgi
In my case the correct module was not installed automatically so you might need to “apt-get install libapache2-mod-wsgi”.
Also there wer problems related to python3 on the system (I’m writing this from my notes) so if it does not work out of the box you might want to check python versions and dependencies.
ID-Service exports (nochmal anschauen!)MasterLogin Config
add a new user for this or just do it as root.
ID-Servicecreate configs and shell aliases for admin and user accessMasterfor now I’ve just added several echo “export FOO=”
to /etc/admin_openrc_cmd and /etc/demo_openrc_cmd.
also some aliases:
alias demo-openrc=’eval $(/etc/demo_openrc_cmd)’

Installation (Image Service)

Next is the Image Service (named glance) it enables our users (self service) to discover, register and retrieve virtual machine images.
https://docs.openstack.org/newton/install-guide-debian/glance-install.html

Imageserviceconfigure a file backendMasterIn productive Environments this should be on a separate Storage, for testing purposes it is sufficient to use a separate filesystem/directory.
Citation:
“Storage repository for image files
Various repository types are supported including normal file systems (or any filesystem mounted on the glance-api controller node), Object Storage, RADOS block devices, VMware datastore, and HTTP. Note that some repositories will only support read-only usage.”
ImageserviceDB erstellenMasterglance db user: username, pw:password
Imageservicecreate user endpointsMasterdefine groups and users that may use (parts of) the image service.
Imageserviceinstall glance Masterglance from jessie-backports + configs + glance-services, glance-api (restart)
Imageserviceupload image (debian)MasterI just used some debian image in qcow2 format.

Installation (Compute Service)

The compute service is the core of this IaaS Setup and interacts with the identity- and image service for auth and deployments, as well as dashboards, it also manages the Hypervisor on nodes, etc..
The Name is: Nova.
https://docs.openstack.org/newton/install-guide-debian/nova-controller-install.html
https://docs.openstack.org/newton/install-guide-debian/common/get-started-compute.html

ComputeserviceDB-ConfigMastercreate Nova and nova_api db, user config, etc.
Computeserviceinstall Nova Service Masternova-api nova-conductor nova-consoleauth nova-consoleproxy nova-scheduler
Computeservicemake dbs known in Novaconfig Master/etc/nova/nova.conf (mysql config)
ComputeserviceRabbitMQ Masterconfigure rabbitMQ, read the docs:
https://docs.openstack.org/newton/install-guide-debian/nova-controller-install.html
ComputeserviceCompute-DB Masterexecute the scripts to initialize the compute db.
Computeservicerestart Nova ServicesMasterrestart
Computeserviceinstall nova-compute ComputeNodeInstall nova-compute services (provides hypervisor, etc.)
Computeserviceconfigure Nova-Compute (VNC, etc.)ComputeNodehttps://docs.openstack.org/newton/install-guide-debian/nova-compute-install.html
ComputeservicefirewallingComputeNode5672 out
ComputeservicefirewallingMaster5672 in

Installation (Networking Service)

At last, for now, the networking service must be installed and configured.
Here one has to make a decision, even for the test-setup.
There are two modes: provider and SelfService.
Provider leaves it up to you to configure the networks for services/VMs and selfService is what the name says.
Read more on the concepts:
https://docs.openstack.org/newton/install-guide-debian/neutron-concepts.html
Also, check the installation guide:
https://docs.openstack.org/newton/install-guide-debian/neutron-controller-install.html

Networkservicecreate DBMasterDB-Name: neutron, User: neutron, pw: password
Networkservicecreate openstack user: (Team/Your)userMasteruse the script created above and create the user.
Networkserviceadd openstack admin role to the neutron
User
Masteruse the script, follow the howTo.
Networkservicecreate neutron ServiceMasteruse the script, follow the howTo.
Networkservicecreate Network (Provider)MasterAs stated above:
2 possibilities, Provider and SS.
For testing admin is probably the best as one will need an appropriate infrastructure to make sense of user defined routing/ips and the like.
NetworkserviceNeutron Pakete installierenMasterfollow the howTo
Networkserviceconfigure Networking ServeMaster(Server contains. DB, Message Queue, Auth, topology change, plug-ins, etc.)
/etc/neutron/neutron.conf (keystone, Auth, ml2 plugin, rabbitmq)
Networkserviceconfigure MLayer2 Plugin Master/etc/neutron/plugins/ml2/ml2_conf.ini
Networkserviceconfigure linuxbridge agent Master/etc/neutron/plugins/ml2/linuxbridge_agent.ini
IT’s recommended to configure the firewall driver.
make sure to either integrate or disable an already firewall.
Networkserviceconfigure dhcp agentMaster/etc/neutron/dhcp_agent.ini
Networkserviceconfigure metadata agent Master/etc/neutron/metadata_agent.ini
metadata_secret=mysecret
Networkserviceconfigure Compute Service konfen to use the
Networking Service
Master/etc/nova/nova.conf
Networkserviceinitalize DBMasterNeutron-db-manage (just follow the howto)
Networkserviceinstall the Compute Nodes ComputeNode
(just follow the howto)

Conclusion

Installation is possible (though problematic because of python2/3 dependencies on some packages (openstack is written mostly in python).
Also the documentation is quite excellent.
I fear updating it though, because it very much depends on versioned APIs, I guess at least a second cluster should be build – one for testing, one for production – if testing is stable enough, clusters should be switched and the old production cluster should become the new testing cluster and so on.

Leave a comment

Your email address will not be published. Required fields are marked *