diff options
author | Harry Huang <huangxiangyu5@huawei.com> | 2017-07-08 17:00:31 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2017-07-10 09:46:02 +0800 |
commit | 4db2df5989e16b2ad1152b7851136ff4dc637252 (patch) | |
tree | ac10b2fd4ee83f492d3179fe28782b95c14445cb /deploy | |
parent | acdb47ae9c9866db6192e2754e8aaa5e752ba854 (diff) |
Add opendaylight switch
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>
Diffstat (limited to 'deploy')
14 files changed, 50 insertions, 1 deletions
diff --git a/deploy/client.py b/deploy/client.py index 433d90ec..810ac118 100644 --- a/deploy/client.py +++ b/deploy/client.py @@ -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) diff --git a/deploy/compass_conf/package_metadata/openstack.conf b/deploy/compass_conf/package_metadata/openstack.conf index b07efd4e..cfe66356 100755 --- a/deploy/compass_conf/package_metadata/openstack.conf +++ b/deploy/compass_conf/package_metadata/openstack.conf @@ -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', diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl index cca66f1d..7b0f4ab0 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl @@ -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) diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml index f7066697..2aa76d49 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-moon-ha.yml @@ -16,6 +16,8 @@ ipmiUser: root ipmiVer: '2.0' moon: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml index 527c1bfb..08debdc3 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l2-nofeature-ha.yml @@ -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' diff --git a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml index e840380a..8c082d38 100644 --- a/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod1/os-odl_l3-nofeature-ha.yml @@ -16,6 +16,8 @@ ipmiUser: root ipmiVer: '2.0' odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml index d9d6d837..97026c05 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-moon-ha.yml @@ -16,6 +16,8 @@ POWER_TOOL: ipmitool ipmiVer: '2.0' moon: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml index 923e1cbd..9018473f 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l2-nofeature-ha.yml @@ -14,6 +14,8 @@ FLAVOR: cluster POWER_TOOL: ipmitool ipmiVer: '2.0' +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml index 4502cd1e..32eec758 100644 --- a/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/hardware_environment/huawei-pod2/os-odl_l3-nofeature-ha.yml @@ -16,6 +16,8 @@ POWER_TOOL: ipmitool ipmiVer: '2.0' odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml b/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml index ffb9fa14..759055d6 100644 --- a/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml +++ b/deploy/conf/vm_environment/os-odl_l2-moon-ha.yml @@ -12,6 +12,8 @@ TYPE: virtual FLAVOR: cluster moon: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml index 042367e6..4296ffda 100644 --- a/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml +++ b/deploy/conf/vm_environment/os-odl_l2-nofeature-ha.yml @@ -11,6 +11,9 @@ TYPE: virtual FLAVOR: cluster +plugins: + - opendaylight: "Enable" + hosts: - name: host1 roles: diff --git a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml index 10a27ebd..fb530012 100644 --- a/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml +++ b/deploy/conf/vm_environment/os-odl_l3-nofeature-ha.yml @@ -12,6 +12,8 @@ TYPE: virtual FLAVOR: cluster odl_l3_agent: "Enable" +plugins: + - opendaylight: "Enable" hosts: - name: host1 diff --git a/deploy/config_parse.py b/deploy/config_parse.py index c7546eeb..363516b4 100644 --- a/deploy/config_parse.py +++ b/deploy/config_parse.py @@ -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")}) diff --git a/deploy/deploy_host.sh b/deploy/deploy_host.sh index 16bfef67..1556651f 100755 --- a/deploy/deploy_host.sh +++ b/deploy/deploy_host.sh @@ -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)) |