bug 10550: check if the network is configured properly on the backend before vm creation

status 10550: resolved fixed
This commit is contained in:
alena 2011-09-02 16:58:55 -07:00
parent 3c0396bb20
commit 65194a0c20
1 changed files with 4 additions and 0 deletions

View File

@ -624,6 +624,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
protected Network getNetwork(Connection conn, NicTO nic) throws XenAPIException, XmlRpcException {
String[] tags = nic.getTags();
XsLocalNetwork network = getNativeNetworkForTraffic(conn, nic.getType(), tags != null && tags.length > 0 ? tags[0] : null);
if (network == null) {
s_logger.error("Network is not configured on the backend for nic " + nic.toString());
throw new CloudRuntimeException("Network for the backend is not configured correctly for network broadcast domain: " + nic.getBroadcastUri());
}
if (nic.getBroadcastUri() != null && nic.getBroadcastUri().toString().contains("untagged")) {
return network.getNetwork();
} else if (nic.getBroadcastType() == BroadcastDomainType.Vlan) {