OpenStack is an open source cloud computing management platform project that supports almost all types of cloud environments, with the goal of providing a simple, scalable, rich, standard, unified cloud management platform. This article we talk about Devstack installation and configuration OpenStack development environment.
OpenStack installation and configuration is a bit complicated, especially for beginners, the first time you install OpenStack often encounter a lot of problems. However, in the OpenStack community, some developers have developed a number of automated scripts to facilitate the construction of OpenStack development environment, where Devstack is relatively perfect, It is also recommended by the official website of OpenStack to learn how to build an environment when OpenStack.
Devstack is a set of automated scripts written in bash by Rackspace Company for building and configuring a complete set of development environments for OpenStack. Devstack's official website is http://devstack.org/, where you can see how devstack scripts are used and how they work.
Currently, Devstack has better support for Ubuntu and Fedora Systems for Ubuntu 12.04 and Fedora 16 and above, and choosing to use Devstack on other operating systems may require some modification to work properly. So, the example here is to build the OpenStack development environment using the Devstack script on the Ubuntu 12.04 system, and the process is simple enough to be divided into the following two steps:
(1) Download the Devstack code warehouse, the command line is as follows:
git clone git://github.com/openstack-dev/devstack.git
(2) Run the stack.sh script, the command line operation is as follows:
jay@my-ubuntu:~$ CD devstack/
jay@my-ubuntu:~/devstack$./stack.sh
Horizon is now available at http://192.168.158.31/
Keystone is serving at http://192.168.158.31:5000/v2.0/
Examples on using novaclient command line are in exercise.sh
The default users Are:admin and demo
The Password:admin
This is your host ip:192.168.158.31
Stack.sh completed in 1663 seconds.
#看到最后这样的信息, stating that OpenStack has been successfully installed and configured
Because the stack.sh script automatically downloads a large number of dependent packages and OpenStack source code, as well as various configuration files and database initialization, the first execution of the stack.sh script takes time, approximately 10 minutes to one hours ( varies depending on processor speed and network bandwidth.
When running the stack.sh script in an Ubuntu system, you may be prompted to enter the password for the current user because you need to frequently use the sudo command to install the package and write the configuration file, because you need to configure some database, OpenStack authentication, So there may be some database user name, password confirmation needs to interact with the user. Before performing Devstack stack.sh, the user can also fill in the configuration file named LOCALRC that is locally configured, as shown in the following example:
database_password=123456 #请根据需要修改此配置文件
rabbit_password=123456
service_token=123456
service_password=123456
Admin_password=admin
host_ip=192.168.111.111
If such a local profile is prepared, the validation process for these passwords and authentication information is reduced when the stack.sh script is run. For the configuration of the hypervisor, there are two lines of configuration in the default profile STACKRC of the Devstack source code library:
Virt_driver=${virt_driver:-libvirt}
LIBVIRT_TYPE=${LIBVIRT_TYPE:-KVM}
Therefore, when Devstack installs OpenStack, the default is to set Libvirt as Hypervisor driver, using QEMU/KVM as hypervisor, only if the "KVM" is not successfully loaded module, it returns to the virtualization approach of using QEMU pure software emulation. After the stack.sh script has been installed OpenStack, you can also see if the "KVM" and "Kvm_intel" (or "KVM_AMD") modules are loaded successfully, and you can view the following two items in the/etc/nova/nova.conf file:
Libvirt_type=kvm
Compute_driver=libvirt. Libvirtdriver
In general, after normal execution of the stack.sh script in Devstack, the OpenStack services (such as calculations, mirrors, control panels, networks, and so on) have been turned on for active use. Of course, if there are some errors during installation, you can fix or bypass some of the problems by modifying them according to their source code. When you need to manage these openstack services, or when you need to clean up the environment before running stack.sh, you can perform unstack.sh scripts in Devstack to stop OpenStack related services and to clean up some errors in the middle of the installation.
Of course, devstack This set of scripts is typically used to deploy the OpenStack development environment and is not perfect for large-scale deployment of OpenStack cloud infrastructure in a real-world production environment. However, a personalized OpenStack production environment can be built on a devstack basis based on some of the official OpenStack deployment reference documents (see "Reference reading" at the end of this chapter) and practical scenarios.