How to create openstack single node with devstack
2012-08-23 13:27
309 查看
1) Pre-requirements: Install Ubuntu 12.04
3.1) We can use essex version, this is more stable. Check it out using:
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.
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
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.
root@nova:~# 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-dev3) 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.
root@nova:~/devstack# cat localrc ADMIN_PASSWORD=nova MYSQL_PASSWORD=nova RABBIT_PASSWORD=nova SERVICE_PASSWORD=nova SERVICE_TOKEN=tokentoken FLAT_INTERFACE=br1003.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
root@nova:/opt/stack# pwd /opt/stack root@nova:/opt/stack# pwd /opt/stack root@nova:/opt/stack# cd devstack/ root@nova:/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 root@nova:/opt/stack/devstack# source openrc admin admin root@nova:/opt/stack/devstack# source eucarc admin admin root@nova:/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 root@nova:/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 set up live-migration environment for Openstack with devstack
- How to create a VM on a specified host with openstack
- in a devstack Openstack env, how to start a service, such as aodh-listener
- How to solve DevStack error “Exception Value: /usr/bin/env: node: No such file or directory”
- How to create a repository in Github with Eclipse?
- How to create and apply a patch with Git
- avassetwrite向同一文件重复写入 暂停,继续录制 how-to-write-to-a-single-file-multiple-times with pause/resume
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to Create a Node.js Cluster for Speeding Up Your Apps
- How to create a site with AJAX enabled in MVC framework.
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to setup a Mac with Python dev tools
- Learn How to Use Neo4J with Node.js
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to bind a GridView to a list of multiple types? NHibernate proxy causing problems with databinding [From stack overflow]
- How to create and apply a patch with Git
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to create id with AUTO_INCREMENT on Oracle?
- How to create a jar file with Maven