Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions f5_openstack_agent/lbaasv2/drivers/bigip/icontrol_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@
'f5_network_segment_physical_network', default=None,
help='Name of physical network to use for discovery of segment ID'
),
cfg.StrOpt(
'unlegacy_setting_placeholder', default=None,
help='use this setting to separate legacy with hw/etc on agent side'
),
cfg.IntOpt(
'f5_network_segment_polling_interval', default=10,
help='Seconds between periodic scans for disconnected virtual servers'
Expand Down
8 changes: 7 additions & 1 deletion f5_openstack_agent/lbaasv2/drivers/bigip/selfips.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ def assure_bigip_selfip(self, bigip, service, subnetinfo):
def _get_bigip_selfip_address(self, bigip, subnet, device_id):
u"""Ensure a selfip address is allocated on Neutron network."""
# Get ip address for selfip to use on BIG-IP.
if self.driver.conf.unlegacy_setting_placeholder:
LOG.debug('setting vnic_type to normal instead of baremetal')
vnic_type = "normal"
else:
vnic_type = "baremetal"

selfip_address = ""
selfip_name = "local-" + bigip.device_name + "-" + subnet['id']
ports = self.driver.plugin_rpc.get_port_by_name(port_name=selfip_name)
Expand All @@ -154,7 +160,7 @@ def _get_bigip_selfip_address(self, bigip, subnet, device_id):
name=selfip_name,
fixed_address_count=1,
device_id=device_id,
vnic_type="baremetal"
vnic_type=vnic_type
)

if port and 'fixed_ips' in port:
Expand Down
3 changes: 2 additions & 1 deletion f5_openstack_agent/lbaasv2/drivers/bigip/service_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,8 @@ def _add_profiles_session_persistence(self, listener, pool, vip):
listener["protocol"])
vip["ipProtocol"] = "tcp"

if protocol == 'TCP':
# if protocol is HTTPS, also use fastl4
if protocol == 'TCP' or protocol == 'HTTPS':
virtual_type = 'fastl4'
else:
virtual_type = 'standard'
Expand Down
8 changes: 7 additions & 1 deletion f5_openstack_agent/lbaasv2/drivers/bigip/snats.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ def _get_snat_traffic_group(self, tenant_id):

def get_snat_addrs(self, subnetinfo, tenant_id, snat_count, lb_id):
# Get the ip addresses for snat """
if self.driver.conf.unlegacy_setting_placeholder:
LOG.debug('setting vnic_type to normal instead of baremetal')
vnic_type = "normal"
else:
vnic_type = "baremetal"

subnet = subnetinfo['subnet']
snat_addrs = []

Expand All @@ -86,7 +92,7 @@ def get_snat_addrs(self, subnetinfo, tenant_id, snat_count, lb_id):
mac_address=None,
name=index_snat_name,
fixed_address_count=1, device_id=lb_id,
vnic_type="baremetal"
vnic_type=vnic_type
)
if new_port is not None:
ip_address = new_port['fixed_ips'][0]['ip_address']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def test_map_virtual_no_persist(self, target, basic_service_no_persist):
connectionLimit=cx_limit, description=description, enabled=True,
pool="pre-_" + pool['id'], mask="255.255.255.255",
vlansDisabled=True,
profiles=['/Common/http', '/Common/oneconnect'],
profiles=['/Common/fastL4'],
vlans=[], policies=[], rules=[],
fallbackPersistence='', persist=[])
assert expected == target._map_virtual(
Expand Down Expand Up @@ -380,8 +380,7 @@ def test_add_session_persistence_https_no_pool(
vip = dict()
adapter._add_profiles_session_persistence(listener, None, vip)

expected = dict(ipProtocol='tcp', profiles=['/Common/http',
'/Common/oneconnect'],
expected = dict(ipProtocol='tcp', profiles=['/Common/fastL4'],
fallbackPersistence='', persist=[])
assert vip == expected

Expand Down Expand Up @@ -409,8 +408,7 @@ def test_add_session_persistence_pool_no_persist(
adapter._add_profiles_session_persistence(listener, pool, vip)

expected = dict(ipProtocol='tcp',
profiles=['/Common/http',
'/Common/oneconnect'],
profiles=['/Common/fastL4'],
fallbackPersistence='', persist=[])
assert vip == expected

Expand All @@ -426,8 +424,7 @@ def test_add_session_persistence_pool_invalid_persist(
adapter._add_profiles_session_persistence(listener, pool, vip)

expected = dict(ipProtocol='tcp',
profiles=['/Common/http',
'/Common/oneconnect'],
profiles=['/Common/fastL4'],
fallbackPersistence='', persist=[])
assert vip == expected

Expand All @@ -442,8 +439,7 @@ def test_add_session_persistence_sourceip_persist(
vip = dict()
adapter._add_profiles_session_persistence(listener, pool, vip)

expected = dict(ipProtocol='tcp', profiles=['/Common/http',
'/Common/oneconnect'],
expected = dict(ipProtocol='tcp', profiles=['/Common/fastL4'],
fallbackPersistence='',
persist=[dict(name='/Common/source_addr')])
assert vip == expected
Expand All @@ -452,8 +448,7 @@ def test_add_session_persistence_sourceip_persist(
vip = dict()
adapter._add_profiles_session_persistence(listener, pool, vip)

expected = dict(ipProtocol='tcp', profiles=['/Common/http',
'/Common/oneconnect'],
expected = dict(ipProtocol='tcp', profiles=['/Common/fastL4'],
fallbackPersistence='',
persist=[dict(name='/Common/source_addr')])
assert vip == expected
Expand Down Expand Up @@ -555,9 +550,7 @@ def test_vs_http_profiles(self, service):

# should have http and oneconnect but not fastL4
vs = adapter.get_virtual(service)
assert '/Common/http' in vs['profiles']
assert '/Common/oneconnect' in vs['profiles']
assert '/Common/fastL4' not in vs['profiles']
assert '/Common/fastL4' in vs['profiles']

def test_vs_https_profiles(self, service):
adapter = ServiceModelAdapter(mock.MagicMock())
Expand All @@ -567,9 +560,7 @@ def test_vs_https_profiles(self, service):
# should have http and oneconnect but not fastL4
service['listener']['protocol'] = 'HTTPS'
vs = adapter.get_virtual(service)
assert '/Common/http' in vs['profiles']
assert '/Common/oneconnect' in vs['profiles']
assert '/Common/fastL4' not in vs['profiles']
assert '/Common/fastL4' in vs['profiles']

def test_vs_tcp_profiles(self, service):
adapter = ServiceModelAdapter(mock.MagicMock())
Expand Down