list1234 发表于 2017-6-26 20:53:56

[Resolved] OpenStack Mitaka with Docker Integration Issue

  2016年5月20日发布
1. How does Docker hood work with Nova hypervisor?
(오픈 스택과 도커 사이 연동은 어떻게 되어 있는가?)

  As shown in Figure above, the driver will fetch images from the OpenStack Image Service (Glance) and load them into the Docker filesystem. Images may be placed in Glance by exporting them from Docker using the 'docker save' command.
  그림에서 볼수 있다 싶이 docker driver는 glance로 부터 이미지를 가져오고 도커 파일 시스템에 로드한다. 이미지는 도커 명령어 docker save로 glance에 이미지를 저장해준다.
  2. Configure an existing OpenStack installation to enable Docker
  (기존 오픈 스택에 도커 설치 및 설정)
  2.1 on controller node
  Edit the /etc/nova/nova.conf, add following information
  # vi /etc/nova/nova.conf
  
  compute_driver = novadocker.virt.docker.DockerDriver
  Edit the /etc/glance/glance-api.conf and /etc/glance/glance-registry.conf, add following information
  
  container_formats = ami,ari,aki,bare,ovf,docker
  #systemctl restart openstack-nova-api openstack-glance-api openstack-glance-registry
  2.2 on compute node
  First, install docker on compute node.
  # usermod -aG docker nova

  # systemctl restart openstack-nova-compute


  Install novadocker driver

  pip install -e git+https://github.com/stackforge/nova-docker#egg=novadocker



  cd src/novadocker/

  python setup.py install


  Edit the /etc/nova/nova.conf, add following information
  # vi /etc/nova/nova.conf
  
  compute_driver = novadocker.virt.docker.DockerDriver
  Create the directory /etc/nova/rootwrap.d/docker.filters file, add following contents
  # 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
  
  # nova/virt/docker/driver.py: 'ln', '-sf', '/var/run/netns/.*'
  ln: CommandFilter, /bin/ln, root
  # systemctl restart openstack-nova-compute
  Restart failed, error message is like this.
  Error:

  # tail –f /var/log/nova/nova-compute.log

  

  2016-05-19 16:16:03.682 20533 WARNING oslo_reports.guru_meditation_report [-] Guru mediation now registers SIGUSR1 and SIGUSR2 by default for backward compatibility. SIGUSR1 will no longer be registered in a future release, so please use SIGUSR2 to generate reports.

  2016-05-19 16:16:03.919 20533 INFO oslo_service.periodic_task [-] Skipping periodic task _periodic_update_dns because its interval is negative

  2016-05-19 16:16:03.934 20533 INFO nova.virt.driver [-] Loading compute driver 'novadocker.virt.docker.DockerDriver'

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver [-] Unable to load the virtualization driver

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver Traceback (most recent call last):

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/nova/virt/driver.py", line 1622, in load_compute_driver

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   virtapi)

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 64, in import_object_ns

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   cls = import_class(import_str)

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 30, in import_class

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   __import__(mod_str)

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/__init__.py", line 20, in <module>

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   from novadocker.virt.docker import driver

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   File "/usr/lib/python2.7/site-packages/novadocker/virt/docker/driver.py", line 27, in <module>

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver   from docker import errors

  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver ImportError: No module named docker


  2016-05-19 16:16:03.937 20533 ERROR nova.virt.driver
  Solution:
  Version conflict and make sure whether installed docker-py or not.
  #pip install docker-py
  #cd ~
  #git clone https://github.com/pypa/pip
  #cd pip/
  #python setup.py install
  #pip install docker-py
  #python2.7 -c 'import sys; print(sys.path)'
  #systemctl restart openstack-nova-compute
  #systemctl restart docker
  Check its working well:
  # docker search hipache
  NAME                         DESCRIPTION                                     STARS   OFFICIAL   AUTOMATED
  hipache                      Hipache is a distributed proxy for high vo...   68      
  tutum/hipache                Extends official hipache image to provide ...   14                  
  willdurand/hipache                                                         1                  
  prologic/hipache             A production version of hipache with worki...   1                  
  elsdoerfer/hipache                                                         1                  
  rocketchat/hipache         Hipache with support of full config via en...   1                  
  jllopis/hipache                                                            0                  
  tjmehta/hipache                                                            0                  
  komljen/hipache            More info: https://github.com/komljen/dock...   0                  
  apnarm/autodock-hipache      autodock hipache plugin                         0                  
  trsouz/hipache                                                               0                  
  arnos/hipache                                                                0                  
  crosbymichael/hipache                                                      0                  
  turistforeningen/hipache                                                   0                  
  cpuguy83/hipache                                                             0                  
  jkingyens/hipache            Hipache + etcd. See http://required.io/hip...   0
  sherzberg/marathon-hipache                                                   0                  
  quarry/hipache                                                               0                  
  thomaswelton/hipache                                                         0                  
  aldrinleal/hipache                                                         0                  
  prologic/autodock-hipache    autodock hipache plugin                         0                  
  smartprocure/hipache                                                         0                  
  apnarm/hipache               A production version of hipache with worki...   0                  
  aldryn/hipache                                                               0                  
  tsuru/router-hipache         tsuru router-hipache                            0                  
  # docker pull tutum/hipache
  # docker save tutum/hipache | glance image-create --container-format=docker --disk-format=raw --name tutum/hipache
  # glance image-list
  +--------------------------------------+--------------------+
  | ID                                 | Name               |
  +--------------------------------------+--------------------+
  | 0d3c0d81-7071-4e15-b677-1dd8222f7815 | cirros             |
  | 1977d857-7fa1-4296-8d58-c3989b862eea | tutum/hipache      |
  | 631c61ba-2a5d-4271-a4ac-d718c1e9849d | willdurand/hipache |
  +--------------------------------------+--------------------+
  Create Container on OpenStack Dashboard using docker image.
  I used selfservice network to create container.


页: [1]
查看完整版本: [Resolved] OpenStack Mitaka with Docker Integration Issue