From 30775108386e5f9d6fa9749508252fccb43437f7 Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Mon, 2 Jun 2014 17:59:59 +0100 Subject: [PATCH] CLOUDSTACK-6722: [OVS][UI] Network created with StretchedL2Subnet is not available for vm deployement in other zones --- ui/scripts/instanceWizard.js | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index 5664cce5629..6708330d3c4 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -509,6 +509,47 @@ } }); + //In addition to the networks in the current zone, find networks in other zones that have stretchedL2subnet==true + //capability and show them on the UI + var allOtherAdvancedZones = []; + $.ajax({ + url: createURL('listZones'), + dataType: "json", + async: false, + success: function(json) { + var result = $.grep(json.listzonesresponse.zone, function(zone) { + return (zone.networktype == 'Advanced'); + }); + $(result).each(function() { + if (selectedZoneObj.id != this.id) + allOtherAdvancedZones.push(this); + }); + } + }); + if (allOtherAdvancedZones.length > 0) { + for (var i = 0; i < allOtherAdvancedZones.length; i++) { + var networkDataForZone = { + zoneId: allOtherAdvancedZones[i].id, + canusefordeploy: true + }; + $.ajax({ + url: createURL('listNetworks'), + data: networkDataForZone, + async: false, + success: function(json) { + var networksInThisZone = json.listnetworksresponse.network ? json.listnetworksresponse.network : []; + if (networksInThisZone.length > 0) { + for (var i = 0; i < networksInThisZone.length; i++) { + if (networksInThisZone[i].strechedl2subnet) { + networkObjsToPopulate.push(networksInThisZone[i]); + } + } + } + } + }); + } + } + $.ajax({ url: createURL("listNetworkOfferings"), dataType: "json",