When an administrator wants to use single or multiple external networks with VLAN ID, the dashboard interface requests the VLAN mappings information and sets them in the configuration file. As a result, when using the CLI, the user needs to use the same information, else the external network will fail. If the VLAN ID needs to be modified, then the user needs to update the parameter in Foreman.
As a fix to this issue:
1. An empty mapping for 'network_vlan_ranges' parameter as "physnet-external" is set as follows:
[("physnet-tenants:#{self.tenant_vlan_ranges}" if self.vlan_segmentation?), ("physnet-external")].compact
2. In the Dashboard, '[ ] Use VLAN ID _____ for External Network' is removed.
This fix allows the administrator to create an external network to be configured on any VLAN+VID, or a flat external network without VLAN.
DescriptionMiguel Angel Ajo
2014-07-07 19:57:53 UTC
Description of problem:
We have an option like this, when we ask for external network setup
[ ] Use VLAN ID _____ for External Network
But, as we are leaving the logical network setup to the user on CLI
or via horizon when that's available there's no reason to ask
the user for the same parameter twice.
There is a way to tell neutron that we allow VLAN on a physnet, with
any VID.
just change here:
https://github.com/theforeman/staypuft/blob/master/app/models/staypuft/deployment/neutron_service.rb#L153
from:
def networker_vlan_ranges
[("physnet-tenants:#{self.tenant_vlan_ranges}" if self.vlan_segmentation?),
("physnet-external:#{self.vlan_ranges_for_external_network}" if self.external_network_vlan?)].compact
end
into:
def networker_vlan_ranges
[("physnet-tenants:#{self.tenant_vlan_ranges}" if self.vlan_segmentation?),
("physnet-external")].compact
end
and then remove this from the UI:
[ ] Use VLAN ID _____ for External Network
This will allow for the external network to be configured on any
VLAN+VID, or a flat external network without vlan.
---------------------------
For example, an external network in flat model would be set from cli like:
# neutron net-create ext_net \
--provider:network_type flat \
--provider:physical_network physnet-external \
--router:external=True
an external network with VLAN on VID 3 would be created like this:
# neutron net-create ext_net \
--provider:network_type vlan \
--provider:segmentation_id 3 \
--provider:physical-network physnet-external \
--router:external=True
-------------
The CIDR, and floating ip ranges would be set equally after that:
neutron subnet-create ext_net \
--allocation-pool start=192.168.2.100,end=192.168.2.222 \
--gateway=192.168.2.1 \
--enable_dhcp=False \
192.168.2.0/24 \
--name ext_subnet
The problem with the current design, and this is why it's important, is that if the UI setting (& underlying mapping) and what user sets in CLI/API later don't match, it won't work.
To clarify, rather than conditionally adding the second entry for "physnet-external" with VLAN ID specified, we will *always* add "physnet-external" (but without VLAN ID) ?
Scott, sorry I didn't reply your question in comment 3, correct, Unconditionally adding the physnet-external mapping does the job.
Your pull request looks good.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2014-1090.html
Description of problem: We have an option like this, when we ask for external network setup [ ] Use VLAN ID _____ for External Network But, as we are leaving the logical network setup to the user on CLI or via horizon when that's available there's no reason to ask the user for the same parameter twice. There is a way to tell neutron that we allow VLAN on a physnet, with any VID. just change here: https://github.com/theforeman/staypuft/blob/master/app/models/staypuft/deployment/neutron_service.rb#L153 from: def networker_vlan_ranges [("physnet-tenants:#{self.tenant_vlan_ranges}" if self.vlan_segmentation?), ("physnet-external:#{self.vlan_ranges_for_external_network}" if self.external_network_vlan?)].compact end into: def networker_vlan_ranges [("physnet-tenants:#{self.tenant_vlan_ranges}" if self.vlan_segmentation?), ("physnet-external")].compact end and then remove this from the UI: [ ] Use VLAN ID _____ for External Network This will allow for the external network to be configured on any VLAN+VID, or a flat external network without vlan. --------------------------- For example, an external network in flat model would be set from cli like: # neutron net-create ext_net \ --provider:network_type flat \ --provider:physical_network physnet-external \ --router:external=True an external network with VLAN on VID 3 would be created like this: # neutron net-create ext_net \ --provider:network_type vlan \ --provider:segmentation_id 3 \ --provider:physical-network physnet-external \ --router:external=True ------------- The CIDR, and floating ip ranges would be set equally after that: neutron subnet-create ext_net \ --allocation-pool start=192.168.2.100,end=192.168.2.222 \ --gateway=192.168.2.1 \ --enable_dhcp=False \ 192.168.2.0/24 \ --name ext_subnet