How to master OpenStack
in 2 hours
TryStack.cn Meetup #ShangHai
8th November 2013(update)
Who am I?
How to set up your TryStack Lab
Why we are here?
Devstack in 5 min
First contact with OpenStack
Write a template for Heat
How many people have used OpenStack?
Put up your hands!
Prepare for Labs
− Vmware, VirtualBox, vagrant, KVM, …, any choice
− 2GB RAM or more
− Ubuntu 12.04 (Precise), Fedora 17 and CentOS/RHEL 6.4
− OpenSUSE and Debian
− Minimal install recommended
3. Set up Vagrant
$ mkdir trystack
$ cd trystack
$ vagrant init
$ vim Vagrantfile
# -*- mode: ruby -*# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "Trystack"
config.vm.box_url = "Centos64-x86_64-20131030"
config.vm.network :private_network, ip: " 172.16.0.2"
config.vm.synced_folder "../devstack", "/vagrant_data"
config.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--memory", "2048"]
Devstack will install EPEL and RDO repo for CentOS6.4, Set up pypi :
index-url = http://pypi.douban.com/simple/
-------------------exit, reboot to update env.
vagrant box add trystack Centos64-x86_64-20131030.box
$ vagrant box add NAME URL
$ vagrant box list
$ vagrant box remove NAME virtualbox #删除本地已添加的box，如若是版本1.0.x，执行$ vagrant box remove NAME
$ vagrant init NAME
$ vagrant up
$ vagrant halt
$ vagrant destroy
$ vagrant reload
$ vagrant package
$ vagrant ssh
5. Install DevStack
Home pages: http://devstack.org
$ git clone https://github.com/openstack-dev/devstack.git
$ cd devstack
exercise.sh: setting up the env for running the sample exercise cmds
exercises/ folder: contains a small set of exercise file for achieving different
● localrc is a user-maintained settings file that is sourced from stackrc. This gives
it the ability to override any variables set in stackrc. Samples: http://devstack.
● git repo and branch information, image download location. This file shouldn't be
modified, only localrc should be modified.
● stack.sh is an opinionated OpenStack developer installation. It installs and
configures various combinations of Glance, Horizon, Keystone, Nova, Neutron,
Swift and some other projects.
# Enables all the Heat services
echo ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng >> localrc
## It would also be useful to automatically download and register VM images that Heat can launch.
# 64bit image (~660MB)
echo IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-x86_64-cfntools.qcow2" >> localrc
echo IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F18-x86_64-cfntools.qcow2" >> localrc
# 32bit image (~640MB)
echo IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F17-i386-cfntools.qcow2" >> localrc
echo IMAGE_URLS+=",http://fedorapeople.org/groups/heat/prebuilt-jeos-images/F18-i386-cfntools.qcow2" >> localrc
echo VORBOSE=True >> stackrc
echo LOGFILE=stacklog.txt >> stackrc
# Devstack is now installed.
# If all is well, you will see the following output :
# Horizon is now available at http://IP_ADDRESS/
# Heat has replaced the default flavors. View by running: nova flavor-list
# Keystone is serving at http://IP_ADDRESS:5000/v2.0/
# Examples on using novaclient command line is in exercise.sh
# The default users are: admin and demo
# The password: trystack
# This is your host ip: IP_ADDRESS
# stack.sh completed in 1065 seconds.
Linux Kernel Similarities
OpenStack Foundation is very similar to the Linux Foundation
Replaced the proprietary incumbents
One could consider the abstractions quite similar too:
Development done on always open trunk
Releases done to a stable branch
Standardized tools across all projects
● Standalone patch review server
● Created by Google for Android development
● Continuous integration
● Gates commits on unit tests
● git branch; git commit
− Commit hook inserts Change-Id: for gerrit tracking
● ./run_tests.sh [subset]
− Unit tests within a virtualenv
− Nose used to extend unittest
− Pep8 enforced https://github.com/jcrocholl/pep8
● git-review python tool used to submit to gerrit
− Developed for OpenStack but not specific to it
Anyone can ±1
Only project core members can approve
− Automated tests
Using OpenStack infrastructure itself
Sets up test systems and runs gerrit branch
− Libvirt, Xen, python 2.6, python 2.7, ...
If OK, merges gerrit branch to trunk
Ancillary jobs like doc builds, pylint reports, more tests, ...
OpenStack 发布周期: 四个阶段
● 6 monthly, design summit after each, monthly milestones
● Austin Oct 2010
Nova + Swift
● Cactus Apr 2011
● Diablo Sep 2011
First “production ready” release
● Essex Apr 2012
Horizon + Keystone
● Folsom Sep 2012 Quantum + Cinder
● Grizzly Apr 2013
● Havana Oct 2013 Heat +Ceilometer
Openstack is the community
• Interact via:
– Mailing lists: general, development, documentation, operators …
– Ask Openstack (ask.openstack.org)
Home to all openstack integrated projects
– IRC (#openstack-101, #openstack, #openstack-dev, …)
– Local User Groups (like today!)
– Summit & Conference (twice a year)
See Openstack evolving, everyday
– Release status
– Active Reviews
– Grab the code
Related python projects
Generate guest images from install ISOs
Install packages, run script, ...
List of OZ built images from RackSpace
ISO -> image -> glance -> nova -> libvirt -> KVM
Related python projects
AWS Cloudformation type service
V6 just released
Provisions apps in the cloud
And keeps them provisioned
Leverages cloud attributes to provide HA
Related python projects
Installed in guests to configure at boot time
Directives for package install etc.
Support for many distros
Ryu Plugin for Neutron
Ryu is a component-based software defined networking framework. Ryu
provides software components with well defined API that make it easy for
developers to create new network management and control applications. Ryu
supports various protocols for managing network devices, such as OpenFlow,
Netconf, OF-config, etc. About OpenFlow, Ryu supports fully 1.0, 1.2, 1.3 and
Similar non python projects
● oVirt - java
− More aligned with private datacenters
● Eucalyptus - C
− Less general, Closed editions.
● CloudStack - java
− Started closed (cloud.com). Closed addons.
● OpenNebula - C++
− Again focusing on datacenters
Trying it out
http://trystack.org/ Or http://cloud.trystack.cn
Register to try out a test public OpenStack cloud
Script to setup simple/developer installs
Basic setup instructions for machine or VM
Biggest OpenStack testbed in China
Opened OpenStack API
Provide best practices for administrator, operators and developers.
OpenStack deployment architecutre
Hardware devices from different vendors
Using the newest OpenStack code
Contribute code to the community
Promote OpenStack implementation and productization in China With partners, vendors
− The compute admin guide is a good overview
− OpenStack Continuous Integration info
− OpenStack gerrit interface
− OpenStack Continuous Integration interface
Provides AWS Cloudformation and native ReST API
Abstract configuration of services to single-template
Openstack incubated project
Orchestration of Openstack deployments
Integrates with all Openstack core projects
Converts a JSON template into a cloud application
Implements well known template and API (AWS
Cloudformation, also YAML, ReST)
Version your cloud applications like your software
Repeatable deployments, fully automated
Heat Stack lifecycle
● Base OS image stored in glance
● Deploy instances & configure services based on template contents
● Deployment-time configuration/customization
● Very flexible, but much reduced complexity
● Cloud-init (nova user/metadata), plus cfn-init
● Puppet/Chef can still be used if you want!
● Fully integrated single-service solution
Heat Stack lifecycle
Orchestration makes things repeatable
Much easier to provide “on demand” infrastructure
Much less scripting, single template system
Leverage the power of openstack without learning fine detail of every service (learn one set of
Version/tag/branch your infrastructure like code!
Pluggable, user-modifiable resource implementations
Open(stack) community project :)
Users and developers wanted!
Check out the repository:
Connect with the community via IRC on #heat@freenode
Read the Documentation:
Heat simple but powerful method for orchestrating OpenStack