1. 程式人生 > >How to create openstack single node with devstack

How to create openstack single node with devstack

1) Pre-requirements: Install Ubuntu 12.04
[email protected]:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"
2) Install some libs which is required by openstack
apt-get install libxml2-dev libxslt-dev
apt-get install libmysqlclient-dev
3) Install devstack following: http://devstack.org/

   3.1) We can use essex version, this is more stable. Check it out using:

git clone -b "stable/essex" git://github.com/openstack-dev/devstack.git
   3.2) Create a localrc file which can help facilitate your installation, the content would be as following, put this file to the first level directory for devstack.
[email protected]
:~/devstack# cat localrc ADMIN_PASSWORD=nova MYSQL_PASSWORD=nova RABBIT_PASSWORD=nova SERVICE_PASSWORD=nova SERVICE_TOKEN=tokentoken FLAT_INTERFACE=br100
   3.3) run ./stack.sh, wait some time, openstack will be ready.

4)Use openstack
Once install finished, you can either use euca2ools or nova command to operate with openstack. The location of openstack after install is under /opt/stack
[email protected]
:/opt/stack# pwd /opt/stack [email protected]:/opt/stack# pwd /opt/stack [email protected]:/opt/stack# cd devstack/ [email protected]:/opt/stack/devstack# ls AUTHORS eucarc exerciserc exercises exercise.sh files functions HACKING.rst LICENSE localrc nova_help openrc README.md rejoin-stack.sh samples stackrc stack-screenrc stack.sh tests tools unstack.sh [email protected]:/opt/stack/devstack# source openrc admin admin [email protected]:/opt/stack/devstack# source eucarc admin admin [email protected]:/opt/stack/devstack# euca-describe-images IMAGE aki-00000001 None (cirros-0.3.0-x86_64-uec-kernel) available public kernel instance-store IMAGE ami-00000002 None (cirros-0.3.0-x86_64-uec) available public machine aki-00000001 ari-00000003 instance-store IMAGE ari-00000003 None (cirros-0.3.0-x86_64-uec-ramdisk) available public ramdisk instance-store [email protected]:/opt/stack/devstack# nova flavor-list +----+-----------+-----------+------+-----------+------+-------+-------------+ | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | +----+-----------+-----------+------+-----------+------+-------+-------------+ | 1 | m1.tiny | 512 | 0 | 0 | | 1 | 1.0 | | 2 | m1.small | 2048 | 10 | 20 | | 1 | 1.0 | | 3 | m1.medium | 4096 | 10 | 40 | | 2 | 1.0 | | 4 | m1.large | 8192 | 10 | 80 | | 4 | 1.0 | | 5 | m1.xlarge | 16384 | 10 | 160 | | 8 | 1.0 | +----+-----------+-----------+------+-----------+------+-------+-------------+

5) Source code
Once openstack install finished, the source code is under /opt/stack.

 horizon: openstack GUI
 keystone: authentication and authrization
 nova: major componment for provisioning and scheduling

6) How to read source code
You can import source code to eclipse, make sure use Python2.7, seems Python 3.x does not work with eclipse.
This link is about how to config eclipse, though it is in Chinese but there are some screenshots and this may help you.

7) How to debug
Just kill the nova process, add pdb to source code and start up the process manually.
for example, it we want to debug nova-scheduler, just kill nova-scheduler, then add pdb to the code where you want to debug and remove all *.pyc files, start up nova-scheduler using command "python /opt/stack/nova/bin/nova-scheduler", all the logs will be printed to screen and will stop at  the break point once the break point was  triggered.

8) Attention

Please re-run ./stack.sh once the host is rebooted.

相關推薦

How to create openstack single node with devstack

1) Pre-requirements: Install Ubuntu 12.04[email protected]:~# cat /etc/*release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODE

How To Create Android Swipe Views With Tabs

