use of com.cloud.agent.api.ConfigureSharedNetworkVlanIdCommand in project cloudstack by apache.
the class NiciraNvpElement method sharedNetworkSupportNumericalVlanId.
private boolean sharedNetworkSupportNumericalVlanId(Network network, String lSwitchUuid, String ownerName, HostVO niciraNvpHost) {
List<VlanVO> networkVlans = vlanDao.listVlansByNetworkId(network.getId());
if (networkVlans.size() == 1) {
for (VlanVO vlanVO : networkVlans) {
long vlanId = Long.parseLong(vlanVO.getVlanTag());
String l2GatewayServiceUuid = niciraNvpHost.getDetail("l2gatewayserviceuuid");
if (l2GatewayServiceUuid == null) {
throw new CloudRuntimeException("No L2 Gateway Service Uuid found on " + niciraNvpHost.getName());
}
ConfigureSharedNetworkVlanIdCommand cmd = new ConfigureSharedNetworkVlanIdCommand(lSwitchUuid, l2GatewayServiceUuid, vlanId, ownerName, network.getId());
ConfigureSharedNetworkVlanIdAnswer answer = (ConfigureSharedNetworkVlanIdAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmd);
if (answer.getResult() == false) {
s_logger.error("Failed to configure Shared network " + network.getDisplayText());
return false;
}
}
}
return true;
}
Aggregations