apt-getinstall -y Ubuntu-cloud-keyring
echodeb precise-updates/grizzlymain >> /etc/apt/sources.list.d/grizzly.list
更新系统
apt-getupdate -y
apt-getupgrade -y
apt-getdist-upgrade -y
安装ntp服务
apt-getinstall -y ntp
配置ntp使其同步控制节点时间
#Commentthe ubuntu NTP servers
sed -i's/server 0.ubuntu.pool.ntp.org/#server 0.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i's/server 1.ubuntu.pool.ntp.org/#server 1.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i's/server 2.ubuntu.pool.ntp.org/#server 2.ubuntu.pool.ntp.org/g' /etc/ntp.conf
sed -i's/server 3.ubuntu.pool.ntp.org/#server 3.ubuntu.pool.ntp.org/g' /etc/ntp.conf
#Setthe network node to follow up your conroller node
sed -i's/server ntp.ubuntu.com/server 10.10.10.51/g' /etc/ntp.conf
重启ntp服务
servicentp restart
安装其他软件
apt-getinstall -y vlan bridge-utils
开启ip转发
sed -i's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
#sysctl-p 使其立即生效
3.2.网络
3个网卡初始配置
# OpenStack management
auto eth0
iface eth0 inet static
address 10.10.10.52
netmask 255.255.255.0
# VM Configuration
auto eth1
iface eth1 inet static
address 10.20.20.52
netmask 255.255.255.0
# VM internet Access
auto eth2
iface eth2 inet static
address 172.16.10.201
netmask 255.255.255.0
3.4.OpenVSwitch 这里没有按照github分开做两步,主要是他那个没有做上网设置,他需要把quantum软件包安装完毕后才做第二部,我这里设置了eth2和br-ex ip保证都能上网,所以可以一块做。
安装 openVSwitch:注意这里的三个软件都要安装,openstack除了用ovs还要用到系统的brcompat
apt-get install openvswitch-switchopenvswitch-brcompat openvswitch-datapath-dkms
设置 ovs-brcompatd 启动:
sed -i 's/# BRCOMPAT=no/BRCOMPAT=yes/g'/etc/default/openvswitch-switch
启动 openvswitch-switch:
root@network:~# service openvswitch-switch restart
* Killingovs-brcompatd (1327)
* Killingovs-vswitchd (1195)
* Killingovsdb-server (1185)
* Startingovsdb-server
*Configuring Open vSwitch system IDs
* Startingovs-vswitchd
2013-10-29T02:45:50Z|00001|brcompatd|WARN|Bridgecompatibility is deprecated and may be removed no earlier than February 2013
* Startingovs-brcompatd
直到 ovs-brcompatd、ovs-vswitchd、ovsdb-server等服务都启动
并检查brcompat模块
# lsmod | grep brcompat
brcompat 13512 0
openvswitch 84038 7 brcompat
如果还是启动不了 brcompat,执行下面命令:
/etc/init.d/openvswitch-switch force-reload-kmod
再不行重启服务器,ubuntu13.04(64位)一般安装上面3个软件都可以成功启动,不需其他额外操作。
创建网桥
ovs-vsctl add-br br-int # br-int 用于 vm 整合
ovs-vsctl add-br br-ex # br-ex 用于从互联网上访问 vm
ovs-vsctl add-port br-ex eth2 # br-ex 桥接到 eth2
做完上面操作后,eth2 这个网卡是没有工作的,需修改网卡配置文件
最后网卡的配置情况:
root@network:~# cat /etc/network/interfaces
# This file describes the networkinterfaces available on your system
# and how to activate them. For moreinformation, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# OpenStack management
auto eth0
iface eth0 inet static
address 10.10.10.52
netmask 255.255.255.0
# VM Configuration
auto eth1
iface eth1 inet static
address 10.20.20.52
netmask 255.255.255.0
# VM internet Access
auto eth2
iface eth2 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down
auto br-ex
iface br-ex inet static
address 172.16.10.201
netmask 255.255.255.0
gateway 172.16.10.254
dns-nameservers 8.8.8.8
然后重启服务器或者网络,上网和内网连接都没有问题才进行下一步操作
查看桥接的网络
ovs-vsctl list-br
ovs-vsctl show