You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/03/07 08:45:11 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3587: vrouter in redundant mode acquire guest ips from first ip of the tier

DaanHoogland 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_r389238666
 
 

 ##########
 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:
   can you make this block a method or put it in `acquireGuestIpAddressForVrouterRedundant()` maybe even with the validation below?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services