在Packstack环境手动安装OVN

安装OpenStack(allinone)环境

### 参考"Packstack使用"章节安装,但是不要配置外网网络

安装OVN组件

### 控制节点
# yum install -y openvswitch-ovn-central python-networking-ovn
### 所有节点
# yum install -y openvswitch openvswitch-ovn-common openvswitch-ovn-host
### 控制节点
# systemctl start ovn-northd
# systemctl enable ovn-northd
### 验证OVN服务6640、6641、6642端口监听情况
# netstat -lntp |grep ovsdb-server

开启OVN

### 所有节点
# vim /etc/neutron/neutron.conf
[qos]
notification_drivers = ovn-qos
# vim /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
mechanism_drivers = ovn
extension_drivers = port_security

[ovn]
ovn_nb_connection = tcp:92.0.0.10:6641
ovn_sb_connection = tcp:92.0.0.10:6642
ovn_l3_mode = False
ovn_l3_scheduler = chance
ovn_native_dhcp = True
neutron_sync_mode = repair
# systemctl restart openvswitch

配置OVN

### 所有节点
# ovs-vsctl set open . external-ids:ovn-remote=tcp:92.0.0.10:6642
# ovs-vsctl set open . external-ids:ovn-encap-type=flat,vxlan
### 使用节点IP
# ovs-vsctl set open . external-ids:ovn-encap-ip=92.0.0.10
### 控制节点
# ovs-vsctl set open . external-ids:ovn-bridge-mappings=extnet:br-ex

删除neutron默认配置

### 所有节点
# systemctl disable neutron-openvswitch-agent
# systemctl stop neutron-openvswitch-agent
# systemctl disable neutron-dhcp-agent
# systemctl stop neutron-dhcp-agent
# systemctl disable neutron-metadata-agent
# systemctl stop neutron-metadata-agent

# ovs-vsctl del-br br-tun
# ovs-vsctl del-port br-int patch-tun
# ovs-vsctl del-controller br-int
# ovs-vsctl set bridge br-int protocols=[]

### 非控制节点
# ovs-vsctl del-manager

### 所有节点
# systemctl start ovn-controller
# systemctl enable ovn-controller
# ip -all netns delete

重启neutron服务

### 控制节点
# systemctl restart neutron-server

### 所有节点
# systemctl restart \
openstack-nova-api \
openstack-nova-cert \
openstack-nova-compute \
openstack-nova-conductor \
openstack-nova-consoleauth \
openstack-nova-novncproxy \
openstack-nova-scheduler

# systemctl restart \
openstack-glance-api \
openstack-glance-registry

### 如果安装了cinder服务也需要重启
# systemctl restart \
openstack-cinder-api \
openstack-cinder-backup \
openstack-cinder-scheduler \
openstack-cinder-volume \
openstack-losetup

验证安装

# openstack network create --project admin --external --provider-network-type flat --provider-physical-network extnet external_network
# openstack subnet create --no-dhcp --subnet-range 192.168.200.0/24 --allocation-pool start=192.168.200.13,end=192.168.200.20 --gateway 192.168.200.1 --dns-nameserver 114.114.114.114 --network external_network public_subnet
# openstack flavor list
# openstack network list
# openstack server list
# openstack server create --flavor m1.tiny --image cirros --nic net-id=eb13d91a-4ff4-4226-b926-eac9cc864299 ovn-test
posted @ 2017-10-14 11:12  银魔术师  阅读(1667)  评论(0编辑  收藏  举报