This section deploys the Devstack lab environment, including control nodes and compute nodes, as follows:
Create a virtual machine
Create Devstack-controller and Devstak-compute virtual machines according to physical resource requirements
Installing the operating system
Install Ubuntu 14.04, and configure eth0 IP devstack-controller 192.168.104.10 devstak-compute 192.168.104.11
download Code
Download the Devstack code and switch to the Stable/liberty branch
Apt-get Install Git-y
git clone https://git.openstack.org/openstack-dev/devstack-b Stable/liberty
Configure a stack user
Create a stack user
devstack/tools/create-stack-user.sh
For convenience, place the Devstack directory under/opt/stack and set permissions
MV Devstack/opt/stack
Chown-r Stack:stack/opt/stack/devstack
Switch to a stack user
Su–stack
CD Devstack
writing a Run configuration file
Under the/opt/stack/devstack directory, create the local.conf.
Devstack-controller
[[LOCAL|LOCALRC]]
Multi_host=true
HOST_IP=192.168.104.10 # Management & API Network
Logfile=/opt/stack/logs/stack.sh.log
# Credentials
Admin_password=admin
Mysql_password=secret
Rabbit_password=secret
Service_password=secret
Service_token=abcdefghijklmnopqrstuvwxyz
# Enable Neutron-ml2-vlan
Disable_service n-net
Enable_service Q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron,q-lbaas,q-fwaas,q-vpn
Q_agent=linuxbridge
Enable_tenant_vlans=true
tenant_vlan_range=3001:4000
Physical_network=default
Log_color=false
logdir= $DEST/logs
screen_logdir= $LOGDIR/screen
Devstack-compute
[[LOCAL|LOCALRC]]
Multi_host=true
HOST_IP=192.168.104.11 # Management & API Network
# Credentials
Admin_password=admin
Mysql_password=secret
Rabbit_password=secret
Service_password=secret
Service_token=abcdefghijklmnopqrstuvwxyz
# Service Information
service_host=192.168.104.10
mysql_host= $SERVICE _host
rabbit_host= $SERVICE _host
glance_hostport= $SERVICE _host:9292
q_host= $SERVICE _host
keystone_auth_host= $SERVICE _host
keystone_service_host= $SERVICE _host
Ceilometer_backend=mongodb
Database_type=mysql
Enabled_services=n-cpu,q-agt,neutron
Q_agent=linuxbridge
Enable_tenant_vlans=true
tenant_vlan_range=3001:4000
Physical_network=default
# VNC Config
Nova_vnc_enabled=true
Novncproxy_url= "/http $SERVICE _host:6080/vnc_auto.html"
vncserver_listen= $HOST _ip
vncserver_proxyclient_address= $VNCSERVER _listen
Log_color=false
logdir= $DEST/logs
screen_logdir= $LOGDIR/screen
In addition, in order to speed up the installation, you can also add the following configuration to use the domestic devstack mirror site
# Use trystack git mirror
git_base=http://git.trystack.cn
Novnc_repo=http://git.trystack.cn/kanaka/novnc.git
Spice_repo=http://git.trystack.cn/git/spice/spice-html5.git
Start Deployment
Execute commands on Devstack-controller and Devstak-compute, respectively
./stack.sh
Outputs the results of each operation. The log will be written to the Stack.sh.log file.
The entire process needs to connect to the Internet, which may take a long time, and will eventually print out the relevant information after success.
Output on the Devstack-controlle
Output on the Devstack-compute
Verifying OpenStack
Below verify that OpenStack is already running browser access http://192.168.104.10/(devstack-controller IP) admin/admin Login
Click System->system information to ensure the status of each service is normal
The state of Cinder-volume here is "down" because we have not configured cinder and will let it up later.
Start OpenStack
If you restart the system, OpenStack does not start automatically and you can run the following command
CD Devstack./rejoin-stack.sh
After successful operation, each of the services of OpenStack runs in a screen in a process manner. There are several advantages to using screen:
You can easily switch between different services and view the logs. Because OpenStack has a lot of services, each service has its own log files. Finding logs is a very troublesome thing, screen can help us to improve efficiency.
When we modify a service's profile to restart the service, simply CTRL + C in the Service's screen window and then find the last command (up key) on the command line, which is the command to start the service.
Here is the screen Common command
Execute in Screen
Ctrl+a+n switch to the next window
Ctrl+a+p switch to the previous window (as opposed to ctrl+a+n)
ctrl+a+0..9 Switch to Window 0..9
Ctrl+a+d temporarily disconnects (detach) the current screen session without interrupting the program's operation
Executing in the shell
Screen-ls List all current session
Screen-r stack back to devstack this session
Delete an automatically created network
Devstack may create several test networks at deployment time, in order to get a clean environment that needs to be removed
Delete Router admin->system->routers
Delete Network Admin->system->networks
So far, we've got a clean OpenStack environment. Each module is then practiced in this environment.
Deploy Devstack-5 minutes a day to play OpenStack (17)