Change addressing the bug FPL-219

To prevent de-configuring contrail private network interfaces
with netconfig routines when cluster nodes are added or removed,
plugin overrides the network scheme for compute nodes.
Contrail setup, configure and provisioning tasks ensured to be
idempotent to allow safe cluster configuration changes.

Change-Id: Ibb6dabafebc595b2182c1b44df93556710844e7d
This commit is contained in:
Oleksandr Martsyniuk
2015-05-25 11:11:03 +03:00
parent ae2994f038
commit 918a5f2659
7 changed files with 54 additions and 52 deletions

View File

@@ -0,0 +1,21 @@
use_neutron: false
network_scheme:
transformations:
- action: add-br
name: br-fw-admin
- action: add-br
name: br-mgmt
- action: add-br
name: br-storage
- action: add-br
name: br-prv
roles:
neutron/private: br-prv
management: br-mgmt
storage: br-storage
fw-admin: br-fw-admin
interfaces:
eth0:
version: '1.1'
provider: lnx

View File

@@ -1,52 +1,11 @@
--- /opt/contrail/utils/fabfile/tasks/provision.py.orig
+++ /opt/contrail/utils/fabfile/tasks/provision.py
@@ -91,9 +91,32 @@
#server 10.84.14.2 10.84.14.2:9111 check
$__rabbitmq_config__
+
+################################################
+#contrail-webui-marker-start
+frontend contrail-webui-api *:443
+ mode tcp
+ default_backend contrail-webui-api
+
+backend contrail-webui-api
+ mode tcp
+ balance roundrobin
+ option nolinger
+ stick on src
+ stick-table type ip size 200k expire 30m
+ option tcp-check
+ tcp-check connect port 8143
+ default-server error-limit 1 on-error mark-down
+$__contrail_web_servers__
+#contrail-webui-marker-end
+###############################################
+
+
#contrail-config-marker-end
""")
+ web_listen_port = 8143
+ web_server_lines = ''
q_listen_port = 9697
q_server_lines = ''
api_listen_port = 9100
@@ -117,6 +140,9 @@
' server %s %s:%s check inter 2000 rise 2 fall 3\n' \
%(host_ip, host_ip, str(q_listen_port))
for i in range(nworkers):
+ web_server_lines = web_server_lines + \
+ ' server %s %s:%s check inter 2000 rise 2 fall 3\n' \
+ %(host_ip, host_ip, str(web_listen_port + i))
api_server_lines = api_server_lines + \
' server %s %s:%s check inter 2000 rise 2 fall 3\n' \
%(host_ip, host_ip, str(api_listen_port + i))
@@ -136,6 +162,7 @@
haproxy_config = template.safe_substitute({
'__contrail_quantum_servers__': q_server_lines,
'__contrail_api_backend_servers__': api_server_lines,
+ '__contrail_web_servers__': web_server_lines,
'__contrail_disc_backend_servers__': disc_server_lines,
'__contrail_hap_user__': 'haproxy',
'__contrail_hap_passwd__': 'contrail123',
@@ -463,7 +463,7 @@
cmd += ' --manage_neutron %s' % manage_neutron
else:
cmd += ' --manage_neutron no'
- internal_vip = get_contrail_internal_vip()
+ internal_vip = get_contrail_external_vip()
if internal_vip:
# Highly available setup
cmd += ' --internal_vip %s' % (internal_vip)

View File

@@ -47,6 +47,14 @@ class contrail::network (
}
}
'compute':{
file {'/etc/hiera/override':
ensure => directory,
}
file {'/etc/hiera/override/plugins.yaml':
ensure => present,
source => 'puppet:///modules/contrail/plugins.yaml',
require => File['/etc/hiera/override'],
}
case $operatingsystem
{
Ubuntu:

View File

@@ -27,6 +27,7 @@ class contrail::provision ( $node_role ) {
command => "python /opt/contrail/utils/provision_vrouter.py --host_name ${::fqdn} \
--host_ip ${contrail::address} --api_server_ip ${contrail::contrail_mgmt_vip} --openstack_ip ${contrail::mos_mgmt_vip} \
--admin_user neutron --admin_password ${contrail::admin_token} --admin_tenant_name services --oper add",
creates => '/opt/contrail/provision-vrouter-DONE',
}
}
}

View File

@@ -22,6 +22,7 @@ define contrail::run_fabric (
cwd => '/opt/contrail/utils',
path => '/bin:/usr/bin:/usr/local/bin',
logoutput => 'on_failure',
creates => "/opt/contrail/${name}-DONE"
}
case $hostgroup {
control: {
@@ -35,4 +36,4 @@ define contrail::run_fabric (
}
}
}
}
}

View File

@@ -28,6 +28,16 @@ class contrail::setup (
} ->
exec {'install.py.patch':
command => 'patch /opt/contrail/utils/fabfile/tasks/install.py /tmp/install.py.patch',
creates => '/opt/contrail/install.py.patch-DONE'
} ->
file {'/tmp/provision.py.patch':
ensure => file,
source => 'puppet:///modules/contrail/provision.py.patch'
} ->
exec {'provision.py.patch':
command => 'patch /opt/contrail/utils/fabfile/tasks/provision.py /tmp/provision.py.patch',
creates => '/opt/contrail/provision.py.patch-DONE'
} ->
file {'/tmp/keepalived_conf_template.py.patch':
@@ -36,6 +46,7 @@ class contrail::setup (
} ->
exec {'keepalived_conf_template.py.patch':
command => "patch ${pythonpath}/contrail_provisioning/common/templates/keepalived_conf_template.py /tmp/keepalived_conf_template.py.patch",
creates => '/opt/contrail/keepalived_conf_template.py.patch-DONE'
} ->
# Database installation

View File

@@ -41,6 +41,7 @@ class contrail::vrouter_module () {
exec {'patch_vrouter':
command => 'patch /usr/src/vrouter-2.01/include/vr_compat.h /tmp/vrouter.patch',
creates => '/opt/contrail/patch_vrouter-DONE'
}
->
exec {'add_module':