Skip to content

Commit da5fb50

Browse files
Edison SuEdison Su
authored andcommitted
put the default network as cloudbr0, if not specified
1 parent 5493880 commit da5fb50

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

‎agent/src/com/cloud/agent/resource/computing/LibvirtComputingResource.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,10 @@ private Pair<String, String> getPifs() {
724724
}
725725

726726
private boolean checkNetwork(String networkName) {
727+
if (networkName == null) {
728+
return true;
729+
}
730+
727731
String name = Script.runSimpleBashScript("brctl show | grep " + networkName + " | awk '{print $4}'");
728732
if (name == null) {
729733
return false;

‎server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,18 @@ public Map<? extends ServerResource, Map<String, String>> find(long dcId,
190190
} else {
191191
PhysicalNetworkSetupInfo network = networks.get(0);
192192
_kvmPublicNic = network.getPublicNetworkName();
193+
if (_kvmPublicNic == null) {
194+
_kvmPublicNic = "cloudbr0";
195+
}
193196
_kvmPrivateNic = network.getPrivateNetworkName();
197+
if (_kvmPrivateNic == null) {
198+
_kvmPrivateNic = _kvmPublicNic;
199+
}
194200
_kvmGuestNic = network.getGuestNetworkName();
201+
if (_kvmGuestNic == null) {
202+
_kvmGuestNic = _kvmPrivateNic;
203+
}
204+
195205
}
196206

197207
String parameters = " -m " + _hostIp + " -z " + dcId + " -p " + podId + " -c " + clusterId + " -g " + guid + " -a";

0 commit comments

Comments
 (0)