cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Soheil Eizadi" <seiz...@infoblox.com>
Subject Re: Review Request 12883: DNS value in Zone is not getting set in the Network created for the Zone
Date Fri, 26 Jul 2013 22:22:51 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12883/
-----------------------------------------------------------

(Updated July 26, 2013, 10:22 p.m.)


Review request for cloudstack.


Changes
-------

Changed Network Manager for this fix (server/src/com/cloud/network/NetworkManagerImpl.java).


Bugs: https://issues.apache.org/jira/browse/CLOUDSTACK-3754


Repository: cloudstack-git


Description (updated)
-------

DNS value in Zone is not getting set in the Network created for the Zone. Due to this the
prepare and release calls to the Network Plugins are missing this information for the VMs.

see Jira bug https://issues.apache.org/jira/browse/CLOUDSTACK-3754 for additional details.

diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 8e90cb7..53715c2 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -2041,6 +2041,12 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
             dest, ReservationContext context, long nicId, NetworkVO network)
             throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,
             ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException
{
+       
+       if (dest.getDataCenter().getNetworkType() == NetworkType.Basic) {
+               if ((network.getNetworkDomain() == null) && (dest.getDataCenter().getDomain()
!= null)) {
+                       network.setNetworkDomain(dest.getDataCenter().getDomain());
+               }
+       }
         
         Integer networkRate = _networkModel.getNetworkRate(network.getId(), vmProfile.getId());
         NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
@@ -2116,6 +2122,13 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
                     s_logger.error("NetworkGuru "+guru+" prepareForMigration failed."); //
XXX: Transaction error
                 }
             }
+            
+               if (dest.getDataCenter().getNetworkType() == NetworkType.Basic) {
+                       if ((network.getNetworkDomain() == null) && (dest.getDataCenter().getDomain()
!= null)) {
+                               network.setNetworkDomain(dest.getDataCenter().getDomain());
+                       }
+               }
+               
             for (NetworkElement element : _networkElements) {
                 if(element instanceof NetworkMigrationResponder){
                     if(!((NetworkMigrationResponder) element).prepareMigration(profile, network,
vm, dest, context)){
@@ -2238,7 +2251,14 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager,
L
                 //commit the transaction before proceeding releasing nic profile on the network
elements
                 txn.commit();
 
-                // Perform release on network elements
+                DataCenterVO zone = _dcDao.findById(network.getDataCenterId());
+                if ( zone.getNetworkType() == NetworkType.Basic) {
+                       if ((network.getNetworkDomain() == null) && (zone.getDomain()
!= null)) {
+                               network.setNetworkDomain(zone.getDomain());
+                       }
+               }
+               
+               // Perform release on network elements
                 for (NetworkElement element : _networkElements) {
                     if (s_logger.isDebugEnabled()) {
                         s_logger.debug("Asking " + element.getName() + " to release " + nic);


Diffs
-----


Diff: https://reviews.apache.org/r/12883/diff/


Testing (updated)
-------

Validated that the defaultGuestNetwork created had the DNS Domain value set to NULL.

I mades sure that calls to prepare/release to Network Element Plugins had the DNS Domain set
to the Zone value.


Thanks,

Soheil Eizadi


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message