OpenStack RDO部署vlan模式
controll:eth0 192.168.2.211 comput: etho 192.168.2.212
eth1 eth1
1、网络设置
controll
eth0:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes HWADDR=00:E0:81:D8:43:BE TYPE=Ethernet BOOTPROTO=none IPADDR=192.168.2.211 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 DNS1=8.8.8.8
eth1:
# cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 TYPE=Ethernet ONBOOT=yes
comput
eth0:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes HWADDR=00:E0:81:D8:43:BE TYPE=Ethernet BOOTPROTO=none IPADDR=192.168.2.212 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 DNS1=8.8.8.8
eth1:
# cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 TYPE=Ethernet ONBOOT=yes
2、更换源,更新系统
进入到 /etc/yum.repos.d, 其中有个rhel-source.repo, 先改名为rhel-source.repo.bak,做个备份
然后新建个 rhel-source.repo
cd /etc/yum.repos.d mv rhel-source.reop rhel-source.reop.bak vi rhel-source.reop
内容如下:
[base] name=CentOS-$releasever - Base baseurl=http://mirrors.163.com/centos/6.5/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.163.com/centos/6.5/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #packages used/produced in the build but not released #[addons] #name=CentOS-$releasever - Addons #baseurl=http://mirrors.163.com/centos/6.5/addons/$basearch/ #gpgcheck=1 #gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.163.com/centos/6.5/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus baseurl=http://mirrors.163.com/centos/6.5/centosplus/$basearch/ gpgcheck=1 enabled=0
更新系统
yum update
3、交换机设置
需要把两台机器的eth1,设置成trunk.
虚拟机的通讯,是通过eth1,虚拟机访问外部网络,是通过node10上的L3agent,br-ex到eth0上访问外部网络。
交换机把虚拟机通讯的端口设置trunk模式,vlan的id是从1000到2000.
4、开始安装
安装packstack
yum install -y http://rdo.fedorapeople.org/openstack/openstack-havana/rdo-release-havana.rpm
yum install -y openstack-packstack
创建一个应答文件
packstack --gen-answer-file=multi-node.txt
修改应答文件,由于我已经有专门的cinder volume, 所以不需要创建。如果你没有手工创建cinder volume,那么你就不修改就可以。
CONFIG_CINDER_VOLUMES_CREATE=n CONFIG_HEAT_INSTALL=y CONFIG_NTP_SERVERS=0.uk.pool.ntp.org CONFIG_NAGIOS_INSTALL=y CONFIG_KEYSTONE_ADMIN_PW=admin (登入密码) CONFIG_NOVA_COMPUTE_HOSTS=192.168.2.211,192.168.2.212 (控制,计算节点的IP) CONFIG_NEUTRON_OVS_TENANT_NETWORK_TYPE=vlan (vlan模式) CONFIG_NEUTRON_OVS_VLAN_RANGES=physnet1:1000:2000 (虚拟机池) CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-eth1 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-eth1:eth1 CONFIG_HEAT_CLOUDWATCH_INSTALL=y CONFIG_HEAT_CFN_INSTALL=y CONFIG_NAGIOS_PW=nagios
开始安装
packstack --answer-file=multi-node.txt
安装过程,有可能因为源的原因中断,你可以重复运行。
如果遇到网络问题可以看下 /etc/resolv.conf
vi /etc/resolv.conf
5、完善
装完后,由于目前RDO的问题,没有创建br-ex,需要我们手工来创建
# cat /etc/sysconfig/network-scripts/ifcfg-br-ex DEVICE=br-ex IPADDR=192.168.2.211 PREFIX=24 GATEWAY=192.168.2.1 DNS1=8.8.8.8 ONBOOT=yes
修改 /etc/sysconfig/network-scripts/ifcfg-eth0, 注意:一定要加上eth0 的mac地址,不然会出错。
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes HWADDR=00:E0:81:D8:43:BE
然后运行下面命令
ovs-vsctl add-port br-ex eth0; service network restart
当运行 ovs-vsctl add-port的时候,网络就会中断,所以你两条命令需要一起执行。
剩下的操作就是在Dashboard
http://192.168.2.211 登陆Dashboard,密码你可以查看
# cat /root/keystonerc_admin export OS_USERNAME=admin export OS_TENANT_NAME=admin export OS_PASSWORD=admin export OS_AUTH_URL=http://172.28.1.10:35357/v2.0/ export PS1='[\u@\h \W(keystone_admin)]\$