Here is install guide on openstack RDO Juno build ( install method was different with kilo )
1 update your system on compute node
yum update
2 install docker on compute node ,controller node don't need to install docker (the newest docker version is 1.8.1 )
curl -sSL https://get.docker.com/ | sh
3 start docker service on compute node
service docker start
5 add user nova to docker group on compute node
usermod -aG docker nova
6 install repository of docker-driver with stable/juno branch on compute node ( the master branch now just support Kilo , so must install stable/juno brance on openstack juno setup )
pip install -e git+https://github.com/stackforge/nova-docker@stable/juno#egg=novadocker
7 intall docker-driver on compute node
cd src/novadocker/
python setup.py install
8 add code for docker driver spawn() args function on compute node (note space alignment as Python syntax )
vi /usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py
def spawn(self, context, instance, image_meta, injected_files,
admin_password, network_info=None, block_device_info=None):
image_name = self._get_image_name(context, instance, image_meta)
args = {
'hostname': instance['name'],
'mem_limit': self._get_memory_limit_bytes(instance),
'cpu_shares': self._get_cpu_shares(instance),
'network_disabled': True,
'tty': True,
}
9 install concurrency software and copy it to appropriate location on compute node
pip install oslo.concurrency
mkdir /usr/lib/python2.7/site-packages/oslo/concurrency
cp -rp /usr/lib/python2.7/site-packages/oslo_concurrency/* /usr/lib/python2.7/site-packages/oslo/concurrency/
11 Edit the configuration file /etc/nova/nova.conf according to the following options on compute node
[DEFAULT]
compute_driver = novadocker.virt.docker.DockerDriver
12 edit hytype to support Docker
vi /usr/lib/python2.7/site-packages/nova/compute/hvtype.py
...
# This list is all known hypervisors
# even if not currently supported by OpenStack.
BAREMETAL = "baremetal"
BHYVE = "bhyve"
FAKE = "fake"
HYPERV = "hyperv"
IRONIC = "ironic"
KQEMU = "kqemu"
KVM = "kvm"
LXC = "lxc"
OPENVZ = "openvz"
PARALLELS = "parallels"
PHYP = "phyp"
QEMU = "qemu"
TEST = "test"
UML = "uml"
VBOX = "vbox"
VMWARE = "vmware"
XEN = "xen"
ZVM = "zvm"
DOCKER = "docker"
13 Create the directory /etc/nova/rootwrap.d, if it does not already exist, and inside that directory create a file "docker.filters" with the following content: (On compute node )
[iyunv@nsj1 novadocker(keystone_admin)]# mkdir /etc/nova/rootwrap.d
[iyunv@nsj1 novadocker(keystone_admin)]# vi /etc/nova/rootwrap.d/docker.filters
# nova-rootwrap command filters for setting up network in the docker driver
# This file should be owned by (and only-writeable by) the root user
Restart docker service and openstack-nova-compute service.
service docker restart
service openstack-nova-compute restart
after step 14 , openstack-nova-compute should be active
15 edit Glance configuration on Controller node
Glance needs to be configured to support the "docker" container format. It's important to leave the default ones in order to not break an existing glance install.
Edit /etc/glance/glance-api.conf
[DEFAULT]
container_formats = ami,ari,aki,bare,ovf,ova,docker
16 restart glance api on controller node
service openstack-glance-api restart
17 pull a ubunt image on compute node
docker pull ubuntu
18 create source file and source it and then and glance a image to your compute node ( glance image must be on compute node )
[iyunv@nsj1 novadocker]# more keystonerc_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=edd7724796214eb0
export OS_AUTH_URL=http://10.53.87.203:5000/v2.0/
export OS_REGION_NAME=RegionOne
export PS1='[\u@\h \W(keystone_admin)]\$ '
[iyunv@nsj1 novadocker]#
[iyunv@nsj1 novadocker]# source keystonerc_admin
[iyunv@nsj1 novadocker(keystone_admin)]# docker save ubuntu | glance image-create --is-public=True --container-format=docker --disk-format=raw --name ubuntu
19 create a container on controller node
nova boot --flavor m1.small --image 09d1160c-d36f-4f3d-860b-3fd251ab8565 --availability-zone nova --nic net-id=0793f266-23d7-4e26-bf06-2a992897b096 ubuntu
20 connect to your container ty bash shell on compute node
[iyunv@nsj1 novadocker(keystone_admin)]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
174646b23959 ubuntu "/bin/bash" About a minute ago Up About a minute nova-0b9d1c74-1d5a-4413-8cab-818a1f8df75f
[iyunv@nsj1 novadocker(keystone_admin)]# docker exec -i -t 174646b23959 /bin/bash
root@instance-00000004:/#
log file for debug
controller :/var/log/nova/nova-scheduler.log、/var/log/nova/nova-conductor.log
compute :/var/log/nova/nova-compute.log、/var/log/messages、systemctl status openstack-nova-network.service –l 、systemctl status openstack-nova-compute.service -l
a useful website for debug : ask.openstack.org
Best Regards
版权声明:本文为博主原创文章,未经博主允许不得转载。