From 6160264a0bd6d01552e120d2ea9dc11629fe4088 Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Fri, 28 Sep 2018 16:02:30 +0400 Subject: [ha] Run OpenDaylight in cluster mode Change-Id: Id75fbee34a6cfc6e7fc60df053cccaaff21cb15a Signed-off-by: Michael Polenchuk --- .../cluster/mcp-common-ha/openstack_init.yml.j2 | 10 ------- .../classes/cluster/mcp-odl-ha/infra/config.yml | 23 ---------------- .../classes/cluster/mcp-odl-ha/infra/config.yml.j2 | 32 ++++++++++++++++++++++ .../classes/cluster/mcp-odl-ha/infra/kvm.yml.j2 | 12 ++++---- .../cluster/mcp-odl-ha/opendaylight/control.yml.j2 | 3 +- .../cluster/mcp-odl-ha/openstack/init.yml.j2 | 26 +++++++++++++----- mcp/reclass/classes/cluster/mcp-odl-noha/init.yml | 2 +- .../cluster/mcp-odl-noha/openstack/init.yml | 2 +- 8 files changed, 62 insertions(+), 48 deletions(-) delete mode 100644 mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml create mode 100644 mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml.j2 (limited to 'mcp/reclass') diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 index 7322378eb..bb76fdb10 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 @@ -110,16 +110,6 @@ parameters: openstack_compute_node01_hostname: cmp001 openstack_compute_node02_hostname: cmp002 - # opendaylight options -{%- if conf.MCP_VCP %} - opendaylight_server_node01_hostname: odl01 - opendaylight_server_node01_single_address: ${_param:opnfv_opendaylight_server_node01_single_address} -{%- else %} - opendaylight_control_hostname: ${_param:openstack_control_node02_hostname} - opendaylight_server_node01_hostname: ${_param:opendaylight_control_hostname} - opendaylight_server_node01_single_address: ${_param:opnfv_openstack_control_node02_address} -{%- endif %} - openstack_region: RegionOne admin_email: root@localhost db_connection_recycle_time: 300 diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml deleted file mode 100644 index f72993f89..000000000 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################## -# Copyright (c) 2018 Mirantis Inc., Enea AB and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## ---- -classes: - - system.reclass.storage.system.opendaylight_control_single - - cluster.mcp-common-ha.infra.config - - cluster.mcp-odl-ha.infra -parameters: - reclass: - storage: - node: - opendaylight_control_node01: - classes: - - cluster.${_param:cluster_name}.opendaylight.control - params: - linux_system_codename: xenial - single_address: ${_param:opendaylight_server_node01_single_address} - pxe_admin_address: ${_param:opnfv_opendaylight_server_node01_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml.j2 new file mode 100644 index 000000000..950c49355 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml.j2 @@ -0,0 +1,32 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc., Enea AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +classes: + - cluster.mcp-common-ha.infra.config + - cluster.mcp-odl-ha.infra +parameters: + _param: + opendaylight_server_node01_hostname: odl01 + opendaylight_server_node02_hostname: odl02 + opendaylight_server_node03_hostname: odl03 + reclass: + storage: + node: +{%- for i in range(1, 4) %} + opendaylight_control_node0{{ i }}: + name: ${_param:opendaylight_server_node0{{ i }}_hostname} + domain: ${_param:cluster_domain} + classes: + - cluster.${_param:cluster_name}.opendaylight.control + params: + salt_master_host: ${_param:reclass_config_master} + linux_system_codename: ${_param:linux_system_codename} + single_address: ${_param:opendaylight_server_node0{{ i }}_address} + pxe_admin_address: ${_param:opnfv_opendaylight_server_node0{{ i }}_pxe_admin_address} + keepalived_vip_priority: 10{{ i }} +{%- endfor %} diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/kvm.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/kvm.yml.j2 index 09a490669..ef874cdb5 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/kvm.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/kvm.yml.j2 @@ -25,17 +25,19 @@ parameters: cluster: internal: node: - odl01: - name: ${_param:opendaylight_server_node01_hostname} - provider: ${_param:infra_kvm_node02_hostname}.${_param:cluster_domain} + {%- for i in range(1, 4) %} + odl0{{ i }}: + name: ${_param:opendaylight_server_node0{{ i }}_hostname} + provider: ${_param:infra_kvm_node0{{ i }}_hostname}.${_param:cluster_domain} image: ${_param:salt_control_xenial_image} size: opendaylight.server -{%- if conf.nodes[nm.ctl01.idx].node.arch == 'aarch64' %} + {%- if conf.nodes[nm.ctl01.idx].node.arch == 'aarch64' %} machine: virt cpu_mode: host-passthrough loader: readonly: 'yes' type: pflash path: /usr/share/AAVMF/AAVMF_CODE.fd -{%- endif %} + {%- endif %} + {%- endfor %} {%- endif %} diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/opendaylight/control.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-ha/opendaylight/control.yml.j2 index 685cd9ec1..107965e99 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/opendaylight/control.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/opendaylight/control.yml.j2 @@ -7,7 +7,7 @@ ############################################################################## --- classes: - - service.opendaylight.server.single + - service.opendaylight.server.cluster - cluster.mcp-common-ha.openstack_interface_vcp_biport {%- if conf.MCP_VCP %} - cluster.mcp-odl-ha @@ -28,3 +28,4 @@ parameters: - odl-aaa-authn netvirt: - odl-netvirt-openstack + seed_nodes_list: {%- for i in range(1, 4) %} ${_param:opendaylight_server_node0{{ i }}_address}{%- endfor %} diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/init.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/init.yml.j2 index 6301e737a..1dd02bb8a 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/init.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/init.yml.j2 @@ -10,18 +10,30 @@ classes: - cluster.mcp-common-ha.openstack_init parameters: _param: + neutron_tenant_network_types: "flat,vxlan" + # opendaylight options - opendaylight_service_host: ${_param:opendaylight_server_node01_single_address} + opendaylight_service_host: ${_param:opnfv_opendaylight_server_address} opendaylight_rest_port: 8282 - - neutron_tenant_network_types: "flat,vxlan" {%- if conf.MCP_VCP %} + opendaylight_server_node01_hostname: odl01 + opendaylight_server_node02_hostname: odl02 + opendaylight_server_node03_hostname: odl03 + opendaylight_server_node01_address: ${_param:opnfv_opendaylight_server_node01_address} + opendaylight_server_node02_address: ${_param:opnfv_opendaylight_server_node02_address} + opendaylight_server_node03_address: ${_param:opnfv_opendaylight_server_node03_address} linux: network: host: - odl01: - address: ${_param:opendaylight_service_host} + {%- for i in range(1, 4) %} + odl0{{ i }}: + address: ${_param:opendaylight_server_node0{{ i }}_address} names: - - ${_param:opendaylight_server_node01_hostname} - - ${_param:opendaylight_server_node01_hostname}.${_param:cluster_domain} + - ${_param:opendaylight_server_node0{{ i }}_hostname} + - ${_param:opendaylight_server_node0{{ i }}_hostname}.${_param:cluster_domain} + {%- endfor %} +{%- else %} + opendaylight_control_hostname: ${_param:openstack_control_node02_hostname} + opendaylight_server_node01_hostname: ${_param:opendaylight_control_hostname} + opendaylight_server_node01_address: ${_param:opnfv_openstack_control_node02_address} {%- endif %} diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/init.yml b/mcp/reclass/classes/cluster/mcp-odl-noha/init.yml index e0c642a9f..64b2a16f9 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-noha/init.yml +++ b/mcp/reclass/classes/cluster/mcp-odl-noha/init.yml @@ -13,4 +13,4 @@ classes: parameters: _param: - opendaylight_service_host: ${_param:opnfv_opendaylight_server_node01_single_address} + opendaylight_service_host: ${_param:opnfv_opendaylight_server_node01_address} diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/init.yml b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/init.yml index a3918b231..87c41b048 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/init.yml +++ b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/init.yml @@ -17,7 +17,7 @@ parameters: network: host: odl01: - address: ${_param:opnfv_opendaylight_server_node01_single_address} + address: ${_param:opnfv_opendaylight_server_node01_address} names: - odl01 - odl01.${_param:cluster_domain} -- cgit 1.2.3-korg