bug 13845: as you can't add physical devices name from UI when you create zone, use kvm.{guest|public|private}.devices in the global configuration.

status 13845: resolved fixed
Reviewed-by: frank
This commit is contained in:
Edison Su 2012-02-17 13:17:51 -08:00
parent 9ea214062c
commit fe18cd5d7e
1 changed files with 10 additions and 14 deletions

View File

@ -183,25 +183,21 @@ public class KvmServerDiscoverer extends DiscovererBase implements Discoverer,
List<PhysicalNetworkSetupInfo> networks = _networkMgr.getPhysicalNetworkInfo(dcId, HypervisorType.KVM);
if (networks.size() < 1) {
_kvmPublicNic = "cloudbr0";
_kvmPrivateNic = "cloudbr0";
_kvmGuestNic = "cloudbr0";
s_logger.debug("Can't find physical network devices on zone: " + dcId + ", use the default cloudbr0");
s_logger.debug("Can't find physical network devices on zone: " + dcId + ", use the default from kvm.{private|public|guest}.devices");
} else {
PhysicalNetworkSetupInfo network = networks.get(0);
_kvmPublicNic = network.getPublicNetworkName();
if (_kvmPublicNic == null) {
_kvmPublicNic = "cloudbr0";
String pubNetName = network.getPublicNetworkName();
if (pubNetName != null) {
_kvmPublicNic = pubNetName;
}
_kvmPrivateNic = network.getPrivateNetworkName();
if (_kvmPrivateNic == null) {
_kvmPrivateNic = _kvmPublicNic;
String prvNetName = network.getPrivateNetworkName();
if (prvNetName != null) {
_kvmPrivateNic = prvNetName;
}
_kvmGuestNic = network.getGuestNetworkName();
if (_kvmGuestNic == null) {
_kvmGuestNic = _kvmPrivateNic;
String guestNetName = network.getGuestNetworkName();
if (guestNetName != null) {
_kvmGuestNic = guestNetName;
}
}
String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId + " -c " + clusterId + " -g " + guid + " -a";