svenvogel commented on issue #2304: CLOUDSTACK-10127: KVM + Ovs: Incorrect 
devId on static nat
URL: https://github.com/apache/cloudstack/pull/2304#issuecomment-343768330
 
 
   Hi @fmaximus,  Hi @rhtyd 
   
   we tried to add this fix to 4.10 and build new rpms but it seems that the 
fix dont work. i think there are not so much changes to 4.10. we added you 
commit in our repo. 
   
   `[root@csmgmt02 resource]# find . -iname libvirtco* -ls
   17608816    4 -rw-r--r--   1 root     root         3710 Nov 12 19:31 
./wrapper/LibvirtConsoleProxyLoadCommandWrapper.class
   18182547    8 -rw-r--r--   1 root     root         5786 Nov 12 19:31 
./wrapper/LibvirtCopyVolumeCommandWrapper.class
   1006374    4 -rw-r--r--   1 root     root         2260 Nov 12 19:31 
./LibvirtComputingResource$KeyValueInterpreter.class
   1006375    4 -rw-r--r--   1 root     root         1357 Nov 12 19:31 
./LibvirtComputingResource$BridgeType.class
   1006376    4 -rw-r--r--   1 root     root         1439 Nov 12 19:31 
./LibvirtComputingResource$1.class
   1006377    4 -rw-r--r--   1 root     root         1192 Nov 12 19:31 
./LibvirtComputingResource$VmStats.class
   1006378    4 -rw-r--r--   1 root     root          963 Nov 12 19:31 
./LibvirtComputingResource$2.class
   1006379  120 -rw-r--r--   1 root     root       120820 Nov 12 19:31 
./LibvirtComputingResource.class
   1006404    4 -rw-r--r--   1 root     root         3679 Nov 12 19:31 
./LibvirtConnection.class`
   
   there are new class files.  we added
   `import java.util.EnumMap;`
   
   `        try {
               conn = 
getLibvirtUtilitiesHelper().getConnectionByVmName(routerName);
               final IpAddressTO[] ips = cmd.getIpAddresses();
               Integer devNum = 0;
               final Map<TrafficType, Integer> trafficTypeToNicNum = new 
EnumMap<>(TrafficType.class);
               final List<InterfaceDef> pluggedNics = getInterfaces(conn, 
routerName);
   
               for (final InterfaceDef pluggedNic : pluggedNics) {
                   final String pluggedVlan = pluggedNic.getBrName();
                   if (pluggedVlan.equalsIgnoreCase(_linkLocalBridgeName)) {
                       trafficTypeToNicNum.put(TrafficType.Control, devNum);
                   } else if (pluggedVlan.equalsIgnoreCase(_publicBridgeName)) {
                       trafficTypeToNicNum.put(TrafficType.Public, devNum);
                   } else if (pluggedVlan.equalsIgnoreCase(_privBridgeName)) {
                       trafficTypeToNicNum.put(TrafficType.Management, devNum);
                   } else if (pluggedVlan.equalsIgnoreCase(_guestBridgeName)) {
                       trafficTypeToNicNum.put(TrafficType.Guest, devNum);
                   }
                   devNum++;
               }
   
               for (final IpAddressTO ip : ips) {
                   ip.setNicDevId(trafficTypeToNicNum.get(ip.getTrafficType()));
               }`
   
   after new deployment of a vpc we added a static nat
   
   root@r-40-VM:~# ip a
   1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
       link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
       inet 127.0.0.1/8 scope host lo
   2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
       link/ether 0e:00:a9:fe:01:23 brd ff:ff:ff:ff:ff:ff
       inet 169.254.1.35/16 brd 169.254.255.255 scope global eth0
   3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
       link/ether 1e:00:7b:00:00:70 brd ff:ff:ff:ff:ff:ff
       inet 146.0.122.142/26 brd 146.0.122.191 scope global eth1
   4: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state 
UP qlen 1000
       link/ether 02:00:3c:6c:00:02 brd ff:ff:ff:ff:ff:ff
       inet 192.168.1.254/24 brd 192.168.1.255 scope global eth2
       **inet 146.0.122.143/26 brd 146.0.122.191 scope global eth2**
   
   result, public ip is on the internal network.
   
   is there something we miss or wrong?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to