OpenStack/devstack with Neutron on Ubuntu 14.04

安装前,推荐安装一个全新的Ubuntu Server 14.04,如果使用之前的Ubuntu, 中间可能遇到各种的python包依赖,以及软件版本不对应的问题

  • 环境准备,新建stack用户,给予sudo权限,更新系统软件包
1 # add user 'stack'
 2 sudo su
 3 useradd -m -p welcome -s /bin/bash stack
 4 # add sudo previledge
 5 sudo su
 6 # Modify /etc/sudoers
 7 cat >>/etc/sudoers <<'EOF'
 8 
 9 stack   ALL=(ALL) NOPASSWD: ALL
10 Defaults:stack !requiretty
11 EOF
12 
13 exit
14 
15 
16 # Update software respository cache
17 sudo apt-get install -y python-software-properties
18 sudo add-apt-repository cloud-archive:juno
19 sudo apt-get update -y && sudo apt-get dist-upgrade -y
20 sudo shutdown -r now
  • 下载devstack, 配置local.conf
# install git download devstacksudo apt-get install -qqy git
git clone http://www.github.com/openstack-dev/devstack.git

cd devstack
touch local.conf
vim local.conf
#place following in local.conf, change the HOST_IP and SERVICE_HOST to the IP of eth0
[[local|localrc]]
HOST_IP=192.168.20.140
SERVICE_HOST=192.168.20.140
ADMIN_PASSWORD=welcome
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=$ADMIN_PASSWORD
DEST=/opt/stack
LOGFILE=$DEST/logs/stack.sh.log
SCREEN_LOGDIR=$DEST/logs/screen
OFFLINE=False
RECLONE=True
LOG_COLOR=False
disable_service horizon
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron
disable_service n-net
disable_service tempest
disable_service h-eng,h-api,h-api-cfn,h-api-cw
PHYSICAL_NETWORK=physnet1
FIXED_RANGE=192.168.106.0/24
FIXED_NETWORK_SIZE=32
NETWORK_GATEWAY=192.168.106.1
[[post-config|/$Q_PLUGIN_CONF_FILE]]
[ml2]
tenant_network_types = vlan

[ml2_type_vlan]
network_vlan_ranges = physnet1:100:110

[ovs]
bridge_mappings = physnet1:br-eth1
enable_tunneling = False
  • 启动安装devstack
#由于国内对git可能进行了block,所以如果不能访问git:这种地址,可以换成http:的试试sed -i 's|GIT_BASE:-git://git.openstack.org|GIT_BASE:-http://git.openstack.org|' stackrc
cd ~/devstack
./stack.sh
  • 配置虚拟网桥
#add br-eth1 add connect with eth1
sudo ovs-vsctl add-br br-eth1
sudo ovs-vsctl --may-exist add-port br-eth1 eth1
# set eth1 to promisc mode, so that it can pass any package in L2
sudo ip link set dev eth1 promisc on
sudo ip addr flush eth1
sudo ip link set dev eth1 up

这样一个带neutron的devstack环境就架设好了,这个过程我想不会顺利,devstack/openstack时常在更新,所以每天都会有不同的问题,大家如果安装遇到问题,可以留言讨论,当然如果文档有问题,也烦请指出。

下面是小编为你精选的Openstack相关知识,看看是否有你喜欢的

相关推荐