weizhouapache commented on PR #8988:
URL: https://github.com/apache/cloudstack/pull/8988#issuecomment-2079265875

   @rohityadavcloud 
   I copied the code and run it locally
   
   - on mgmt server (with only 1 interface), the `macAddressInLong` value is 
same as previous legacy code. that is good
   
   ```
   macAddressInLong = 32989023043991
   
   mysql> select msid from mshost where state='Up';
   +----------------+
   | msid           |
   +----------------+
   | 32989023043991 |
   +----------------+
   1 row in set (0.00 sec)
   
   ```
   
   
   - run it on kvm host
   
   ```
   network.getName() = vnet125
   network.getName() = vnet150
   network.getName() = vnet110
   network.getName() = vnet127
   network.getName() = vnet111
   network.getName() = vnet124
   network.getName() = vnet148
   network.getName() = vnet78
   network.getName() = vnet145
   network.getName() = vnet118
   network.getName() = vnet122
   network.getName() = vnet116
   network.getName() = vnet147
   network.getName() = vnet117
   network.getName() = vnet123
   network.getName() = vnet80
   network.getName() = vnet79
   network.getName() = vnet146
   network.getName() = vnet149
   network.getName() = vnet112
   network.getName() = vnet126
   network.getName() = vnet131
   network.getName() = cloud0
   network.getName() = cloudbr1
   network.getName() = cloudbr0
   network.getName() = lo
   ```
   
   
   my suggestion is
   - reverse the elements in the return of 
`NetworkInterface.getNetworkInterfaces`
   - ignore `lo` interface, so the code will get the mac address of the first 
non-loopback 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to