echoidcf opened a new issue #4247:
URL: https://github.com/apache/cloudstack/issues/4247


   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete 
the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   VR
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master 
branch.
   -->
   
   ~~~
   All version is affected
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, 
advanced networking, etc.  N/A otherwise
   -->
   multiple public network like
   vlan 11, vlan 110, vlan 1100
   vmware
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   in this file
   
cloudstack/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
   
   <pre>
                   String publicNeworkName = 
HypervisorHostHelper.getPublicNetworkNamePrefix(vlanId);
                   Pair<Integer, VirtualDevice> publicNicInfo = 
vmMo.getNicDeviceIndex(publicNeworkName);
   </pre>
   You generate a public network name with a vlanId, and use this name to 
locate the nic device index.
   The problem is getPublicNetworkNamePrefix works like this
   <pre>
       public static String getPublicNetworkNamePrefix(String vlanId) {
           if (UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
               return "cloud.public.untagged";
           } else {
               return "cloud.public." + vlanId;
           }
       }
   </pre>
   And will return something like "cloud.public.11" if vlan id is 11
   getNicDeviceIndex only match the public network name with startWith which 
means this will match a network which vlan id is 111 or 110 or something like 
that.
   
   You should return something like "cloud.public.11." to be safe.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal 
test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   create multiple public network with vlan 11,110,1101 etc.
   and associate ip to vr.
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   should be normal
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   HIGH chance to associate ip to WRONG nic
   ~~~
   


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


Reply via email to