Network-related changes
Network settings for contrail controllers updated. Contrail controllers default route changed to public network gateway. Metadata shared secret support added to contrail vrouter config. Change-Id: I2311509f051b95bdfb657d27fd53261e625c4810
This commit is contained in:
parent
af6617de7c
commit
225db4d574
16
README.md
16
README.md
|
@ -1,8 +1,20 @@
|
||||||
Contrail
|
|
||||||
============
|
|
||||||
Mirantis Fuel Contrail plugin
|
Mirantis Fuel Contrail plugin
|
||||||
|
=============================
|
||||||
|
|
||||||
Compatible versions:
|
Compatible versions:
|
||||||
|
|
||||||
- Mirantis Fuel 6.1
|
- Mirantis Fuel 6.1
|
||||||
- Juniper Contrail 2.01
|
- Juniper Contrail 2.01
|
||||||
|
|
||||||
|
How to build plugin:
|
||||||
|
|
||||||
|
- Install fuel plugin builder (fpb)
|
||||||
|
- Clone plugin repo and run fpb there:
|
||||||
|
|
||||||
|
git clone https://github.com/stackforge/fuel-plugin-contrail
|
||||||
|
|
||||||
|
cd fuel-plugin-contrail/
|
||||||
|
|
||||||
|
fpb --build .
|
||||||
|
|
||||||
|
- Check if file contrail-1.0-1.0.0-0.noarch.rpm was created.
|
||||||
|
|
|
@ -7,20 +7,7 @@ case $operatingsystem
|
||||||
$pkgs = ['python-crypto','python-netaddr','python-paramiko','ifenslave-2.6','patch',
|
$pkgs = ['python-crypto','python-netaddr','python-paramiko','ifenslave-2.6','patch',
|
||||||
'openjdk-7-jre-headless','contrail-fabric-utils','contrail-setup']
|
'openjdk-7-jre-headless','contrail-fabric-utils','contrail-setup']
|
||||||
$pip_pkgs = ['ecdsa-0.10','Fabric-1.7.0']
|
$pip_pkgs = ['ecdsa-0.10','Fabric-1.7.0']
|
||||||
|
|
||||||
#####################################
|
|
||||||
# Workaround for fuel bug 1438127
|
|
||||||
exec {'remove_default_gw':
|
|
||||||
command => '/sbin/ip route del default',
|
|
||||||
}
|
}
|
||||||
->
|
|
||||||
exec {'add_default_gw':
|
|
||||||
command => "/sbin/ip route add default via ${contrail::master_ip}",
|
|
||||||
before => Class['Contrail::Package'],
|
|
||||||
}
|
|
||||||
#####################################
|
|
||||||
}
|
|
||||||
|
|
||||||
CentOS:
|
CentOS:
|
||||||
{
|
{
|
||||||
$pkgs = ['python-netaddr','python-paramiko','patch',
|
$pkgs = ['python-netaddr','python-paramiko','patch',
|
||||||
|
@ -35,8 +22,9 @@ class { 'contrail::network':
|
||||||
ifname => $contrail::ifname,
|
ifname => $contrail::ifname,
|
||||||
netmask => $contrail::netmask_short,
|
netmask => $contrail::netmask_short,
|
||||||
public_addr => $contrail::public_addr,
|
public_addr => $contrail::public_addr,
|
||||||
public_netmask => $contrail::public_prefix,
|
public_netmask => $contrail::public_netmask,
|
||||||
public_if => $contrail::public_if
|
public_if => $contrail::public_if,
|
||||||
|
public_gw => $contrail::public_gw
|
||||||
} ->
|
} ->
|
||||||
|
|
||||||
class { 'contrail::ssh':
|
class { 'contrail::ssh':
|
||||||
|
|
|
@ -37,16 +37,19 @@ $address=get_ip_from_range($private_first,$private_last,$netmask_short,$uid,'fir
|
||||||
# Public address
|
# Public address
|
||||||
$neutron_settings=hiera('quantum_settings')
|
$neutron_settings=hiera('quantum_settings')
|
||||||
$public_cidr=$neutron_settings['predefined_networks']['net04_ext']['L3']['subnet']
|
$public_cidr=$neutron_settings['predefined_networks']['net04_ext']['L3']['subnet']
|
||||||
|
$public_tmp=split($public_cidr,'/')
|
||||||
|
$public_netmask=$public_tmp[1] # netmask prefix here
|
||||||
$public_first=get_first_ip($public_cidr)
|
$public_first=get_first_ip($public_cidr)
|
||||||
$public_last=get_last_ip($public_cidr)
|
$public_last=get_last_ip($public_cidr)
|
||||||
$public_tmp=split($public_cidr,'/')
|
$public_addr=get_ip_from_range($public_first,$public_last,$public_netmask,$uid,'last')
|
||||||
$public_prefix=$public_tmp[1] # netmask prefix here
|
|
||||||
$public_addr=get_ip_from_range($public_first,$public_last,$public_prefix,$uid,'last')
|
|
||||||
|
|
||||||
$public_if=$settings['contrail_public_if']
|
$public_if=$settings['contrail_public_if']
|
||||||
|
$public_gw=$neutron_settings['predefined_networks']['net04_ext']['L3']['gateway']
|
||||||
|
|
||||||
$contrail_mgmt_vip=get_last_ip(get_network_role_property('management', 'cidr'))
|
$contrail_mgmt_vip=get_last_ip(get_network_role_property('management', 'cidr'))
|
||||||
|
|
||||||
|
$metadata_secret=$neutron_settings['metadata']['metadata_proxy_shared_secret']
|
||||||
|
|
||||||
$contrail_node_basename='contrail'
|
$contrail_node_basename='contrail'
|
||||||
$deployment_node="${contrail_node_basename}-1"
|
$deployment_node="${contrail_node_basename}-1"
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,16 @@ class contrail::network (
|
||||||
$netmask,
|
$netmask,
|
||||||
$public_addr = undef,
|
$public_addr = undef,
|
||||||
$public_netmask = undef,
|
$public_netmask = undef,
|
||||||
$public_if = undef
|
$public_if = undef,
|
||||||
|
$public_gw = undef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
Exec {
|
||||||
|
path => '/bin:/sbin:/usr/bin:/usr/sbin',
|
||||||
|
}
|
||||||
|
|
||||||
# Remove interface from the bridge
|
# Remove interface from the bridge
|
||||||
exec {"remove_${ifname}":
|
exec {"remove_${ifname}":
|
||||||
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
|
|
||||||
command => "brctl delif br-aux ${ifname}",
|
command => "brctl delif br-aux ${ifname}",
|
||||||
returns => [0,1] # Idempotent
|
returns => [0,1] # Idempotent
|
||||||
} ->
|
} ->
|
||||||
|
@ -31,11 +35,20 @@ class contrail::network (
|
||||||
l23network::l3::ifconfig {$public_if:
|
l23network::l3::ifconfig {$public_if:
|
||||||
interface => $public_if,
|
interface => $public_if,
|
||||||
ipaddr => "${public_addr}/${public_netmask}",
|
ipaddr => "${public_addr}/${public_netmask}",
|
||||||
|
before => Exec["ifup-${public_if}"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# l23network::l3::ifconfig does not brings the interface up. Bug? Check it later
|
# l23network::l3::ifconfig does not brings the interface up. Bug? Check it later
|
||||||
exec {"ifup-${public_if}":
|
exec {"ifup-${public_if}":
|
||||||
command => "/sbin/ip link set up dev ${public_if}",
|
command => "ip link set up dev ${public_if}",
|
||||||
|
} ->
|
||||||
|
exec {'remove_default_gw':
|
||||||
|
command => '/sbin/ip route del default',
|
||||||
|
returns => [0,2] # Idempotent
|
||||||
|
} ->
|
||||||
|
# contrail controllers must be available from outer nets
|
||||||
|
exec {"add-default-route-via-${public_gw}":
|
||||||
|
command => "ip route add default via ${public_gw}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
'compute':{
|
'compute':{
|
||||||
|
|
|
@ -12,6 +12,7 @@ max_control_nodes=2
|
||||||
type=kvm
|
type=kvm
|
||||||
[FLOWS]
|
[FLOWS]
|
||||||
[METADATA]
|
[METADATA]
|
||||||
|
metadata_proxy_secret=<%= scope.lookupvar('contrail::metadata_secret') %>
|
||||||
[NETWORKS]
|
[NETWORKS]
|
||||||
control_network_ip=<%= scope.lookupvar('contrail::address') %>
|
control_network_ip=<%= scope.lookupvar('contrail::address') %>
|
||||||
[VIRTUAL-HOST-INTERFACE]
|
[VIRTUAL-HOST-INTERFACE]
|
||||||
|
|
|
@ -23,7 +23,7 @@ case node['role']
|
||||||
role_os << 'os_ctrl_'+mgm_ip.count.to_s
|
role_os << 'os_ctrl_'+mgm_ip.count.to_s
|
||||||
when 'base-os'
|
when 'base-os'
|
||||||
priv_ip << scope.function_get_ip_from_range([ scope.lookupvar('contrail::private_first'),scope.lookupvar('contrail::private_last'),scope.lookupvar('contrail::netmask_short'),node['uid'],'first'])
|
priv_ip << scope.function_get_ip_from_range([ scope.lookupvar('contrail::private_first'),scope.lookupvar('contrail::private_last'),scope.lookupvar('contrail::netmask_short'),node['uid'],'first'])
|
||||||
public_ip_baseos << scope.function_get_ip_from_range([ scope.lookupvar('contrail::public_first'),scope.lookupvar('contrail::public_last'),scope.lookupvar('contrail::public_prefix'),node['uid'],'last'])
|
public_ip_baseos << scope.function_get_ip_from_range([ scope.lookupvar('contrail::public_first'),scope.lookupvar('contrail::public_last'),scope.lookupvar('contrail::public_netmask'),node['uid'],'last'])
|
||||||
mgm_ip_baseos << node['internal_address']
|
mgm_ip_baseos << node['internal_address']
|
||||||
# Also find out a deployment node
|
# Also find out a deployment node
|
||||||
if node['user_node_name'] == scope.lookupvar('contrail::deployment_node')
|
if node['user_node_name'] == scope.lookupvar('contrail::deployment_node')
|
||||||
|
|
Loading…
Reference in New Issue