Create external (floating) as 'flat' with required attributes

without adding his name to l3-agent config


blueprint: dyn-gen-physnet-set
Change-Id: I8acee213a19d26e3d1fc1ad7595ee15d35e97f4d
This commit is contained in:
Sergey Vasilenko 2015-11-16 14:55:35 +03:00
parent 2adc9e8f5a
commit c7d500b1b8
20 changed files with 134 additions and 91 deletions

View File

@ -31,12 +31,11 @@ if $use_neutron and ($controller or ($dvr and $compute)) {
prepare_network_config($network_scheme)
$ha_agent = try_get_value($neutron_advanced_config, 'l3_agent_ha', true)
$external_network_bridge = get_network_role_property('neutron/floating', 'interface')
class { 'neutron::agents::l3':
debug => $debug,
metadata_port => $metadata_port,
external_network_bridge => $external_network_bridge,
external_network_bridge => ' ',
manage_service => true,
enabled => true,
router_delete_namespaces => true,

View File

@ -35,24 +35,31 @@ if $use_neutron {
$dvr = try_get_value($neutron_advanced_config, 'neutron_dvr', false)
$segmentation_type = try_get_value($neutron_config, 'L2/segmentation_type')
if $compute and ! $dvr {
$do_floating = false
} else {
$do_floating = true
}
$bridge_mappings = generate_bridge_mappings($neutron_config, $network_scheme, {
'do_floating' => $do_floating,
'do_tenant' => true,
'do_provider' => false
})
$network_vlan_ranges = generate_physnet_vlan_ranges($neutron_config, $network_scheme, {
'do_floating' => $do_floating,
'do_tenant' => true,
'do_provider' => false
})
if $segmentation_type == 'vlan' {
$net_role_property = 'neutron/private'
$iface = get_network_role_property($net_role_property, 'phys_dev')
$physical_net_mtu = pick(get_transformation_property('mtu', $iface[0]), '1500')
$overlay_net_mtu = $physical_net_mtu
$enable_tunneling = false
$network_vlan_ranges_physnet2 = try_get_value($neutron_config, 'L2/phys_nets/physnet2/vlan_range')
$network_vlan_ranges = ["physnet2:${network_vlan_ranges_physnet2}"]
$physnet2_bridge = try_get_value($neutron_config, 'L2/phys_nets/physnet2/bridge')
$physnet2 = "physnet2:${physnet2_bridge}"
$physnet_ironic_bridge = try_get_value($neutron_config, 'L2/phys_nets/physnet-ironic/bridge', false)
if $physnet_ironic_bridge {
$bridge_mappings = [$physnet2, "physnet-ironic:${physnet_ironic_bridge}"]
} else {
$bridge_mappings = [$physnet2]
}
$physical_network_mtus = ["physnet2:${physical_net_mtu}"]
$tunnel_id_ranges = []
$network_type = 'vlan'
@ -63,7 +70,6 @@ if $use_neutron {
$iface = get_network_role_property($net_role_property, 'phys_dev')
$physical_net_mtu = pick(get_transformation_property('mtu', $iface[0]), '1500')
$tunnel_id_ranges = [try_get_value($neutron_config, 'L2/tunnel_id_ranges')]
$network_vlan_ranges = []
$physical_network_mtus = []
if $segmentation_type == 'gre' {

View File

@ -578,7 +578,9 @@ quantum: true
quantum_settings:
L2:
base_mac: fa:16:3e:00:00:00
phys_nets: {}
phys_nets:
physnet1:
bridge: br-floating
segmentation_type: tun
tunnel_id_ranges: 2:65535
L3:
@ -608,8 +610,8 @@ quantum_settings:
tenant: admin
net04_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -551,6 +551,8 @@ quantum_settings:
L2:
base_mac: fa:16:3e:00:00:00
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -582,8 +584,8 @@ quantum_settings:
tenant: admin
net04_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -551,6 +551,8 @@ quantum_settings:
L2:
base_mac: fa:16:3e:00:00:00
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -582,8 +584,8 @@ quantum_settings:
tenant: admin
net04_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -572,6 +572,8 @@ quantum_settings:
L2:
base_mac: fa:16:3e:00:00:00
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -603,8 +605,8 @@ quantum_settings:
tenant: admin
net04_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -552,6 +552,8 @@ quantum_settings:
L2:
base_mac: fa:16:3e:00:00:00
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -583,8 +585,8 @@ quantum_settings:
tenant: admin
net04_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -149,6 +149,8 @@ quantum_settings:
use_namespaces: true
L2:
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -158,10 +160,10 @@ quantum_settings:
net04_ext:
shared: false
L2:
network_type: local
network_type: flat
physnet: physnet1
router_ext: true
physnet:
segment_id:
segment_id:
L3:
nameservers: []
subnet: 10.122.11.0/24
@ -175,13 +177,13 @@ quantum_settings:
network_type: vlan
router_ext: false
physnet: physnet2
segment_id:
segment_id:
L3:
nameservers:
- 8.8.4.4
- 8.8.8.8
subnet: 10.122.13.0/24
floating:
floating:
gateway: 10.122.13.1
enable_dhcp: true
tenant: admin
@ -372,19 +374,19 @@ repo_setup:
- name: ubuntu
section: main universe multiverse
uri: http://archive.ubuntu.com/ubuntu/
priority:
priority:
suite: trusty
type: deb
- name: ubuntu-updates
section: main universe multiverse
uri: http://archive.ubuntu.com/ubuntu/
priority:
priority:
suite: trusty-updates
type: deb
- name: ubuntu-security
section: main universe multiverse
uri: http://archive.ubuntu.com/ubuntu/
priority:
priority:
suite: trusty-security
type: deb
- name: mos
@ -459,8 +461,8 @@ network_metadata:
swift/replication: 10.122.14.3
admin/pxe: 10.122.10.4
mongo/db: 10.122.12.5
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.4
glance/api: 10.122.12.5
heat/api: 10.122.12.5
@ -499,8 +501,8 @@ network_metadata:
ceph/radosgw: 10.122.11.4
admin/pxe: 10.122.10.6
mongo/db: 10.122.12.3
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.6
glance/api: 10.122.12.3
mgmt/vip: 10.122.12.3
@ -537,8 +539,8 @@ network_metadata:
swift/replication: 10.122.14.4
admin/pxe: 10.122.10.3
mongo/db: 10.122.12.4
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.3
glance/api: 10.122.12.4
heat/api: 10.122.12.4
@ -574,8 +576,8 @@ network_metadata:
swift/replication: 10.122.14.2
admin/pxe: 10.122.10.7
mongo/db: 10.122.12.6
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.7
glance/api: 10.122.12.6
heat/api: 10.122.12.6
@ -822,4 +824,4 @@ external_ntp:
metadata:
weight: 100
label: Host OS NTP Servers
openstack_version_prev:
openstack_version_prev:

View File

@ -590,6 +590,8 @@ quantum_settings:
use_namespaces: true
L2:
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -599,10 +601,10 @@ quantum_settings:
net04_ext:
shared: false
L2:
network_type: local
network_type: flat
physnet: physnet1
router_ext: true
physnet:
segment_id:
segment_id:
L3:
nameservers: []
subnet: 10.122.11.0/24
@ -616,13 +618,13 @@ quantum_settings:
network_type: vlan
router_ext: false
physnet: physnet2
segment_id:
segment_id:
L3:
nameservers:
- 8.8.4.4
- 8.8.8.8
subnet: 10.122.13.0/24
floating:
floating:
gateway: 10.122.13.1
enable_dhcp: true
tenant: admin
@ -813,19 +815,19 @@ repo_setup:
- name: ubuntu
section: main universe multiverse
uri: http://archive.ubuntu.com/ubuntu/
priority:
priority:
suite: trusty
type: deb
- name: ubuntu-updates
section: main universe multiverse
uri: http://archive.ubuntu.com/ubuntu/
priority:
priority:
suite: trusty-updates
type: deb
- name: ubuntu-security
section: main universe multiverse
uri: http://archive.ubuntu.com/ubuntu/
priority:
priority:
suite: trusty-security
type: deb
- name: mos
@ -900,8 +902,8 @@ network_metadata:
swift/replication: 10.122.14.3
admin/pxe: 10.122.10.4
mongo/db: 10.122.12.5
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.4
glance/api: 10.122.12.5
heat/api: 10.122.12.5
@ -940,8 +942,8 @@ network_metadata:
ceph/radosgw: 10.122.11.4
admin/pxe: 10.122.10.6
mongo/db: 10.122.12.3
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.6
glance/api: 10.122.12.3
mgmt/vip: 10.122.12.3
@ -978,8 +980,8 @@ network_metadata:
swift/replication: 10.122.14.4
admin/pxe: 10.122.10.3
mongo/db: 10.122.12.4
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.3
glance/api: 10.122.12.4
heat/api: 10.122.12.4
@ -1015,8 +1017,8 @@ network_metadata:
swift/replication: 10.122.14.2
admin/pxe: 10.122.10.7
mongo/db: 10.122.12.6
neutron/private:
neutron/floating:
neutron/private:
neutron/floating:
fw-admin: 10.122.10.7
glance/api: 10.122.12.6
heat/api: 10.122.12.6
@ -1286,4 +1288,4 @@ external_ntp:
metadata:
weight: 100
label: Host OS NTP Servers
openstack_version_prev:
openstack_version_prev:

View File

@ -149,6 +149,8 @@ quantum_settings:
use_namespaces: true
L2:
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -158,9 +160,9 @@ quantum_settings:
net04_ext:
shared: false
L2:
network_type: local
network_type: flat
physnet: physnet1
router_ext: true
physnet:
segment_id:
L3:
nameservers: []

View File

@ -149,6 +149,8 @@ quantum_settings:
use_namespaces: true
L2:
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -158,9 +160,9 @@ quantum_settings:
net04_ext:
shared: false
L2:
network_type: local
network_type: flat
physnet: physnet1
router_ext: true
physnet:
segment_id:
L3:
nameservers: []

View File

@ -150,6 +150,8 @@ quantum_settings:
use_namespaces: true
L2:
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -162,9 +164,9 @@ quantum_settings:
net04_ext:
shared: false
L2:
network_type: local
network_type: flat
physnet: physnet1
router_ext: true
physnet:
segment_id:
L3:
nameservers: []

View File

@ -645,6 +645,8 @@ quantum_settings:
use_namespaces: true
L2:
phys_nets:
physnet1:
bridge: br-floating
physnet2:
bridge: br-prv
vlan_range: 1000:1030
@ -657,9 +659,9 @@ quantum_settings:
net04_ext:
shared: false
L2:
network_type: local
network_type: flat
physnet: physnet1
router_ext: true
physnet:
segment_id:
L3:
nameservers: []

View File

@ -543,7 +543,9 @@ quantum_settings:
default_router: router04custom
L2:
base_mac: fa:16:3e:00:00:00
phys_nets: {}
phys_nets:
physnet1:
bridge: br-floating
segmentation_type: tun
tunnel_id_ranges: 2:65535
L3:
@ -573,8 +575,8 @@ quantum_settings:
tenant: admin
net04custom_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -564,7 +564,9 @@ quantum_settings:
default_router: router04custom
L2:
base_mac: fa:16:3e:00:00:00
phys_nets: {}
phys_nets:
physnet1:
bridge: br-floating
segmentation_type: tun
tunnel_id_ranges: 2:65535
L3:
@ -594,8 +596,8 @@ quantum_settings:
tenant: admin
net04custom_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -564,7 +564,9 @@ quantum_settings:
default_router: router04custom
L2:
base_mac: fa:16:3e:00:00:00
phys_nets: {}
phys_nets:
physnet1:
bridge: br-floating
segmentation_type: tun
tunnel_id_ranges: 2:65535
L3:
@ -594,8 +596,8 @@ quantum_settings:
tenant: admin
net04custom_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -564,7 +564,9 @@ quantum_settings:
default_router: router04custom
L2:
base_mac: fa:16:3e:00:00:00
phys_nets: {}
phys_nets:
physnet1:
bridge: br-floating
segmentation_type: tun
tunnel_id_ranges: 2:65535
L3:
@ -594,8 +596,8 @@ quantum_settings:
tenant: admin
net04custom_ext:
L2:
network_type: local
physnet: null
network_type: flat
physnet: physnet1
router_ext: true
segment_id: null
L3:

View File

@ -65,7 +65,7 @@ describe manifest do
'debug' => Noop.hiera('debug', true)
)}
it { should contain_class('neutron::agents::l3').with(
'external_network_bridge' => br_floating
'external_network_bridge' => ' ' # should be present and empty
)}
it { should contain_class('neutron::agents::l3').with(
'router_delete_namespaces' => true
@ -120,7 +120,7 @@ describe manifest do
'debug' => Noop.hiera('debug', true)
)}
it { should contain_class('neutron::agents::l3').with(
'external_network_bridge' => br_floating
'external_network_bridge' => ' ' # should be present and empty
)}
it { should contain_class('neutron::agents::l3').with(
'router_delete_namespaces' => true

View File

@ -50,7 +50,7 @@ describe manifest do
should contain_neutron_network(floating_net).with(
'ensure' => 'present',
'provider_physical_network' => (nets[floating_net]['L2']['physnet'] or false),
'provider_network_type' => 'local',
'provider_network_type' => 'flat',
'router_external' => nets[floating_net]['L2']['router_ext'],
'shared' => nets[floating_net]['shared'],
)

View File

@ -36,30 +36,41 @@ describe manifest do
role = Noop.hiera('role')
neutron_config = Noop.hiera_hash('neutron_config')
adv_neutron_config = Noop.hiera_hash('neutron_advanced_configuration')
dvr = adv_neutron_config.fetch('neutron_dvr', false)
pnets = neutron_config.fetch('L2',{}).fetch('phys_nets',{})
segmentation_type = neutron_config.fetch('L2',{}).fetch('segmentation_type')
if segmentation_type == 'vlan'
physnets_array = ["physnet2:#{pnets['physnet2']['bridge']}"]
network_type = 'vlan'
network_vlan_ranges_physnet2 = pnets.fetch('physnet2',{}).fetch('vlan_range')
network_vlan_ranges = ["physnet2:#{network_vlan_ranges_physnet2}"]
if role == 'compute' and !dvr
physnets_array = ["physnet2:#{pnets['physnet2']['bridge']}"]
network_vlan_ranges = ["physnet2:#{network_vlan_ranges_physnet2}"]
else
physnets_array = ["physnet1:#{pnets['physnet1']['bridge']}", "physnet2:#{pnets['physnet2']['bridge']}"]
network_vlan_ranges = ["physnet1", "physnet2:#{network_vlan_ranges_physnet2}"]
end
tunnel_id_ranges = []
physical_network_mtus = ["physnet2:1500"]
overlay_net_mtu = '1500'
tunnel_types = []
if pnets['physnet-ironic']
physnets_array << "physnet-ironic:#{pnets['physnet-ironic']['bridge']}"
network_vlan_ranges << 'physnet-ironic'
end
else
physnets_array = []
if role == 'compute' and !dvr
physnets_array = []
else
physnets_array = ["physnet1:#{pnets['physnet1']['bridge']}"]
end
network_type = 'vxlan'
network_vlan_ranges = []
network_vlan_ranges = ["physnet1"]
tunnel_id_ranges = [neutron_config.fetch('L2',{}).fetch('tunnel_id_ranges')]
physical_network_mtus = []
overlay_net_mtu = '1450'
tunnel_types = [network_type]
end
if pnets['physnet-ironic']
physnets_array << "physnet-ironic:#{pnets['physnet-ironic']['bridge']}"
end
bridge_mappings = physnets_array.compact
it { should contain_class('neutron::agents::ml2::ovs').with(
@ -134,9 +145,6 @@ describe manifest do
it { should contain_class('neutron::agents::ml2::ovs').with(
'enable_tunneling' => (segmentation_type != 'vlan')
)}
it { should contain_class('neutron::agents::ml2::ovs').with(
'bridge_mappings' => bridge_mappings
)}
it 'neutron plugin ml2 should be modified by override_resources' do
is_expected.to contain_override_resources('neutron_plugin_ml2').with(:data => neutron_plugin_ml2_override_resources)