mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
tuna
This commit is contained in:
parent
3df8b912fc
commit
9f82757eb9
@ -247,14 +247,6 @@ public class OvsElement extends AdapterBase implements NetworkElement,
|
|||||||
// L2 Support : SDN provisioning
|
// L2 Support : SDN provisioning
|
||||||
capabilities.put(Service.Connectivity, null);
|
capabilities.put(Service.Connectivity, null);
|
||||||
|
|
||||||
// L3 Support : SourceNat
|
|
||||||
// Map<Capability, String> sourceNatCapabilities = new
|
|
||||||
// HashMap<Capability, String>();
|
|
||||||
// sourceNatCapabilities.put(Capability.SupportedSourceNatTypes,
|
|
||||||
// "peraccount");
|
|
||||||
// sourceNatCapabilities.put(Capability.RedundantRouter, "false");
|
|
||||||
// capabilities.put(Service.SourceNat, sourceNatCapabilities);
|
|
||||||
|
|
||||||
// L3 Support : Port Forwarding
|
// L3 Support : Port Forwarding
|
||||||
capabilities.put(Service.PortForwarding, null);
|
capabilities.put(Service.PortForwarding, null);
|
||||||
|
|
||||||
|
|||||||
@ -81,29 +81,28 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
ScheduledExecutorService _executorPool;
|
ScheduledExecutorService _executorPool;
|
||||||
ScheduledExecutorService _cleanupExecutor;
|
ScheduledExecutorService _cleanupExecutor;
|
||||||
|
|
||||||
@Inject ConfigurationDao _configDao;
|
@Inject
|
||||||
@Inject NicDao _nicDao;
|
ConfigurationDao _configDao;
|
||||||
@Inject HostDao _hostDao;
|
@Inject
|
||||||
@Inject PhysicalNetworkTrafficTypeDao _physNetTTDao;
|
NicDao _nicDao;
|
||||||
@Inject UserVmDao _userVmDao;
|
@Inject
|
||||||
@Inject DomainRouterDao _routerDao;
|
HostDao _hostDao;
|
||||||
@Inject OvsTunnelNetworkDao _tunnelNetworkDao;
|
@Inject
|
||||||
@Inject OvsTunnelInterfaceDao _tunnelInterfaceDao;
|
PhysicalNetworkTrafficTypeDao _physNetTTDao;
|
||||||
@Inject AgentManager _agentMgr;
|
@Inject
|
||||||
|
UserVmDao _userVmDao;
|
||||||
|
@Inject
|
||||||
|
DomainRouterDao _routerDao;
|
||||||
|
@Inject
|
||||||
|
OvsTunnelNetworkDao _tunnelNetworkDao;
|
||||||
|
@Inject
|
||||||
|
OvsTunnelInterfaceDao _tunnelInterfaceDao;
|
||||||
|
@Inject
|
||||||
|
AgentManager _agentMgr;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params)
|
public boolean configure(String name, Map<String, Object> params)
|
||||||
throws ConfigurationException {
|
throws ConfigurationException {
|
||||||
// _isEnabled =
|
|
||||||
// Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
|
|
||||||
//
|
|
||||||
// if (_isEnabled) {
|
|
||||||
// _executorPool = Executors.newScheduledThreadPool(10, new
|
|
||||||
// NamedThreadFactory("OVS"));
|
|
||||||
// _cleanupExecutor = Executors.newScheduledThreadPool(1, new
|
|
||||||
// NamedThreadFactory("OVS-Cleanup"));
|
|
||||||
// }
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,8 +111,8 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
OvsTunnelNetworkVO ta = null;
|
OvsTunnelNetworkVO ta = null;
|
||||||
try {
|
try {
|
||||||
ta = new OvsTunnelNetworkVO(from, to, key, networkId);
|
ta = new OvsTunnelNetworkVO(from, to, key, networkId);
|
||||||
OvsTunnelNetworkVO lock =
|
OvsTunnelNetworkVO lock = _tunnelNetworkDao.acquireInLockTable(Long
|
||||||
_tunnelNetworkDao.acquireInLockTable(Long.valueOf(1));
|
.valueOf(1));
|
||||||
if (lock == null) {
|
if (lock == null) {
|
||||||
s_logger.warn("Cannot lock table ovs_tunnel_account");
|
s_logger.warn("Cannot lock table ovs_tunnel_account");
|
||||||
return null;
|
return null;
|
||||||
@ -121,21 +120,21 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
_tunnelNetworkDao.persist(ta);
|
_tunnelNetworkDao.persist(ta);
|
||||||
_tunnelNetworkDao.releaseFromLockTable(lock.getId());
|
_tunnelNetworkDao.releaseFromLockTable(lock.getId());
|
||||||
} catch (EntityExistsException e) {
|
} catch (EntityExistsException e) {
|
||||||
s_logger.debug("A record for the tunnel from " + from +
|
s_logger.debug("A record for the tunnel from " + from + " to " + to
|
||||||
" to " + to + " already exists");
|
+ " already exists");
|
||||||
}
|
}
|
||||||
return ta;
|
return ta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@DB
|
@DB
|
||||||
protected OvsTunnelInterfaceVO createInterfaceRecord(String ip,
|
protected OvsTunnelInterfaceVO createInterfaceRecord(String ip,
|
||||||
String netmask,String mac,long hostId, String label) {
|
String netmask, String mac, long hostId, String label) {
|
||||||
OvsTunnelInterfaceVO ti = null;
|
OvsTunnelInterfaceVO ti = null;
|
||||||
try {
|
try {
|
||||||
ti = new OvsTunnelInterfaceVO(ip, netmask, mac, hostId, label);
|
ti = new OvsTunnelInterfaceVO(ip, netmask, mac, hostId, label);
|
||||||
//TODO: Is locking really necessary here?
|
// TODO: Is locking really necessary here?
|
||||||
OvsTunnelInterfaceVO lock =
|
OvsTunnelInterfaceVO lock = _tunnelInterfaceDao
|
||||||
_tunnelInterfaceDao.acquireInLockTable(Long.valueOf(1));
|
.acquireInLockTable(Long.valueOf(1));
|
||||||
if (lock == null) {
|
if (lock == null) {
|
||||||
s_logger.warn("Cannot lock table ovs_tunnel_account");
|
s_logger.warn("Cannot lock table ovs_tunnel_account");
|
||||||
return null;
|
return null;
|
||||||
@ -143,26 +142,24 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
_tunnelInterfaceDao.persist(ti);
|
_tunnelInterfaceDao.persist(ti);
|
||||||
_tunnelInterfaceDao.releaseFromLockTable(lock.getId());
|
_tunnelInterfaceDao.releaseFromLockTable(lock.getId());
|
||||||
} catch (EntityExistsException e) {
|
} catch (EntityExistsException e) {
|
||||||
s_logger.debug("A record for the interface for network " + label +
|
s_logger.debug("A record for the interface for network " + label
|
||||||
" on host id " + hostId + " already exists");
|
+ " on host id " + hostId + " already exists");
|
||||||
}
|
}
|
||||||
return ti;
|
return ti;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String handleFetchInterfaceAnswer(Answer[] answers, Long hostId){
|
private String handleFetchInterfaceAnswer(Answer[] answers, Long hostId) {
|
||||||
OvsFetchInterfaceAnswer ans = (OvsFetchInterfaceAnswer) answers[0];
|
OvsFetchInterfaceAnswer ans = (OvsFetchInterfaceAnswer) answers[0];
|
||||||
if (ans.getResult()) {
|
if (ans.getResult()) {
|
||||||
if (ans.getIp() != null &&
|
if (ans.getIp() != null && !("".equals(ans.getIp()))) {
|
||||||
!("".equals(ans.getIp()))) {
|
OvsTunnelInterfaceVO ti = createInterfaceRecord(ans.getIp(),
|
||||||
OvsTunnelInterfaceVO ti =
|
ans.getNetmask(), ans.getMac(), hostId, ans.getLabel());
|
||||||
createInterfaceRecord(ans.getIp(), ans.getNetmask(),
|
|
||||||
ans.getMac(), hostId, ans.getLabel());
|
|
||||||
return ti.getIp();
|
return ti.getIp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fetch interface failed!
|
// Fetch interface failed!
|
||||||
s_logger.warn("Unable to fetch the IP address for the GRE tunnel endpoint" +
|
s_logger.warn("Unable to fetch the IP address for the GRE tunnel endpoint"
|
||||||
ans.getDetails());
|
+ ans.getDetails());
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,19 +238,18 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
}
|
}
|
||||||
if (!r.getResult()) {
|
if (!r.getResult()) {
|
||||||
tunnel.setState("FAILED");
|
tunnel.setState("FAILED");
|
||||||
s_logger.warn("Create GRE tunnel failed due to " +
|
s_logger.warn("Create GRE tunnel failed due to " + r.getDetails()
|
||||||
r.getDetails() + s);
|
+ s);
|
||||||
} else {
|
} else {
|
||||||
tunnel.setState("SUCCESS");
|
tunnel.setState("SUCCESS");
|
||||||
tunnel.setPortName(r.getInPortName());
|
tunnel.setPortName(r.getInPortName());
|
||||||
s_logger.warn("Create GRE tunnel " +
|
s_logger.warn("Create GRE tunnel " + r.getDetails() + s);
|
||||||
r.getDetails() + s);
|
|
||||||
}
|
}
|
||||||
_tunnelNetworkDao.update(tunnel.getId(), tunnel);
|
_tunnelNetworkDao.update(tunnel.getId(), tunnel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getGreEndpointIP(Host host, Network nw) throws
|
private String getGreEndpointIP(Host host, Network nw)
|
||||||
AgentUnavailableException, OperationTimedoutException {
|
throws AgentUnavailableException, OperationTimedoutException {
|
||||||
String endpointIp = null;
|
String endpointIp = null;
|
||||||
// Fetch fefault name for network label from configuration
|
// Fetch fefault name for network label from configuration
|
||||||
String physNetLabel = _configDao.getValue(Config.OvsTunnelNetworkDefaultLabel.key());
|
String physNetLabel = _configDao.getValue(Config.OvsTunnelNetworkDefaultLabel.key());
|
||||||
@ -317,12 +313,12 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
key = Integer.valueOf(keyStr);
|
key = Integer.valueOf(keyStr);
|
||||||
return key;
|
return key;
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
s_logger.debug("Well well, how did '" + key +
|
s_logger.debug("Well well, how did '" + key
|
||||||
"' end up in the broadcast URI for the network?");
|
+ "' end up in the broadcast URI for the network?");
|
||||||
throw new CloudRuntimeException(
|
throw new CloudRuntimeException(String.format(
|
||||||
String.format("Invalid GRE key parsed from" +
|
"Invalid GRE key parsed from"
|
||||||
"network broadcast URI (%s)",
|
+ "network broadcast URI (%s)", network
|
||||||
network.getBroadcastUri().toString()));
|
.getBroadcastUri().toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,8 +328,8 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
s_logger.debug("Creating tunnels with OVS tunnel manager");
|
s_logger.debug("Creating tunnels with OVS tunnel manager");
|
||||||
if (instance.getType() != VirtualMachine.Type.User
|
if (instance.getType() != VirtualMachine.Type.User
|
||||||
&& instance.getType() != VirtualMachine.Type.DomainRouter) {
|
&& instance.getType() != VirtualMachine.Type.DomainRouter) {
|
||||||
s_logger.debug("Will not work if you're not" +
|
s_logger.debug("Will not work if you're not"
|
||||||
"an instance or a virtual router");
|
+ "an instance or a virtual router");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,11 +337,11 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
int key = getGreKey(nw);
|
int key = getGreKey(nw);
|
||||||
// Find active VMs with a NIC on the target network
|
// Find active VMs with a NIC on the target network
|
||||||
List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(nw.getId(),
|
List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(nw.getId(),
|
||||||
State.Running, State.Starting,
|
State.Running, State.Starting, State.Stopping, State.Unknown,
|
||||||
State.Stopping, State.Unknown, State.Migrating);
|
State.Migrating);
|
||||||
// Find routers for the network
|
// Find routers for the network
|
||||||
List<DomainRouterVO> routers = _routerDao.findByNetwork(nw.getId());
|
List<DomainRouterVO> routers = _routerDao.findByNetwork(nw.getId());
|
||||||
List<VMInstanceVO>ins = new ArrayList<VMInstanceVO>();
|
List<VMInstanceVO> ins = new ArrayList<VMInstanceVO>();
|
||||||
if (vms != null) {
|
if (vms != null) {
|
||||||
ins.addAll(vms);
|
ins.addAll(vms);
|
||||||
}
|
}
|
||||||
@ -396,14 +392,15 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
HostVO rHost = _hostDao.findById(i);
|
HostVO rHost = _hostDao.findById(i);
|
||||||
String otherIp = getGreEndpointIP(rHost, nw);
|
String otherIp = getGreEndpointIP(rHost, nw);
|
||||||
if (otherIp == null)
|
if (otherIp == null)
|
||||||
throw new GreTunnelException("Unable to retrieve the remote " +
|
throw new GreTunnelException(
|
||||||
"endpoint for the GRE tunnel." +
|
"Unable to retrieve the remote "
|
||||||
"Failure is on host:" + rHost.getId());
|
+ "endpoint for the GRE tunnel."
|
||||||
|
+ "Failure is on host:" + rHost.getId());
|
||||||
Commands cmds = new Commands(
|
Commands cmds = new Commands(
|
||||||
new OvsCreateTunnelCommand(otherIp, key,
|
new OvsCreateTunnelCommand(otherIp, key,
|
||||||
Long.valueOf(hostId), i, nw.getId(), myIp));
|
Long.valueOf(hostId), i, nw.getId(), myIp));
|
||||||
s_logger.debug("Ask host " + hostId +
|
s_logger.debug("Ask host " + hostId
|
||||||
" to create gre tunnel to " + i);
|
+ " to create gre tunnel to " + i);
|
||||||
Answer[] answers = _agentMgr.send(hostId, cmds);
|
Answer[] answers = _agentMgr.send(hostId, cmds);
|
||||||
handleCreateTunnelAnswer(answers);
|
handleCreateTunnelAnswer(answers);
|
||||||
noHost = false;
|
noHost = false;
|
||||||
@ -412,23 +409,22 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
|
|||||||
for (Long i : fromHostIds) {
|
for (Long i : fromHostIds) {
|
||||||
HostVO rHost = _hostDao.findById(i);
|
HostVO rHost = _hostDao.findById(i);
|
||||||
String otherIp = getGreEndpointIP(rHost, nw);
|
String otherIp = getGreEndpointIP(rHost, nw);
|
||||||
Commands cmds = new Commands(
|
Commands cmds = new Commands(new OvsCreateTunnelCommand(myIp,
|
||||||
new OvsCreateTunnelCommand(myIp, key, i,
|
key, i, Long.valueOf(hostId), nw.getId(), otherIp));
|
||||||
Long.valueOf(hostId),
|
s_logger.debug("Ask host " + i + " to create gre tunnel to "
|
||||||
nw.getId(), otherIp));
|
+ hostId);
|
||||||
s_logger.debug("Ask host " + i +
|
|
||||||
" to create gre tunnel to " + hostId);
|
|
||||||
Answer[] answers = _agentMgr.send(i, cmds);
|
Answer[] answers = _agentMgr.send(i, cmds);
|
||||||
handleCreateTunnelAnswer(answers);
|
handleCreateTunnelAnswer(answers);
|
||||||
noHost = false;
|
noHost = false;
|
||||||
}
|
}
|
||||||
// If no tunnels have been configured, perform the bridge setup anyway
|
// If no tunnels have been configured, perform the bridge setup
|
||||||
|
// anyway
|
||||||
// This will ensure VIF rules will be triggered
|
// This will ensure VIF rules will be triggered
|
||||||
if (noHost) {
|
if (noHost) {
|
||||||
Commands cmds = new Commands(
|
Commands cmds = new Commands(new OvsSetupBridgeCommand(key,
|
||||||
new OvsSetupBridgeCommand(key, hostId, nw.getId()));
|
hostId, nw.getId()));
|
||||||
s_logger.debug("Ask host " + hostId +
|
s_logger.debug("Ask host " + hostId
|
||||||
" to configure bridge for network:" + nw.getId());
|
+ " to configure bridge for network:" + nw.getId());
|
||||||
Answer[] answers = _agentMgr.send(hostId, cmds);
|
Answer[] answers = _agentMgr.send(hostId, cmds);
|
||||||
handleSetupBridgeAnswer(answers);
|
handleSetupBridgeAnswer(answers);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -295,14 +295,6 @@ public enum Config {
|
|||||||
"false",
|
"false",
|
||||||
"Direct Network Dhcp Server should not send a default route",
|
"Direct Network Dhcp Server should not send a default route",
|
||||||
"true/false"),
|
"true/false"),
|
||||||
OvsTunnelNetwork(
|
|
||||||
"Network",
|
|
||||||
ManagementServer.class,
|
|
||||||
Boolean.class,
|
|
||||||
"sdn.ovs.controller",
|
|
||||||
"false",
|
|
||||||
"Enable/Disable Open vSwitch SDN controller for L2-in-L3 overlay networks",
|
|
||||||
null),
|
|
||||||
OvsTunnelNetworkDefaultLabel(
|
OvsTunnelNetworkDefaultLabel(
|
||||||
"Network",
|
"Network",
|
||||||
ManagementServer.class,
|
ManagementServer.class,
|
||||||
|
|||||||
@ -435,13 +435,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
|
|||||||
if (oldElement instanceof IpDeployingRequester && newElement instanceof IpDeployingRequester) {
|
if (oldElement instanceof IpDeployingRequester && newElement instanceof IpDeployingRequester) {
|
||||||
IpDeployer oldIpDeployer = ((IpDeployingRequester)oldElement).getIpDeployer(network);
|
IpDeployer oldIpDeployer = ((IpDeployingRequester)oldElement).getIpDeployer(network);
|
||||||
IpDeployer newIpDeployer = ((IpDeployingRequester)newElement).getIpDeployer(network);
|
IpDeployer newIpDeployer = ((IpDeployingRequester)newElement).getIpDeployer(network);
|
||||||
// if
|
// FIXME: I ignored this check
|
||||||
// (!oldIpDeployer.getProvider().getName().equals(newIpDeployer.getProvider().getName()))
|
|
||||||
// {
|
|
||||||
// throw new
|
|
||||||
// InvalidParameterException("There would be multiple providers for IP "
|
|
||||||
// + publicIp.getAddress() + "!");
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidParameterException("Ip cannot be applied for new provider!");
|
throw new InvalidParameterException("Ip cannot be applied for new provider!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -993,18 +993,6 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean verifyServicesCombination(Set<Service> services) {
|
public boolean verifyServicesCombination(Set<Service> services) {
|
||||||
// if (!services.contains(Service.SourceNat)) {
|
|
||||||
// if (services.contains(Service.StaticNat) || services.contains(Service.Firewall) || services.contains(Service.Lb) ||
|
|
||||||
// services.contains(Service.PortForwarding) || services.contains(Service.Vpn)) {
|
|
||||||
// String servicesList = "[";
|
|
||||||
// for (Service service : services) {
|
|
||||||
// servicesList += service.getName() + " ";
|
|
||||||
// }
|
|
||||||
// servicesList += "]";
|
|
||||||
// s_logger.warn("Virtual router can't enable services " + servicesList + " without source NAT service");
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -99,9 +99,11 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||||||
@Override
|
@Override
|
||||||
public Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner) {
|
public Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner) {
|
||||||
|
|
||||||
if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) {
|
// if
|
||||||
return null;
|
// (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())))
|
||||||
}
|
// {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
|
||||||
NetworkVO config = (NetworkVO)super.design(offering, plan, userSpecified, owner);
|
NetworkVO config = (NetworkVO)super.design(offering, plan, userSpecified, owner);
|
||||||
if (config == null) {
|
if (config == null) {
|
||||||
@ -119,9 +121,11 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||||||
throws InsufficientVirtualNetworkCapcityException {
|
throws InsufficientVirtualNetworkCapcityException {
|
||||||
assert (config.getState() == State.Implementing) : "Why are we implementing " + config;
|
assert (config.getState() == State.Implementing) : "Why are we implementing " + config;
|
||||||
|
|
||||||
if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) {
|
// if
|
||||||
return null;
|
// (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())))
|
||||||
}
|
// {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
|
||||||
if (!_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) {
|
if (!_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) {
|
||||||
return super.implement(config, offering, dest, context);
|
return super.implement(config, offering, dest, context);
|
||||||
@ -225,10 +229,11 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||||||
|
|
||||||
NicProfile profile = super.allocate(config, nic, vm);
|
NicProfile profile = super.allocate(config, nic, vm);
|
||||||
|
|
||||||
boolean _isEnabled = Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
|
// boolean _isEnabled =
|
||||||
if (_isEnabled) {
|
// Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
|
||||||
return null;
|
// if (_isEnabled) {
|
||||||
}
|
// return null;
|
||||||
|
// }
|
||||||
|
|
||||||
if (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) {
|
if (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) {
|
||||||
profile.setStrategy(ReservationStrategy.Start);
|
profile.setStrategy(ReservationStrategy.Start);
|
||||||
@ -246,9 +251,11 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||||||
public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) {
|
public void deallocate(Network config, NicProfile nic, VirtualMachineProfile vm) {
|
||||||
super.deallocate(config, nic, vm);
|
super.deallocate(config, nic, vm);
|
||||||
|
|
||||||
if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) {
|
// if
|
||||||
return;
|
// (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())))
|
||||||
}
|
// {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
if (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) {
|
if (_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) {
|
||||||
nic.setIp4Address(null);
|
nic.setIp4Address(null);
|
||||||
@ -263,10 +270,11 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||||||
public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
|
public void reserve(NicProfile nic, Network config, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
|
||||||
throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException {
|
throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException {
|
||||||
assert (nic.getReservationStrategy() == ReservationStrategy.Start) : "What can I do for nics that are not allocated at start? ";
|
assert (nic.getReservationStrategy() == ReservationStrategy.Start) : "What can I do for nics that are not allocated at start? ";
|
||||||
boolean _isEnabled = Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
|
// boolean _isEnabled =
|
||||||
if (_isEnabled) {
|
// Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()));
|
||||||
return;
|
// if (_isEnabled) {
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
DataCenter dc = _dcDao.findById(config.getDataCenterId());
|
DataCenter dc = _dcDao.findById(config.getDataCenterId());
|
||||||
|
|
||||||
@ -299,9 +307,11 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
|
|||||||
@Override
|
@Override
|
||||||
public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) {
|
public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId) {
|
||||||
|
|
||||||
if (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key()))) {
|
// if
|
||||||
return true;
|
// (Boolean.parseBoolean(_configDao.getValue(Config.OvsTunnelNetwork.key())))
|
||||||
}
|
// {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
NetworkVO network = _networkDao.findById(nic.getNetworkId());
|
NetworkVO network = _networkDao.findById(nic.getNetworkId());
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user