renyanping 发表于 2017-6-24 22:22:17

VirtualBox中使用ubuntu-16.04.1安装devstack的Compute节点

  1、Controller节点主机配置
  4G内存,80G硬盘,2个网卡:bridged、internal network
  bridged                ----连接API及管理网络,上网
  internal network    ----连接租户网络,保证controller和compute的通信
  2、OS安装
  ubuntu-16.04.1-server-amd64,安装ssh和kvm(openssh-server和virtual machine host)组件
  3、OS配置


[*]允许root远程登录
  同controller


[*]网卡配置



vi /etc/network/interfaces
auto enp0s3
iface enp0s3 inet static
address 192.168.104.11
netmask 255.255.255.0
gateway 192.168.104.1
dns-nameservers 192.168.104.1

auto enp0s8
iface enp0s8 inet manual

systemctl restart networking.service    ---重启网络服务


[*]更改apt源并进行update
  同controller
  4、部署openstack


[*] 安装pip
  apt install python-pip


[*]下载openstack至/root/目录
  git clone https://git.openstack.org/openstack-dev/devstack -b stable/newton


[*]创建stack用户
  /root/devstack/tools/create-stack-user.sh      ---创建用户


[*]配置pip,为root用户及stack用户设置国内镜像源
  root用户下执行mkdir ~/.pip&&vi ~/.pip/pip.conf,将如下内容粘贴进入
  stack用户下执行mkdir ~/.pip&&vi ~/.pip/pip.conf,将如下内容粘贴进入




index-url = https://pypi.douban.com/simple
download_cache = ~/.cache/pip

use-mirrors = true
mirrors = http://pypi.douban.com/


[*]配置local.conf
  mv /root/devstack/ /opt/stack/                ----将root/devstack移动至stack用户目录
  chown stack:stack /opt/stack/devstack   -----文件夹权限修改
  vi /opt/stack/devstack/local.conf,将如下内容粘贴进去



[]
MULTI_HOST=true
# management & api network
HOST_IP=192.168.104.11
# Credentials
ADMIN_PASSWORD=admin
MYSQL_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz
# Service information
SERVICE_HOST=192.168.104.10
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292
Q_HOST=$SERVICE_HOST
KEYSTONE_AUTH_HOST=$SERVICE_HOST
KEYSTONE_SERVICE_HOST=$SERVICE_HOST
ENABLED_SERVICES=n-cpu,q-agt,neutron
Q_AGENT=linuxbridge
ENABLE_TENANT_VLANS=True
TENANT_VLAN_RANGE=3001:4000
PHYSICAL_NETWORK=default
# vnc config
NOVA_VNC_ENABLED=True
NOVNCPROXY_URL="http://$SERVICE_HOST:6080/vnc_auto.html"
VNCSERVER_LISTEN=$HOST_IP
VNCSERVER_PROXYCLIENT_ADDRESS=$VNCSERVER_LISTEN
LOG_COLOR=True
LOGDIR=$DEST/logs
SCREEN_LOGDIR=$LOGDIR/screen
# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git


[*]执行安装脚本
  /opt/stack/devstack/stack.sh             ---需N多次执行才可以完成安装
页: [1]
查看完整版本: VirtualBox中使用ubuntu-16.04.1安装devstack的Compute节点