Hi,

While testing the 4.0.0 artifact before voting I ran into CLOUDSTACK-316 which I just created.

Remember this:
* I used the WebUI with the wizard for adding a zone
* This UI ONLY lets you set Management and Guest labels
* Management was set to vlanbr670
* Guest was set to vlanbr672

I think QA didn't see this one since they test with cloudbr0 in their setup? Which I don't have!

Now I'd like to get some feedback on a potential fix I have:

When looking at KvmServerDiscoverer.java I see:

_kvmPrivateNic = _configDao.getValue(Config.KvmPrivateNetwork.key());
if (_kvmPrivateNic == null) {
        _kvmPrivateNic = "cloudbr0";
}
                
_kvmPublicNic = _configDao.getValue(Config.KvmPublicNetwork.key());
if (_kvmPublicNic == null) {
        _kvmPublicNic = _kvmPrivateNic;
}
                
_kvmGuestNic = _configDao.getValue(Config.KvmGuestNetwork.key());
if (_kvmGuestNic == null) {
        _kvmGuestNic = _kvmPrivateNic;
}

This is legacy code since these traffic labels were removed from the global configuration and moved to the network.

This however results in _kvmPrivateNic being set to "cloudbr0".

Looking further you'll find:

String kvmPrivateNic = _kvmPrivateNic;
String kvmPublicNic = _kvmPublicNic;
String kvmGuestNic = _kvmGuestNic;

for (PhysicalNetworkSetupInfo info : netInfos) {
        if (info.getPrivateNetworkName() != null) {
                kvmPrivateNic = info.getPrivateNetworkName();
        }
        if (info.getPublicNetworkName() != null) {
                kvmPublicNic = info.getPublicNetworkName();
        }
        if (info.getGuestNetworkName() != null) {
                kvmGuestNic = info.getGuestNetworkName();
        }
}

In this case getPublicNetworkName() returns null since it is not set and this leads to kvmPublicNic being set to "cloudbr0" as done by in the code I posted above.

This seems to be a mix of Legacy code (searching for traffic labels in global config) and not setting the public nic to the correct value later on.

My suggestion would be to:
* Have the UI always set the public network
* Default public network to guest network if not set

I think the solution would be a mix of both, but I just wanted to check this first before changing it.

I'd like to have a suggestion before changing this.

Wido

Reply via email to