Giter Site home page Giter Site logo

docker-nova-compute's Introduction

How to build ?

sudo docker  build --rm -t="krystism/openstack-nova-compute" .

How to use ?

Before you start a nova-compute instance, you need these services running:

  • mysql-server
  • rabbitmq
  • keystone
  • glance-api & glance-registry
  • nova-api & nova-cert & nova-consoleauth & nova-scheduler & nova-conductor & nova-novncproxy

Both mysql-server and rabbitmq images are available, you can pull from docker hub.

Of cource, you can replace mysql-server with mariadb.

To start mysql-server & rabbitmq, you just need run these scripts as follows:

docker run -d -e RABBITMQ_NODENAME=rabbitmq -h rabbitmq --name rabbitmq rabbitmq:latest
docker run -d -e MYSQL_ROOT_PASSWORD=MYSQL_DBPASS -h mysql --name mysql -d mariadb:latest

Then you should start a keystone service, you can use my keystone image to create a container with keystone to meet it:

docker run -d  --link mysql:mysql --name keystone -h keystone krystism/openstack-keystone:latest

The keystone service may take some time to start, you need wait for the service working before you do next.

Once the keystone service is running, you also need a glance service. if you just want to try openstack, fortunately, you can use my glance image to quickly deploy it:

docker run -d\
      	--link mysql:mysql \
       	--link keystone:keystone \
	-e OS_USERNAME=admin \
	-e OS_PASSWORD=ADMIN_PASS \
	-e OS_AUTH_URL=http://keystone:5000/v2.0 \
	-e OS_TENANT_NAME=admin \
	--name glance \
	-h glance \
	krystism/openstack-glance:latest

Next, we need a server running nova common service, such as nova-api,nova-conductor,etc. we name this server as controller, you can deploy it quickly with my nova-controller image:

	docker run -d\
      	--link mysql:mysql \
       	--link keystone:keystone \
	--link rabbitmq:rabbitmq \
	--link glance:glance \
	-e OS_USERNAME=admin \
	-e OS_PASSWORD=ADMIN_PASS \
	-e OS_AUTH_URL=http://keystone:5000/v2.0 \
	-e OS_TENANT_NAME=admin \
	--privileged \
	--name controller \
	-h controller \
	krystism/openstack-nova-controller:latest

Atention: The option --privileged is requited, or you can not update iptable in your container!

It also may take some time, you can fetch logs to watch its process:

docker logs controller

Once complete, you can enter container using exec to check if the services work or not.

docker exec -t -i controller bash
cd /root
source admin-openrc.sh
nova service-list

Last, We deploy two compute nodes(you can repeat it if you want to more nodes):

docker run -d \
--link mysql:mysql \
  --link keystone:keystone \
	--link rabbitmq:rabbitmq \
	--link glance:glance \
	--link controller:controller \
	-e OS_USERNAME=admin \
	-e OS_PASSWORD=ADMIN_PASS \
	-e OS_AUTH_URL=http://keystone:5000/v2.0 \
	-e OS_TENANT_NAME=admin \
	--privileged \
	--name node1 \
	-h node1 \
	krystism/openstack-nova-compute:latest
docker run -d\
  --link mysql:mysql \
  --link keystone:keystone \
	--link rabbitmq:rabbitmq \
	--link glance:glance \
	--link controller:controller \
	-e OS_USERNAME=admin \
	-e OS_PASSWORD=ADMIN_PASS \
	-e OS_AUTH_URL=http://keystone:5000/v2.0 \
	-e OS_TENANT_NAME=admin \
	--privileged \
	--name node2 \
	-h node2 \
	krystism/openstack-nova-compute:latest

After all off the works above complate, you can run nova service-list, as expected, you can find that nova-compute service is up:

docker exec -t -i controller bash
nova service-list

Possible Problem

I do not recommand you write a script to run all the command above or use fig, because different services to start may take different time, you can not ensure the last service is running when you start current service. For example, if mysql service does not work, the keystone service may fail to start, you must ensure mysql is running before create a keystone instance.

docker-nova-compute's People

Contributors

int32bit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.