openstack

openstack-all-in-one30分钟快速搭建

2017-02-15  本文已影响0人  爱吃土豆的程序猿

puppet-openstack-intergration

项目简介

puppet-openstack-integration此模块确保社区可以持续地测试和验证使用Puppet modules部署的Openstack集群。
支持环境:支持 Ubuntu 14.04或者CentOS 7.x

开始前准备工作

gem sources -l #查看现有的gem源
gem source --remove https://rubygems.org/ #注意是source而非sources
gem source -a https://ruby.taobao.org/ #添加淘宝的源
 
mkdir /root/.pip #创建.pip目录
vim /root/.pip/pip.conf #内容如下:
[global]
timeout = 60 #设置超时时间
index-url = https://pypi.douban.com/simple  
git clone -b stable/mitaka https://github.com/openstack/puppet-openstack-integration.git
git clone -b stable/mitaka https://github.com/openstack/puppet-openstack-integration.git #将第43行内容改为此行的内容
export SCENARIO=scenario001 #将第46行内容改为此行内容

Installation

OpenStack Dashboard available: http://127.0.0.1/dashboard
To access through Horizon, use the following user/password:
  admin / a_big_secret
To use OpenStack through the CLI, run:
  source ~/openrc

执行过程分析

执行all-in-one.sh脚本:

  1. 从git上clone puppet-openstack-integration项目
  2. 根据funtion函数中的方法判断操作系统的类型,安装libxml2-devel libxslt-devel,ruby,gem等软件,卸载facter,puppet等软件
  3. 通过gem安装bundler
  4. 执行run_tests.sh

执行run_tests.sh脚本:

  1. export一些变量,判断fixtures/scenarioo×.pp是否存在
  2. git://git.openstack.org/openstack/tempest上clone下来Tempest and plugins
  3. 根据系统安装puppet,dstat 等等
  4. 执行install_modules.sh

执行 install_modules.sh脚本

  1. export一些变量,通过gem安装r10k
  2. 调用function中install_modules方法,使用r10k puppetfile install -v 在/etc/puppet/module目录下安装puppet-openstack-integration/Puppetfile中定义的所有module
  3. 执行puppet module list命令
  4. install_modules.sh执行完毕,回到run_test.sh

回到run_test.sh脚本:

  1. Install repo
  2. 通过run_puppet 方法,执行命令/usr/bin/puppet apply --detailed-exitcodes --color=false --test --trace --hiera_config /tmp/puppet-openstack-integration/hiera/hiera.yaml fixtures/scenario001.pp
  3. 第二次执行run_puppet ,根据执行返回值确定执行状态。
  4. 安装配置tempest并相应运行smoke测试

可能出现的问题

执行过程中,可能在git clone -b 12.0.0 git://git.openstack.org/openstack/tempest /tmp/openstack/tempest这一步等待较长时间然后报错
解决方法:
在命令行执行:git clone -b 12.0.0 https://git.openstack.org/openstack/tempest /tmp/openstack/tempest ,并注释掉run_test.sh的这一行代码(第62行)

上一篇 下一篇

猜你喜欢

热点阅读