Add opendaylight switch 85/37085/2
authorHarry Huang <huangxiangyu5@huawei.com>
Sat, 8 Jul 2017 09:00:31 +0000 (17:00 +0800)
committerHarry Huang <huangxiangyu5@huawei.com>
Mon, 10 Jul 2017 01:46:02 +0000 (09:46 +0800)
Add key plugins in DHA file and declare opendaylight
as a plugin in odl scenario.

Change-Id: Iefc07b691d5052a9980d8c87f23a9f82be61ed6e
Signed-off-by: Harry Huang <huangxiangyu5@huawei.com>
14 files changed:
deploy/client.py
deploy/compass_conf/package_metadata/openstack.conf
deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl
deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml
deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml
deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml
deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml
deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml
deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml
deploy/conf/vm_environment/os-odl_l2-moon-ha.yml
deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml
deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml
deploy/config_parse.py
deploy/deploy_host.sh

index 433d90e..810ac11 100644 (file)
@@ -256,6 +256,9 @@ opts = [
     cfg.StrOpt('onos_sfc',
                help='onos_sfc enable flag',
                default='Disable'),
+    cfg.StrOpt('plugins',
+               help='plugin dict',
+               default='{}'),
 ]
 CONF.register_cli_opts(opts)
 
@@ -764,6 +767,11 @@ class CompassClient(object):
             'moon'] = "Enable" if CONF.moon == "Enable" else "Disable"
         package_config[
             'onos_sfc'] = "Enable" if CONF.onos_sfc == "Enable" else "Disable"
+        package_config['plugins'] = []
+        if CONF.plugins:
+            for item in CONF.plugins.split(','):
+                key, value = item.split(':')
+                package_config['plugins'].append({key: value})
 
         status, resp = self.client.update_cluster_config(
             cluster_id, package_config=package_config)
index b07efd4..cfe6635 100755 (executable)
@@ -121,6 +121,14 @@ METADATA = {
             'default_value': 'Disable'
         }
     },
+    'plugins': {
+        '_self': {
+            'mapping_to': 'plugins',
+            'field': 'general_list',
+            'is_required':False,
+            'default_value': '[]'
+        }
+    },
     'ha_network': {
         '_self': {
             'mapping_to': 'ha_network',
index cca66f1..7b0f4ab 100755 (executable)
@@ -187,6 +187,13 @@ CONGRESS_PASS: $congress_pass
 DEMO_PASS: $demo_pass
 ADMIN_PASS: $admin_pass
 
+#set plugins = $getVar('plugins', [])
+#for item in plugins
+#set keys = $item.keys()
+#set values = $item.values()
+$keys[0]: $values[0]
+#end for
+
 #set neutron_service_plugins=['router']
 
 #if $getVar('enable_fwaas', True)
index 527c1bf..08debdc 100644 (file)
@@ -15,6 +15,9 @@ POWER_TOOL: ipmitool
 ipmiUser: root
 ipmiVer: '2.0'
 
+plugins:
+  - opendaylight: "Enable"
+
 hosts:
   - name: host1
     mac: 'F8:4A:BF:55:A2:8D'
index d9d6d83..97026c0 100644 (file)
@@ -16,6 +16,8 @@ POWER_TOOL: ipmitool
 ipmiVer: '2.0'
 
 moon: "Enable"
+plugins:
+  - opendaylight: "Enable"
 
 hosts:
   - name: host1
index ffb9fa1..759055d 100644 (file)
@@ -12,6 +12,8 @@ TYPE: virtual
 FLAVOR: cluster
 
 moon: "Enable"
+plugins:
+  - opendaylight: "Enable"
 
 hosts:
   - name: host1
index 042367e..4296ffd 100644 (file)
@@ -11,6 +11,9 @@
 TYPE: virtual
 FLAVOR: cluster
 
+plugins:
+  - opendaylight: "Enable"
+
 hosts:
   - name: host1
     roles:
index 10a27eb..fb53001 100644 (file)
@@ -12,6 +12,8 @@ TYPE: virtual
 FLAVOR: cluster
 
 odl_l3_agent: "Enable"
+plugins:
+  - opendaylight: "Enable"
 
 hosts:
   - name: host1
index c7546ee..363516b 100644 (file)
@@ -54,6 +54,12 @@ def export_dha_file(s, dha_file, conf_dir, ofile):
     env.update(s)
     if env.get('hosts', []):
         env.pop('hosts')
+    if 'plugins' in env:
+        plugin_list = []
+        for item in env.get('plugins'):
+            plugin_str = ':'.join([item.keys()[0], item.values()[0]])
+            plugin_list.append(plugin_str)
+        env.update({'plugins': ','.join(plugin_list)})
 
     env.update({'TYPE': s.get('TYPE', "virtual")})
     env.update({'FLAVOR': s.get('FLAVOR', "cluster")})
index 16bfef6..1556651 100755 (executable)
@@ -47,7 +47,7 @@ function deploy_host(){
     --deployment_timeout="${DEPLOYMENT_TIMEOUT}" --${POLL_SWITCHES_FLAG} --dashboard_url="${DASHBOARD_URL}" \
     --cluster_vip="${VIP}" --network_cfg="$NETWORK" --neutron_cfg="$NEUTRON" \
     --enable_secgroup="${ENABLE_SECGROUP}" --enable_fwaas="${ENABLE_FWAAS}" --expansion="${EXPANSION}" \
-    --rsa_file="$rsa_file" --enable_vpnaas="${ENABLE_VPNAAS}" --odl_l3_agent="${odl_l3_agent}" --moon="${moon}" --onos_sfc="${onos_sfc}"
+    --rsa_file="$rsa_file" --enable_vpnaas="${ENABLE_VPNAAS}" --odl_l3_agent="${odl_l3_agent}" --moon="${moon}" --onos_sfc="${onos_sfc}" --plugins="$plugins"
 
     RET=$?
     sleep $((AYNC_TIMEOUT+5))