Skip to content

Commit

Permalink
Floating IP issue:
Browse files Browse the repository at this point in the history
	In case of floating IP,source and destination ip's of ingress and egress flows of introspect
 are not matching with the src and dest VN subnet, because of this while doing trace flow ip's are not reachable from the vRouter.
 Fix is we are picking the fip from the flow info
 and updating with source and destination IP based on the direction.

Closes-Bug:#1549931

Change-Id: I7e7e86819216615a445714f8d924dc9daa823cff
(cherry picked from commit e9a6270)
  • Loading branch information
vishnuvv committed Mar 24, 2016
1 parent 29c345e commit 9d0635a
Showing 1 changed file with 28 additions and 3 deletions.
Expand Up @@ -362,8 +362,8 @@ define([
showInfoWindow("Cannot Trace route for the selected flow", "Info");
return;
}
constructVRFName (dataItem, postData, nwFqName);
postData['action'] = 'Trace Flow';
updateTraceFlowParams (dataItem, postData, nwFqName);
if (postData['vrfId'] != null || postData['vrfName'] != null) {
doTraceFlowRequest(postData, graphModel, deferredObj);
} else {
Expand Down Expand Up @@ -437,8 +437,8 @@ define([
showInfoWindow("Cannot Trace route for the selected flow", "Info");
return;
}
constructVRFName (dataItem, postData, nwFqName);
postData['action'] = 'Reverse Trace Flow';
updateTraceFlowParams (dataItem, postData, nwFqName);
if(postData['vrfId'] != null || postData['vrfName'] != null) {
doTraceFlowRequest(postData, graphModel, deferredObj);
} else {
Expand All @@ -449,7 +449,7 @@ define([
// and Dest VN are different then based on the direction either source or dest vn
// is used to construct the VRF name which is hack because of bug in vrouter
// https://bugs.launchpad.net/juniperopenstack/+bug/1541794
function constructVRFName (dataItem, postData, nwFqName) {
function updateTraceFlowParams (dataItem, postData, nwFqName) {
var vrfName = null;
if (dataItem['raw_json'] != null && dataItem['raw_json']['vrf'] != null &&
dataItem['raw_json']['dest_vrf'] != null &&
Expand All @@ -459,6 +459,31 @@ define([
vrfName = nwFqName + ':' + nwFqName.split(":")[2]
postData['vrfName'] = vrfName;
delete postData['vrfId'];
} else if (dataItem['raw_json'] != null && dataItem['raw_json']['vrf'] != null &&
dataItem['raw_json']['dest_vrf'] != null &&
dataItem['src_vn'] != null && dataItem['dst_vn'] != null &&
dataItem['raw_json']['vrf'] != dataItem['raw_json']['dest_vrf'] &&
dataItem['src_vn'] == dataItem['dst_vn'] && nwFqName != null) {
vrfName = nwFqName + ':' + nwFqName.split(":")[2]
postData['vrfName'] = vrfName;
delete postData['vrfId'];
}
// When we associate floating IP of VN2 to VM1(belongs to VN1) and do a ping from
// VM1 to a VM in VN2 we see the src and dest n/w's are VN2 and srcIP will be
// original(interface IP of VM) which belongs to VN1 for which trace flow fails.
// Hence we are updating the src/dest IP with floating IP based on direction.
if (dataItem['raw_json'] != null && dataItem['src_vn'] != null &&
dataItem['dst_vn'] != null && dataItem['src_vn'] == dataItem['dst_vn']
&& dataItem['raw_json']['fip'] != null &&
dataItem['raw_json']['fip'] != '0.0.0.0' &&
dataItem['peer_vrouter'] != postData['resolveVrfId']) {
if ((dataItem['direction'] == 'ingress' && postData['action'] == 'Trace Flow') ||
(dataItem['direction'] == 'egress' && postData['action'] == 'Reverse Trace Flow')) {
postData['srcIP'] = dataItem['raw_json']['fip'];
} else if ((dataItem['direction'] == 'ingress' && postData['action'] == 'Reverse Trace Flow') ||
(dataItem['direction'] == 'egress' && postData['action'] == 'Trace Flow')) {
postData['destIP'] = dataItem['raw_json']['fip'];
}
}
return postData;
}
Expand Down

0 comments on commit 9d0635a

Please sign in to comment.