Search in sources :

Example 1 with OvsProviderVO

use of com.cloud.network.element.OvsProviderVO in project cloudstack by apache.

the class NetworkServiceImpl method addDefaultOvsToPhysicalNetwork.

private PhysicalNetworkServiceProvider addDefaultOvsToPhysicalNetwork(long physicalNetworkId) {
    PhysicalNetworkServiceProvider nsp = addProviderToPhysicalNetwork(physicalNetworkId, Network.Provider.Ovs.getName(), null, null);
    NetworkElement networkElement = _networkModel.getElementImplementingProvider(Network.Provider.Ovs.getName());
    if (networkElement == null) {
        throw new CloudRuntimeException("Unable to find the Network Element implementing the Ovs Provider");
    }
    OvsProviderVO element = _ovsProviderDao.findByNspId(nsp.getId());
    if (element != null) {
        s_logger.debug("There is already a Ovs element with service provider id " + nsp.getId());
        return nsp;
    }
    element = new OvsProviderVO(nsp.getId());
    _ovsProviderDao.persist(element);
    return nsp;
}
Also used : NetworkElement(com.cloud.network.element.NetworkElement) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) OvsProviderVO(com.cloud.network.element.OvsProviderVO)

Aggregations

NetworkElement (com.cloud.network.element.NetworkElement)1 OvsProviderVO (com.cloud.network.element.OvsProviderVO)1 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)1