upgrade openstack from ovs to ovn (by quqi99)
作者:张华 发表于:2023-11-27
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明(http://blog.csdn.net/quqi99)
set up ovs test env
./generate-bundle.sh --name ovs -s focal --num-compute 1 --ml2-ovs --run
./configure
source novarc
./tools/instance_launch.sh 1 jammy
prepretion
juju config neutron-gateway instance-mtu=1300
juju config neutron-openvswitch instance-mtu=1300
# Deploy ovn-central, ovn-chassis(on all neutron-openvswitch units), ovn-dedicated-chassis(on all neutron-gateway units) and vault
juju deploy ovn-central --series focal -n 3
# ovn-chassis is for every neutron-openvswitch (ovn-chassis is subordinate charm of nova-compute so there is no '--to' here)
juju config neutron-openvswitch bridge-mappings
juju config neutron-openvswitch data-port
source ~/novarc
nova interface-attach $(nova list |grep $(juju ssh neutron-openvswitch/0 -- hostname) |awk '{print $2}') --net-id=$(neutron net-show zhhuabj_admin_net -c id -f value)
juju deploy ovn-chassis --series focal --config new-units-paused=true \
--config bridge-interface-mappings='br-data:ens7' --config ovn-bridge-mappings=physnet1:br-data
# neutron-gateway is for every ovn-dedicated-chassis (neutron-gateway/0 is on the machine 7)
# juju config neutron-gateway bridge-mappings
# juju config neutron-gateway data-port
juju deploy ovn-dedicated-chassis --series focal --config new-units-paused=true \
--config bridge-interface-mappings='br-data:ens7' --config ovn-bridge-mappings=physnet1:br-data -n 1 --to 7
juju deploy --series focal vault --channel 1.7/stable
juju deploy --series focal mysql-router vault-mysql-router --channel 8.0/stable
juju add-relation vault-mysql-router:db-router mysql:db-router
juju add-relation vault-mysql-router:shared-db vault:shared-db
juju add-relation ovn-central:certificates vault:certificates
juju add-relation ovn-chassis:certificates vault:certificates
juju add-relation ovn-chassis:ovsdb ovn-central:ovsdb
juju add-relation nova-compute:neutron-plugin ovn-chassis:nova-compute
Perform the migration
juju config neutron-openvswitch firewall-driver=openvswitch
juju run-action neutron-gateway/0 pause
juju run-action neutron-openvswitch/0 pause
juju deploy neutron-api-plugin-ovn --series focal --config dns-servers="1.1.1.1 8.8.8.8"
juju add-relation neutron-api-plugin-ovn:neutron-plugin neutron-api:neutron-plugin-api-subordinate
juju add-relation neutron-api-plugin-ovn:certificates vault:certificates
juju add-relation neutron-api-plugin-ovn:ovsdb-cms ovn-central:ovsdb-cms
juju status neutron-api-plugin-ovn
juju run-action neutron-api-plugin-ovn/0 migrate-mtu i-really-mean-it=true
# Enable the Neutron OVN plugin, Wait for the deployment to settle.
juju config neutron-api manage-neutron-plugin-legacy-mode=false
juju run-action neutron-api/0 pause
# Perform initial synchronization of the Neutron and OVN databases
juju run-action neutron-api-plugin-ovn/0 migrate-ovn-db i-really-mean-it=true
# Perform Neutron database surgery to update network_type of overlay networks to ‘geneve’
juju run-action neutron-api-plugin-ovn/0 offline-neutron-morph-db
juju run-action neutron-api/0 resume
# Migrate hypervisors and gateways
juju run-action neutron-openvswitch/0 cleanup
juju run-action ovn-chassis/0 resume
juju run-action neutron-gateway/0 cleanup
juju run-action ovn-dedicated-chassis/0 resume
Post migration tasks
juju exec --application neutron-gateway 'apt remove -y neutron-dhcp-agent neutron-l3-agent neutron-metadata-agent neutron-openvswitch-agent'
juju remove-application neutron-gateway
juju exec --application neutron-openvswitch 'apt remove -y neutron-dhcp-agent neutron-l3-agent neutron-metadata-agent neutron-openvswitch-agent'
juju remove-application neutron-openvswitch
openstack network agent list
openstack network agent delete ...
reference
[1] https://docs.openstack.org/charm-guide/latest/project/procedures/ovn-migration.html