393 return None |
398 return None |
394 evs = self._rc.get_object(adrnames[0]) |
399 evs = self._rc.get_object(adrnames[0]) |
395 self._evs_cache[evs_uuid] = evs |
400 self._evs_cache[evs_uuid] = evs |
396 return evs |
401 return evs |
397 |
402 |
|
403 def _vid_in_vidrange(self, vid, vidrange): |
|
404 # vidrange is of the form 1-5,10-20,30-35 |
|
405 vlan_ranges = vidrange.split(',') |
|
406 for vlan_range_str in vlan_ranges: |
|
407 vlan_range = vlan_range_str.split("-") |
|
408 vlan_start = int(vlan_range[0]) |
|
409 if len(vlan_range) == 2: |
|
410 vlan_end = int(vlan_range[1]) + 1 |
|
411 else: |
|
412 vlan_end = vlan_start + 1 |
|
413 if vid in xrange(vlan_start, vlan_end): |
|
414 return True |
|
415 return False |
|
416 |
398 def get_global_vlanrange_nw_uplink_map(self): |
417 def get_global_vlanrange_nw_uplink_map(self): |
399 if self._global_vlanrange_to_nw_uplink: |
418 if self._global_vlanrange_to_nw_uplink: |
400 return self._global_vlanrange_to_nw_uplink |
419 return self._global_vlanrange_to_nw_uplink |
401 i = 1 |
420 i = 1 |
|
421 extnet_found = False |
402 for l2ri in self.l2rangeinfo: |
422 for l2ri in self.l2rangeinfo: |
403 if l2ri.host or l2ri.name != 'uplink-port': |
423 if l2ri.host or l2ri.name != 'uplink-port': |
404 continue |
424 continue |
405 uplink_port = l2ri.value |
425 uplink_port = l2ri.value |
406 for range_prop in l2ri.range: |
426 for range_prop in l2ri.range: |
407 if range_prop.name != 'vlan-range': |
427 if range_prop.name != 'vlan-range': |
408 if range_prop.name == 'flat-range': |
428 if range_prop.name == 'flat-range': |
409 self._global_flat_nw_uplink = uplink_port |
429 self._global_flat_nw_uplink = uplink_port |
410 continue |
430 continue |
411 phys_nw = 'physnet' + str(i) |
|
412 vlanrange = range_prop.value |
431 vlanrange = range_prop.value |
|
432 phys_nw = '' |
|
433 if external_network_vid and not extnet_found: |
|
434 extnet_found = self._vid_in_vidrange(external_network_vid, |
|
435 vlanrange) |
|
436 if extnet_found: |
|
437 phys_nw = EXT_VLAN_PHYS_NET |
|
438 if not phys_nw: |
|
439 phys_nw = 'physnet' + str(i) |
|
440 i += 1 |
413 self._global_vlanrange_to_nw_uplink[vlanrange] = (phys_nw, |
441 self._global_vlanrange_to_nw_uplink[vlanrange] = (phys_nw, |
414 uplink_port) |
442 uplink_port) |
415 i += 1 |
|
416 return self._global_vlanrange_to_nw_uplink |
443 return self._global_vlanrange_to_nw_uplink |
417 |
444 |
418 def get_local_vlanrange_uplink_map(self): |
445 def get_local_vlanrange_uplink_map(self): |
419 if self._local_vlanrange_to_uplink: |
446 if self._local_vlanrange_to_uplink: |
420 return self._local_vlanrange_to_uplink |
447 return self._local_vlanrange_to_uplink |
857 def _do_ml2_vni_range(self, config): |
865 def _do_ml2_vni_range(self, config): |
858 vni_ranges_list = evsutil.get_vni_range_list() |
866 vni_ranges_list = evsutil.get_vni_range_list() |
859 vni_ranges_list = [vr.replace('-', ':') for vr in vni_ranges_list] |
867 vni_ranges_list = [vr.replace('-', ':') for vr in vni_ranges_list] |
860 vni_ranges = ",".join(vni_ranges_list) |
868 vni_ranges = ",".join(vni_ranges_list) |
861 config.set('ml2_type_vxlan', 'vni_ranges', vni_ranges) |
869 config.set('ml2_type_vxlan', 'vni_ranges', vni_ranges) |
862 |
|
863 @property |
|
864 def bridge_mappings(self): |
|
865 if self._bridge_mappings: |
|
866 return self._bridge_mappings |
|
867 bridge_mappings = [] |
|
868 global_nw_uplink_map = evsutil.get_global_vlanrange_nw_uplink_map() |
|
869 local_uplink_map = evsutil.get_local_vlanrange_uplink_map() |
|
870 # Any local uplink ports should have the same vlan-range boundaries |
|
871 # as the global ones. This is expected in an openstack deployment but |
|
872 # is not enforced by evs itself. So we raise a warning if we encounter |
|
873 # a local uplink-port for a vlan-range whose boundaries are different |
|
874 # from any that are defined globally. |
|
875 errs = set(local_uplink_map.keys()) - set(global_nw_uplink_map.keys()) |
|
876 if errs: |
|
877 errs = ','.join(errs) |
|
878 msg = """Found the following incorrect vlan_ranges that were not |
|
879 added to bridge_mappings in ovs_neutron_plugin.ini. Please update |
|
880 manually if necessary - %s""" % errs |
|
881 log_msg(LOG_WARN, msg) |
|
882 for vlanranges_str, (nw, uplink) in global_nw_uplink_map.iteritems(): |
|
883 uplink = local_uplink_map.get(vlanranges_str, uplink) |
|
884 bridge_mappings.append(nw + ':' + uplink) |
|
885 if evsutil.local_flat_nw_uplink: |
|
886 bridge_mappings.append(FLAT_PHYS_NET + ':' + |
|
887 evsutil.local_flat_nw_uplink) |
|
888 elif evsutil.global_flat_nw_uplink: |
|
889 bridge_mappings.append(FLAT_PHYS_NET + ':' + |
|
890 evsutil.global_flat_nw_uplink) |
|
891 self._bridge_mappings = ','.join(bridge_mappings) |
|
892 return self._bridge_mappings |
|
893 |
870 |
894 def _get_rabbit_host(self, conf_file): |
871 def _get_rabbit_host(self, conf_file): |
895 config = self._read_config(conf_file) |
872 config = self._read_config(conf_file) |
896 host = 'localhost' |
873 host = 'localhost' |
897 if config.has_option('DEFAULT', 'rabbit_host'): |
874 if config.has_option('DEFAULT', 'rabbit_host'): |
1440 2. dladm set-linkprop -p openvswitch=on %s |
1421 2. dladm set-linkprop -p openvswitch=on %s |
1441 3. ovs-vsctl -- --may-exist add-port %s %s |
1422 3. ovs-vsctl -- --may-exist add-port %s %s |
1442 4. Replumb IPs, if existed before on %s, on %s.""" % \ |
1423 4. Replumb IPs, if existed before on %s, on %s.""" % \ |
1443 (uplink, uplink, bridge, uplink, uplink, bridge) |
1424 (uplink, uplink, bridge, uplink, uplink, bridge) |
1444 log_msg(LOG_ERROR, msg, oneliner=False) |
1425 log_msg(LOG_ERROR, msg, oneliner=False) |
|
1426 return |
|
1427 |
1445 # add uplink to bridge |
1428 # add uplink to bridge |
1446 check_call(['/usr/bin/pfexec', '/usr/sbin/ovs-vsctl', '--', '--may-exist', |
1429 check_call(['/usr/bin/pfexec', '/usr/sbin/ovs-vsctl', '--', '--may-exist', |
1447 'add-port', bridge, uplink]) |
1430 'add-port', bridge, uplink]) |
1448 try: |
1431 try: |
1449 add_ips_and_gws_to_port(bridge) |
1432 add_ips_and_gws_to_port(bridge) |
1450 except CalledProcessError as err: |
1433 except CalledProcessError as err: |
1451 msg = """Failed to configure the IPs(%s) on br_ex0 VNIC. Manually |
1434 msg = """Failed to configure the IPs(%s) on %s VNIC. Manually |
1452 configure the IPs and set default gateway""" % ips |
1435 configure the IPs and set default gateway""" % (ips, bridge) |
1453 log_msg(LOG_ERROR, msg) |
1436 log_msg(LOG_ERROR, msg) |
1454 |
1437 |
1455 |
1438 |
1456 def get_uplink_ports_for_int_bridge(migr_conf_obj): |
1439 def get_uplink_ports_for_int_bridge(): |
1457 int_uplinks = set() |
1440 int_uplinks = set(bridge_mappings.values()) |
1458 for mapping in migr_conf_obj.bridge_mappings.split(','): |
1441 int_uplinks.discard(external_network_datalink) |
1459 if not mapping: |
|
1460 continue |
|
1461 uplink = mapping.split(':')[1] |
|
1462 int_uplinks.add(uplink) |
|
1463 return int_uplinks |
1442 return int_uplinks |
1464 |
1443 |
1465 |
1444 |
1466 def get_uplink_ports_for_ext_bridge(migr_conf_obj): |
1445 def get_uplink_port_for_ext_bridge(): |
1467 ext_uplink = None |
|
1468 if l2type == L2_TYPE_VLAN and external_network_datalink is not None: |
1446 if l2type == L2_TYPE_VLAN and external_network_datalink is not None: |
1469 ext_uplink = external_network_datalink |
1447 return external_network_datalink |
1470 return ext_uplink |
1448 return bridge_mappings.get(external_network_name) |
1471 |
1449 |
1472 connection = get_db_connection() |
1450 |
1473 engine = session.create_engine(connection) |
1451 def determine_neutron_conn_params(): |
1474 extnet_name = None |
1452 global neutron_conn |
1475 tmp = engine.execute(""" |
1453 if neutron_conn: |
1476 SELECT physical_network FROM ml2_network_segments WHERE network_id in |
1454 return |
1477 (SELECT network_id FROM externalnetworks) |
1455 config = iniparse.ConfigParser() |
1478 """) |
1456 if SVC_NOVA_COMPUTE in curnode_svcs: |
1479 tmp = list(tmp) |
1457 config.readfp(open(NOVA_CONF)) |
1480 if tmp: |
1458 neutron_conn['username'] = config.get('neutron', 'admin_username') |
1481 extnet_name = tmp[0][0] |
1459 neutron_conn['password'] = config.get('neutron', 'admin_password') |
1482 |
1460 neutron_conn['tenant'] = config.get('neutron', 'admin_tenant_name') |
1483 for mapping in migr_conf_obj.bridge_mappings.split(','): |
1461 neutron_conn['auth_url'] = \ |
1484 if not mapping: |
1462 config.get('keystone_authtoken', 'auth_uri') |
1485 continue |
1463 else: |
1486 map_items = mapping.split(':') |
1464 config.readfp(open(NEUTRON_CONF)) |
1487 nw_name, uplink = map_items[0], map_items[1] |
1465 neutron_conn['username'] = \ |
1488 if nw_name == extnet_name: |
1466 config.get('keystone_authtoken', 'admin_user') |
1489 ext_uplink = uplink |
1467 neutron_conn['password'] = \ |
1490 break |
1468 config.get('keystone_authtoken', 'admin_password') |
1491 return ext_uplink |
1469 neutron_conn['tenant'] = \ |
|
1470 config.get('keystone_authtoken', 'admin_tenant_name') |
|
1471 neutron_conn['auth_url'] = \ |
|
1472 config.get('keystone_authtoken', 'auth_uri') |
|
1473 |
|
1474 |
|
1475 def determine_external_network_name(): |
|
1476 global external_network_name, external_network_vid |
|
1477 determine_neutron_conn_params() |
|
1478 nc = neutron_client.Client(username=neutron_conn['username'], |
|
1479 password=neutron_conn['password'], |
|
1480 tenant_name=neutron_conn['tenant'], |
|
1481 auth_url=neutron_conn['auth_url']) |
|
1482 search_opts = {'router:external': True} |
|
1483 try: |
|
1484 external_network = nc.list_networks(**search_opts)['networks'] |
|
1485 except: |
|
1486 msg = """Could not get external network information from |
|
1487 neutron-server. Make sure it is online.""" |
|
1488 log_msg(LOG_ERROR, msg) |
|
1489 sys.exit(1) |
|
1490 |
|
1491 if not external_network: |
|
1492 return |
|
1493 external_network = external_network[0] |
|
1494 nw_type = external_network['provider:network_type'] |
|
1495 if nw_type == L2_TYPE_FLAT: |
|
1496 external_network_name = FLAT_PHYS_NET |
|
1497 else: |
|
1498 assert nw_type == L2_TYPE_VLAN |
|
1499 external_network_name = EXT_VLAN_PHYS_NET |
|
1500 external_network_vid = external_network['provider:segmentation_id'] |
|
1501 msg = "External Network name is " + external_network_name |
|
1502 log_msg(LOG_DEBUG, msg) |
|
1503 |
|
1504 |
|
1505 def determine_bridge_mappings(): |
|
1506 global bridge_mappings, external_network_datalink |
|
1507 global_nw_uplink_map = evsutil.get_global_vlanrange_nw_uplink_map() |
|
1508 local_uplink_map = evsutil.get_local_vlanrange_uplink_map() |
|
1509 # Any local uplink ports should have the same vlan-range boundaries |
|
1510 # as the global ones. This is expected in an openstack deployment but |
|
1511 # is not enforced by evs itself. So we raise a warning if we encounter |
|
1512 # a local uplink-port for a vlan-range whose boundaries are different |
|
1513 # from any that are defined globally. |
|
1514 errs = set(local_uplink_map.keys()) - set(global_nw_uplink_map.keys()) |
|
1515 if errs: |
|
1516 errs = ','.join(errs) |
|
1517 msg = """Found the following incorrect vlan_ranges that were not |
|
1518 added to bridge_mappings in ovs_neutron_plugin.ini. Please update |
|
1519 manually if necessary - %s""" % errs |
|
1520 log_msg(LOG_WARN, msg) |
|
1521 for vlanranges_str, (nw, uplink) in global_nw_uplink_map.iteritems(): |
|
1522 uplink = local_uplink_map.get(vlanranges_str, uplink) |
|
1523 bridge_mappings[nw] = uplink |
|
1524 if evsutil.local_flat_nw_uplink: |
|
1525 bridge_mappings[FLAT_PHYS_NET] = evsutil.local_flat_nw_uplink |
|
1526 elif evsutil.global_flat_nw_uplink: |
|
1527 bridge_mappings[FLAT_PHYS_NET] = evsutil.global_flat_nw_uplink |
|
1528 |
|
1529 external_network_datalink = bridge_mappings.get(external_network_name) |
|
1530 if external_network_datalink: |
|
1531 msg = "External Network datalink is " + external_network_datalink |
|
1532 log_msg(LOG_DEBUG, msg) |
|
1533 if bridge_mappings.values().count(external_network_datalink) > 1: |
|
1534 msg = """The external network datalink '%s' cannot be the uplink-port |
|
1535 of any physical network other than external network. Please satisfy |
|
1536 this condition before running migration.""" % external_network_datalink |
|
1537 log_msg(LOG_ERROR, msg) |
|
1538 sys.exit(1) |
|
1539 |
|
1540 # Depending on l2type and whether l3-agent is running on this node, |
|
1541 # bridge_mappings should have the following: |
|
1542 # 1. l3-agent not in node and l2type = vxlan => no bridge mappings. This is |
|
1543 # already handled since determine_bridge_mappings() won't be called for |
|
1544 # this condition. |
|
1545 # 2. l3-agent not in node and l2type = vlan/flat => bridge mappings should |
|
1546 # not have mapping for external network. |
|
1547 # 3. l3-agent in node and l2type = vxlan => bridge mappings should have |
|
1548 # only the mapping for external network. |
|
1549 # 4. l3-agent in node and l2type = vlan/flat => bridge mappings should have |
|
1550 # all the orignial mappings. |
|
1551 if SVC_L3_AGENT not in curnode_svcs: |
|
1552 bridge_mappings.pop(external_network_name, None) |
|
1553 elif l2type == L2_TYPE_VXLAN: |
|
1554 bridge_mappings.clear() |
|
1555 if external_network_datalink: |
|
1556 bridge_mappings[external_network_name] = \ |
|
1557 external_network_datalink |
|
1558 |
|
1559 |
|
1560 def finish(): |
|
1561 msg = "Migration Successful" |
|
1562 log_msg(LOG_INFO, msg) |
|
1563 check_call(['/usr/bin/pfexec', '/usr/sbin/svccfg', '-s', |
|
1564 SVC_NEUTRON_UPGRADE, 'setprop', 'config/evs2ovs', '=', |
|
1565 'astring:', 'done'], stdout=PIPE, stderr=PIPE) |
|
1566 check_call(['/usr/bin/pfexec', '/usr/sbin/svccfg', '-s', |
|
1567 SVC_NEUTRON_UPGRADE, 'refresh'], stdout=PIPE, stderr=PIPE) |
|
1568 msg = "Exiting..." |
|
1569 log_msg(LOG_INFO, msg) |
|
1570 sys.exit() |
1492 |
1571 |
1493 |
1572 |
1494 def main(): |
1573 def main(): |
1495 # help text |
1574 # help text |
1496 parser = argparse.ArgumentParser( |
1575 parser = argparse.ArgumentParser( |
1497 formatter_class=argparse.RawDescriptionHelpFormatter, description=''' |
1576 formatter_class=argparse.RawDescriptionHelpFormatter, description=''' |
1498 Migration script to migrate OpenStack Cloud based on EVS to an |
1577 Migration script to migrate OpenStack Cloud based on EVS to an |
1499 OpenStack cloud based on OVS. There are four steps to migration. |
1578 OpenStack cloud based on OVS. |
1500 |
1579 |
|
1580 There are four steps to migration: |
1501 -- Populate Neutron ML2 tables |
1581 -- Populate Neutron ML2 tables |
1502 -- Replace EVS information in existing configuration files with OVS |
1582 -- Replace EVS information in existing configuration files with OVS |
1503 (neutron.conf, dhcp_agent.ini, l3_agent.ini, and nova.conf) |
1583 (neutron.conf, dhcp_agent.ini, l3_agent.ini, and nova.conf) |
1504 -- Add OVS information to new configuration files |
1584 -- Add OVS information to new configuration files |
1505 (ml2_conf.ini and ovs_neutron_agent.ini) |
1585 (ml2_conf.ini and ovs_neutron_agent.ini) |
1506 -- Clear EVS information in Zones and populate the anets for OVS |
1586 -- Clear EVS information in Zones and populate the anets for OVS |
|
1587 |
|
1588 The nodes must be migrated in the following order: |
|
1589 -- controller node running neutron-server |
|
1590 -- all of the nodes running neutron-dhcp-agent or neutron-l3-agent |
|
1591 -- all of the compute nodes |
|
1592 |
|
1593 It is advisable to run migration with nohup if using ssh over a link that |
|
1594 is also used by OpenStack. |
1507 ''') |
1595 ''') |
1508 parser.parse_args() |
1596 parser.parse_args() |
1509 |
1597 |
1510 signal.signal(signal.SIGHUP, signal.SIG_IGN) |
1598 signal.signal(signal.SIGHUP, signal.SIG_IGN) |
1511 try: |
1599 try: |
1562 l2type = evsutil.l2type |
1650 l2type = evsutil.l2type |
1563 msg = "l2type = %s" % l2type |
1651 msg = "l2type = %s" % l2type |
1564 log_msg(LOG_DEBUG, msg) |
1652 log_msg(LOG_DEBUG, msg) |
1565 migr_conf_obj = ConfigEVSToOVS() |
1653 migr_conf_obj = ConfigEVSToOVS() |
1566 |
1654 |
1567 # step-0: add ovs integration bridge, update conf and enable |
1655 # step-0: Determine bridge_mappings and ensure external network datalink |
1568 # neutron-openvswitch-agent. No step-0 if the node has only neutron-server. |
1656 # is not serving as uplink port for other physical networks. This is only |
1569 if set(curnode_svcs) - set([SVC_NEUTRON_SERVER]): |
1657 # required if l2-type is VLAN or FLAT or if neutron-l3-agent is running on |
1570 if not is_svc_online(SVC_OVSDB_SERVER, exit_on_maintenance=True): |
1658 # this node. |
1571 enable_svc(SVC_OVSDB_SERVER, exit_on_fail=True) |
1659 if l2type != L2_TYPE_VXLAN or SVC_L3_AGENT in curnode_svcs: |
1572 if not is_svc_online(SVC_VSWITCH_SERVER, exit_on_maintenance=True): |
1660 determine_external_network_name() |
1573 enable_svc(SVC_VSWITCH_SERVER, exit_on_fail=True) |
1661 determine_bridge_mappings() |
1574 add_ovs_bridge(OVS_INT_BRIDGE) |
1662 |
1575 # bridge_mappings is only required if l2-type is VLAN or FLAT or if |
1663 # step-1: Populate ML2 tables and update Neutron and ML2 config files. |
1576 # neutron-l3-agent is running on this node. |
1664 if SVC_NEUTRON_SERVER in curnode_svcs: |
1577 bmap_reqd = (l2type != L2_TYPE_VXLAN) or (SVC_L3_AGENT in curnode_svcs) |
1665 msg = "Current migration based on svc: %s" % SVC_NEUTRON_SERVER |
1578 migr_conf_obj.update_ovs_neutron_plugin_ini(bmap_reqd) |
1666 log_msg(LOG_INFO, msg) |
1579 if bmap_reqd: |
1667 neutron_evs_to_ovs(migr_conf_obj) |
1580 migr_conf_obj.update_Open_vSwitch_other_config() |
1668 # We have already enabled neutron-server. There is nothing else to do |
1581 # we will enable the OVS agent later |
1669 # wrt the service. |
1582 |
1670 curnode_svcs.remove(SVC_NEUTRON_SERVER) |
|
1671 |
|
1672 # We don't need to do anything else if neutron-server is the only service |
|
1673 # we are migrating on this node. |
|
1674 if not curnode_svcs: |
|
1675 finish() |
|
1676 |
|
1677 # step-2: add ovs integration bridge and update conf for |
|
1678 # neutron-openvswitch-agent. |
|
1679 if not is_svc_online(SVC_OVSDB_SERVER, exit_on_maintenance=True): |
|
1680 enable_svc(SVC_OVSDB_SERVER, exit_on_fail=True) |
|
1681 if not is_svc_online(SVC_VSWITCH_SERVER, exit_on_maintenance=True): |
|
1682 enable_svc(SVC_VSWITCH_SERVER, exit_on_fail=True) |
|
1683 add_ovs_bridge(OVS_INT_BRIDGE) |
|
1684 bmap_str = '' |
|
1685 if bridge_mappings: |
|
1686 for nw, uplink in bridge_mappings.iteritems(): |
|
1687 bmap_str += nw + ':' + uplink + ',' |
|
1688 bmap_str = bmap_str.strip(',') |
|
1689 if bmap_str: |
|
1690 msg = "bridge_mappings = " + bmap_str |
|
1691 log_msg(LOG_DEBUG, msg) |
|
1692 migr_conf_obj.update_Open_vSwitch_other_config(bmap_str) |
|
1693 migr_conf_obj.update_ovs_neutron_plugin_ini(bmap_str) |
|
1694 # we will enable the OVS agent later |
|
1695 |
|
1696 # step-3: migrate the other services. |
1583 svc_func_map = { |
1697 svc_func_map = { |
1584 SVC_NEUTRON_SERVER: neutron_evs_to_ovs, |
|
1585 SVC_DHCP_AGENT: dhcp_evs_to_ovs, |
1698 SVC_DHCP_AGENT: dhcp_evs_to_ovs, |
1586 SVC_L3_AGENT: l3_evs_to_ovs, |
1699 SVC_L3_AGENT: l3_evs_to_ovs, |
1587 SVC_NOVA_COMPUTE: nova_evs_to_ovs |
1700 SVC_NOVA_COMPUTE: nova_evs_to_ovs |
1588 } |
1701 } |
1589 |
1702 |
1603 OVS agent will go into maintenance. Please remove these datalinks |
1716 OVS agent will go into maintenance. Please remove these datalinks |
1604 and clear the OVS agent service.""" |
1717 and clear the OVS agent service.""" |
1605 log_msg(LOG_WARN, msg) |
1718 log_msg(LOG_WARN, msg) |
1606 else: |
1719 else: |
1607 assert l2type == L2_TYPE_VLAN or l2type == L2_TYPE_FLAT |
1720 assert l2type == L2_TYPE_VLAN or l2type == L2_TYPE_FLAT |
1608 int_uplinks = get_uplink_ports_for_int_bridge(migr_conf_obj) |
1721 int_uplinks = get_uplink_ports_for_int_bridge() |
1609 # add the uplink-ports to integration bridge |
1722 # add the uplink-ports to integration bridge |
1610 for uplink in int_uplinks: |
1723 for uplink in int_uplinks: |
1611 add_uplink_to_br(uplink, OVS_INT_BRIDGE) |
1724 add_uplink_to_br(uplink, OVS_INT_BRIDGE) |
1612 |
1725 |
1613 # enable all services |
1726 # enable all services |
1614 enable_svc(SVC_OVS_AGENT) |
1727 enable_svc(SVC_OVS_AGENT) |
1615 for svc in curnode_svcs: |
1728 for svc in curnode_svcs: |
1616 if svc == SVC_L3_AGENT: |
1729 if svc == SVC_L3_AGENT: |
1617 # add the port to br_ex0 |
1730 # add the port to br_ex0 |
1618 ext_uplink = get_uplink_ports_for_ext_bridge(migr_conf_obj) |
1731 ext_uplink = get_uplink_port_for_ext_bridge() |
1619 if ext_uplink: |
1732 if ext_uplink: |
1620 add_uplink_to_br(ext_uplink, OVS_EXT_BRIDGE) |
1733 add_uplink_to_br(ext_uplink, OVS_EXT_BRIDGE) |
1621 enable_svc(svc) |
1734 enable_svc(svc) |
1622 msg = "Migration Successful" |
1735 |
1623 log_msg(LOG_INFO, msg) |
1736 finish() |
1624 check_call(['/usr/bin/pfexec', '/usr/sbin/svccfg', '-s', |
|
1625 SVC_NEUTRON_UPGRADE, 'setprop', 'config/evs2ovs', '=', |
|
1626 'astring:', 'done'], stdout=PIPE, stderr=PIPE) |
|
1627 check_call(['/usr/bin/pfexec', '/usr/sbin/svccfg', '-s', |
|
1628 SVC_NEUTRON_UPGRADE, 'refresh'], stdout=PIPE, stderr=PIPE) |
|
1629 msg = "Exiting..." |
|
1630 log_msg(LOG_INFO, msg) |
|
1631 |
1737 |
1632 |
1738 |
1633 if __name__ == "__main__": |
1739 if __name__ == "__main__": |
1634 main() |
1740 main() |