Hi, In our MidoNet virtual networking plugin [1], we are planning to override the PublicNetworkGuru with our own version.
As far as I can see, no one has yet done this, so I'd like to sanity check our approach. *[Mechanism]* Create a MidonetPublicNetworkGuru, which extends the PublicNetworkGuru. At deploy time when using MidoNet, in components.xml, replace: <adapter name="PublicNetworkGuru" class="com.cloud.network.guru.PublicNetworkGuru"/> with: <adapter name="PublicNetworkGuru" class="MidonetPublicNetworkGuru"/> This will load the plugin's public network guru instead of the default one. This kind of override is necessary because the PublicNetworkGuru is hardcoded in ConfigurationServerImpl.createDefaultNetworks(): guruNames.put(TrafficType.Public, PublicNetworkGuru.class.getSimpleName()); *[Motivation]* Initially, we wanted the virtual network to be responsible only for incoming traffic which terminates at Guest VMs - traffic to Source NAT IPs, Static NAT IPs, Port Forwarding IPs etc. In order to do this, we would configure the next hop router (physical network) to route incoming traffic for the public IP blocks to the virtual network gateway. However, since CloudStack uses a single public IP pool for both System VMs and Guest VMs (Static NAT, Source NAT etc), we must send all incoming public IP traffic to the virtual network gateway. We then need a way to plug Public NICs into the virtual network in order to pass traffic to the System VMs; hence the need for overriding the PublicNetworkGuru. Hope that makes sense. Comments welcome. Thanks, Dave. [1] https://cwiki.apache.org/confluence/display/CLOUDSTACK/Midokura+Networking+Plugin