ArthurHlt commented on a change in pull request #3587: vrouter in redundant 
mode acquire guest ips from first ip of the tier
URL: https://github.com/apache/cloudstack/pull/3587#discussion_r389317331
 
 

 ##########
 File path: server/src/main/java/com/cloud/network/guru/GuestNetworkGuru.java
 ##########
 @@ -369,7 +377,14 @@ public NicProfile allocate(final Network network, 
NicProfile nic, final VirtualM
                 if (isGateway) {
                     guestIp = network.getGateway();
                 } else {
-                    guestIp = _ipAddrMgr.acquireGuestIpAddress(network, 
nic.getRequestedIPv4());
+                    if (nic.getRequestedIPv4() == null && 
vm.getVirtualMachine().getType() == VirtualMachine.Type.DomainRouter) {
+                        guestIp = 
this.acquireGuestIpAddressForVrouterRedundant(
+                                
VrouterPlacement.fromString(VrouterRedundantTiersPlacement.valueIn(network.getAccountId())),
+                                network, nic.getRequestedIPv4()
+                        );
+                    } else {
+                        guestIp = _ipAddrMgr.acquireGuestIpAddress(network, 
nic.getRequestedIPv4());
+                    }
 
 Review comment:
   I've made a more readable/clearer version in the last commit: 
https://github.com/apache/cloudstack/pull/3587/commits/b5c7e5e7547cce38160b7aa773646ca64245c3fd
 
   Let me know if you prefer like this

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to