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

rohit pushed a commit to branch 4.11
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.11 by this push:
     new 8e43d25  server: Fail to restart VPC with cleanup if there are 
multiple public IPs in different subnet" (#3342)
8e43d25 is described below

commit 8e43d258f379cadf51f5b8c00edd63d29f19b076
Author: ustcweizhou <[email protected]>
AuthorDate: Thu May 30 08:03:03 2019 +0200

    server: Fail to restart VPC with cleanup if there are multiple public IPs 
in different subnet" (#3342)
    
    If there are multiple IPs in different subnet assigned to a VPC, after 
restarting VPC with cleanup, the VRs will be FAULT state.
    
    Step to reproduce:
    (1) create vpc, source nat IP is 10.11.118.X
    (2) assign two public IPs in other subnet to this VPC. 10.11.119.X and 
10.11.119.Y
    (3) deploy two vms in the vpc, and enable static nat 10.11.119.X and 
10.11.119.Y to these two vms
    (4) restart vpc with cleanup. There are more than 1 nic allocated for 
10.11.119 to new VRs
    
    Logs as below:
    2019-05-10 14:12:24,652 DEBUG [o.a.c.e.o.NetworkOrchestrator] 
(API-Job-Executor-36:ctx-839f6522 job-652 ctx-35fb4667) (logid:1ab7aa37) 
Allocating nic for vm VM[DomainRouter|r-85-VM] in network Ntwk[200|Public|1] 
with requested profile NicProfile[0-0-null-10.11.118.157-vlan://untagged
    2019-05-10 14:12:24,676 DEBUG [o.a.c.e.o.NetworkOrchestrator] 
(API-Job-Executor-36:ctx-839f6522 job-652 ctx-35fb4667) (logid:1ab7aa37) 
Allocating nic for vm VM[DomainRouter|r-85-VM] in network Ntwk[200|Public|1] 
with requested profile NicProfile[0-0-null-10.11.119.110-vlan://119
    2019-05-10 14:12:24,699 DEBUG [o.a.c.e.o.NetworkOrchestrator] 
(API-Job-Executor-36:ctx-839f6522 job-652 ctx-35fb4667) (logid:1ab7aa37) 
Allocating nic for vm VM[DomainRouter|r-85-VM] in network Ntwk[200|Public|1] 
with requested profile NicProfile[0-0-null-10.11.119.110-vlan://119
    2019-05-10 14:12:24,723 DEBUG [o.a.c.e.o.NetworkOrchestrator] 
(API-Job-Executor-36:ctx-839f6522 job-652 ctx-35fb4667) (logid:1ab7aa37) 
Allocating nic for vm VM[DomainRouter|r-85-VM] in network Ntwk[200|Public|1] 
with requested profile NicProfile[0-0-null-10.11.119.110-vlan://119
    
    This is a regression issue caused by commit 1d382e0
---
 .../cloud/network/router/VpcNetworkHelperImpl.java    | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java 
b/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java
index b4cf809..4e49bd0 100644
--- a/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java
+++ b/server/src/com/cloud/network/router/VpcNetworkHelperImpl.java
@@ -154,14 +154,15 @@ public class VpcNetworkHelperImpl extends 
NetworkHelperImpl {
                     publicVlans.add(publicIp.getVlanTag());
                 }
             }
-            if (publicNetwork != null) {
-                if (networks.get(publicNetwork) != null) {
-                    @SuppressWarnings("unchecked") final List<NicProfile> 
publicNicProfiles = (List<NicProfile>)networks.get(publicNetwork);
-                    publicNicProfiles.addAll(publicNics);
-                    networks.put(publicNetwork, publicNicProfiles);
-                } else {
-                    networks.put(publicNetwork, publicNics);
-                }
+        }
+        if (publicNetwork != null) {
+            if (networks.get(publicNetwork) != null) {
+                @SuppressWarnings("unchecked")
+                final List<NicProfile> publicNicProfiles = 
(List<NicProfile>)networks.get(publicNetwork);
+                publicNicProfiles.addAll(publicNics);
+                networks.put(publicNetwork, publicNicProfiles);
+            } else {
+                networks.put(publicNetwork, publicNics);
             }
         }
 
@@ -187,4 +188,4 @@ public class VpcNetworkHelperImpl extends NetworkHelperImpl 
{
 
         return networks;
     }
-}
\ No newline at end of file
+}

Reply via email to