When cleaning up or setting ip associations the NiciraNvpElement should be ignored.

Implemented a generic ConnectivyProvider interface work around the dependency from server to nicira-plugin.
This commit is contained in:
Hugo Trippaers 2012-07-30 15:07:03 +02:00
parent 969b94e7db
commit 236f63fd34
3 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,21 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.network.element;
public interface ConnectivityProvider extends NetworkElement {
}

View File

@ -90,7 +90,7 @@ import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.NicDao;
@Local(value = NetworkElement.class)
public class NiciraNvpElement extends AdapterBase implements NetworkElement, NiciraNvpElementService, ResourceStateAdapter {
public class NiciraNvpElement extends AdapterBase implements ConnectivityProvider, NiciraNvpElementService, ResourceStateAdapter {
private static final Logger s_logger = Logger.getLogger(NiciraNvpElement.class);
private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();

View File

@ -126,6 +126,7 @@ import com.cloud.network.dao.PhysicalNetworkServiceProviderDao;
import com.cloud.network.dao.PhysicalNetworkServiceProviderVO;
import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao;
import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO;
import com.cloud.network.element.ConnectivityProvider;
import com.cloud.network.element.DhcpServiceProvider;
import com.cloud.network.element.FirewallServiceProvider;
import com.cloud.network.element.IpDeployer;
@ -913,6 +914,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
deployer = ((PortForwardingServiceProvider) element).getIpDeployer(network);
} else if (element instanceof RemoteAccessVPNServiceProvider) {
deployer = ((RemoteAccessVPNServiceProvider) element).getIpDeployer(network);
} else if (element instanceof ConnectivityProvider) {
// Nothing to do
s_logger.debug("ConnectivityProvider " + element.getClass().getSimpleName() + " has no ip associations");
continue;
} else {
throw new CloudRuntimeException("Fail to get ip deployer for element: " + element);
}