Android swipe views provide lateral navigation between sibling screens such as tabs with a horizontal finger gesture (a pattern sometimes known as horiz

How to create a new business with AI?

Artificial intelligence is about to sweep massively in companies because it is a major element of digital transformation. Automation of low value-added tas

How to create interactive map plots with Plotly

Note: to do something like what I am about to describe, you will need an account with plotly as well as mapbox. Particularly because you will need an acces

How to create own operator with python in mxnet?

處理 需要 調用父類 rgs rop 數據類型 賦值 創建 recipe 繼承CustomOp 定義操作符,重寫前向後向方法,此時可以通過_init__ 方法傳遞需要用到的參數 1 class LossLayer(mxnet.operator.CustomOp):

How To Create Custom Dialog In Android With Validation

Let’s learn how to create custom dialog in android and while we are at it, let us also do simple validation of the data the user entered before clicking

how to run all Butler tools with a single command

The beauty of Docker — how to run all Butler tools with a single commandDocker is great.Docker is one of those tools that have the potential to fundamental

How to create beautiful pipelines on Elixir with Opus

Use caseAt Quiqup, we have a business model that requires our drivers to perform different kinds of work. For example, depending on who is ordering, our dr

How to Create a Linux Virtual Machine For Machine Learning Development With Python 3

Tweet Share Share Google Plus Linux is an excellent environment for machine learning development

How to create and manage users within AWS Single Sign-On

AWS Single Sign-On (AWS SSO) is a cloud service that allows you to grant your users access to AWS resources, such as Amazon EC2 instances, across

(轉載)How to create a mobile WordPress theme with jQuery Mobile

Last month, jQuery Mobile was released. This tool allows you to easily create mobile websites and web apps. In this tutorial, I’ll show

Livemedia-creator- How to create and use a Live CD

download further burning method create Livemedia-creator- How to create and use a Live CDNote for older method (namely for Fedora 23) using livec

question 002: dev c++ 當中如何調整字體大小?How to get the first program with C++? c++屬於什麽軟件?

space 什麽 pil get ctrl+鼠標 iostream 系統 using clu 方法:按住ctrl+鼠標滑輪滾動 c++屬於系統軟件還是應用軟件? 說哪個都不對,編譯之前屬於應用軟件,after compile ,it belongs to system so

jquery ----> How to Create a Basic Plugin (翻譯)

app sed 設置 函數表 col 有變 動作 jquery對象 別名 http://learn.jquery.com/plugins/basic-plugin-creation/ 如何創建一個基本的插件 有時候你想在整個代碼中提供一些功能。 例如,也許你想要一個單一的方

How to Create a Perl Based Custom Monitor on NetScaler

serve 5.1 citrix prompt rst sym pri index web How to Create a Perl Based Custom Monitor on NetScaler https://support.citrix.com/article/C

How to Create Triggers in MySQL

https://www.sitepoint.com/how-to-create-mysql-triggers/   I created two tables: CREATE TABLE `sw_user` ( `id` int(11) unsigned NOT NULL AUTO_IN

How To Obtain Reliable Concrete Mixer With Pump Machines

There are numerous easy methods for getting excellent deals on concrete mixers with pumps. You might basically be taking a look at local companies

How to train Neural Network faster with optimizers?

from:https://towardsdatascience.com/how-to-train-neural-network-faster-with-optimizers-d297730b3713 AsI worked on the last article, I had the o

How to solve peer dependancy problem with angular---quickstart 提示npm ERR! argv

學習AngularJS 5 MIN QUICKSTART的Step 1:Create and configure the project的第三小步(c)Install packages時提示如下圖所示錯誤 QUICRSTAR 解決方法為 在執行命令的當前目錄下執行  np

HOW TO CREATE A UEFI WINDOWS 7 USB BOOT DISK

Extract the files from DVD or ISO file Partition your USB Drive (optional) a. Open Command Window (CMD) as administrator b. diskpart c. list disk d. sele