You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2023/10/13 19:49:55 UTC

[cloudstack] branch nsx-rename-resources created (now cc55bd08b58)

This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a change to branch nsx-rename-resources
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


      at cc55bd08b58 add a setup phase between desgin and implementation of a network for intermediary steps

This branch includes the following new commits:

     new cc55bd08b58 add a setup phase between desgin and implementation of a network for intermediary steps

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[cloudstack] 01/01: add a setup phase between desgin and implementation of a network for intermediary steps

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch nsx-rename-resources
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit cc55bd08b589f5e29150f9ef115110acf3683b5e
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Fri Oct 13 15:49:32 2023 -0400

    add a setup phase between desgin and implementation of a network for intermediary steps
---
 api/src/main/java/com/cloud/network/guru/NetworkGuru.java      |  2 ++
 .../cloudstack/engine/orchestration/NetworkOrchestrator.java   |  1 +
 .../org/apache/cloudstack/service/NsxGuestNetworkGuru.java     | 10 ++++++++--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/api/src/main/java/com/cloud/network/guru/NetworkGuru.java b/api/src/main/java/com/cloud/network/guru/NetworkGuru.java
index a0e856daea5..cbadbb18a8f 100644
--- a/api/src/main/java/com/cloud/network/guru/NetworkGuru.java
+++ b/api/src/main/java/com/cloud/network/guru/NetworkGuru.java
@@ -96,6 +96,8 @@ public interface NetworkGuru extends Adapter {
      */
     Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, String name, Long vpcId, Account owner);
 
+    void setup(Network network, long networkId);
+
     /**
      * For guest networks that are in Allocated state after the design stage,
      * resources are allocated when the guest network is actually being used
diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 3231930de44..70176ebb29f 100644
--- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -812,6 +812,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                         }
                     }
                 });
+                guru.setup(network, relatedFile);
             }
 
             if (networks.size() < 1) {
diff --git a/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxGuestNetworkGuru.java b/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxGuestNetworkGuru.java
index e5b80fbe82c..70102ec8295 100644
--- a/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxGuestNetworkGuru.java
+++ b/plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxGuestNetworkGuru.java
@@ -133,17 +133,23 @@ public class NsxGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
             implemented.setName(name);
         }
         implemented.setBroadcastUri(Networks.BroadcastDomainType.NSX.toUri("nsx"));
+
+        return network;
+    }
+
+    @Override
+    public void setup(Network network, long networkId) {
         try {
+            NetworkVO designedNetwork  = _networkDao.findById(networkId);
             long zoneId = network.getDataCenterId();
             DataCenter zone = _dcDao.findById(zoneId);
             if (isNull(zone)) {
                 throw new CloudRuntimeException(String.format("Failed to find zone with id: %s", zoneId));
             }
-            createNsxSegment(implemented, zone);
+            createNsxSegment(designedNetwork, zone);
         } catch (Exception ex) {
             throw new CloudRuntimeException("unable to create NSX network " + network.getUuid() + "due to: " + ex.getMessage());
         }
-        return network;
     }
 
     @Override