put the default network as cloudbr0, if not specified

This commit is contained in:
Edison Su 2011-12-15 17:06:17 -08:00
parent 5493880b37
commit da5fb5097c
2 changed files with 14 additions and 0 deletions

View File

@ -724,6 +724,10 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
}
private boolean checkNetwork(String networkName) {
if (networkName == null) {
return true;
}
String name = Script.runSimpleBashScript("brctl show | grep " + networkName + " | awk '{print $4}'");
if (name == null) {
return false;

View File

@ -190,8 +190,18 @@ public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
} else {
PhysicalNetworkSetupInfo network = networks.get(0);
_kvmPublicNic = network.getPublicNetworkName();
if (_kvmPublicNic == null) {
_kvmPublicNic = "cloudbr0";
}
_kvmPrivateNic = network.getPrivateNetworkName();
if (_kvmPrivateNic == null) {
_kvmPrivateNic = _kvmPublicNic;
}
_kvmGuestNic = network.getGuestNetworkName();
if (_kvmGuestNic == null) {
_kvmGuestNic = _kvmPrivateNic;
}
}
String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId + " -c " + clusterId + " -g " + guid + " -a";