mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Tungsten: fix functional issues (#7173)
Co-authored-by: dahn <daan.hoogland@gmail.com>
This commit is contained in:
parent
a3feccf70c
commit
8ef35466de
@ -100,6 +100,9 @@ public interface NetworkOrchestrationService {
|
||||
ConfigKey<Boolean> RollingRestartEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class, "network.rolling.restart", "true",
|
||||
"Whether to allow or deny rolling restart of network routers.", true);
|
||||
|
||||
static final ConfigKey<Boolean> TUNGSTEN_ENABLED = new ConfigKey<>(Boolean.class, "tungsten.plugin.enable", "Advanced", "false",
|
||||
"Indicates whether to enable the Tungsten plugin", false, ConfigKey.Scope.Zone, null);
|
||||
|
||||
List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault)
|
||||
throws ConcurrentOperationException;
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ import com.cloud.configuration.Config;
|
||||
import com.cloud.utils.NumbersUtil;
|
||||
import org.apache.cloudstack.agent.lb.IndirectAgentLB;
|
||||
import org.apache.cloudstack.ca.CAManager;
|
||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
import org.apache.cloudstack.framework.config.Configurable;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
@ -1783,6 +1784,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put(Config.RouterAggregationCommandEachTimeout.toString(), _configDao.getValue(Config.RouterAggregationCommandEachTimeout.toString()));
|
||||
params.put(Config.MigrateWait.toString(), _configDao.getValue(Config.MigrateWait.toString()));
|
||||
params.put(NetworkOrchestrationService.TUNGSTEN_ENABLED.key(), String.valueOf(NetworkOrchestrationService.TUNGSTEN_ENABLED.valueIn(host.getDataCenterId())));
|
||||
|
||||
try {
|
||||
SetHostParamsCommand cmds = new SetHostParamsCommand(params);
|
||||
|
||||
@ -4648,6 +4648,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
|
||||
public ConfigKey<?>[] getConfigKeys() {
|
||||
return new ConfigKey<?>[]{NetworkGcWait, NetworkGcInterval, NetworkLockTimeout,
|
||||
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
|
||||
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled};
|
||||
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled,
|
||||
TUNGSTEN_ENABLED };
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants.IoDriverPolicy;
|
||||
import org.apache.cloudstack.network.tungsten.service.TungstenService;
|
||||
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
|
||||
import org.apache.cloudstack.storage.configdrive.ConfigDrive;
|
||||
import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
|
||||
import org.apache.cloudstack.storage.to.TemplateObjectTO;
|
||||
@ -462,6 +462,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
|
||||
protected LibvirtDomainXMLParser parser = new LibvirtDomainXMLParser();
|
||||
|
||||
private boolean isTungstenEnabled = false;
|
||||
|
||||
private static Gson gson = new Gson();
|
||||
|
||||
/**
|
||||
@ -1396,6 +1398,10 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
_migrateWait = intValue;
|
||||
}
|
||||
|
||||
if (params.get(NetworkOrchestrationService.TUNGSTEN_ENABLED.key()) != null) {
|
||||
isTungstenEnabled = Boolean.parseBoolean(params.get(NetworkOrchestrationService.TUNGSTEN_ENABLED.key()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1481,8 +1487,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
defaultVifDriverName = DEFAULT_BRIDGE_VIF_DRIVER_CLASS_NAME;
|
||||
}
|
||||
}
|
||||
tungstenVifDriver = getVifDriverClass(DEFAULT_TUNGSTEN_VIF_DRIVER_CLASS_NAME, params);
|
||||
_defaultVifDriver = getVifDriverClass(defaultVifDriverName, params);
|
||||
tungstenVifDriver = getVifDriverClass(DEFAULT_TUNGSTEN_VIF_DRIVER_CLASS_NAME, params);
|
||||
|
||||
// Load any per-traffic-type vif drivers
|
||||
for (final Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
@ -1556,7 +1562,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
|
||||
final Set<VifDriver> vifDrivers = new HashSet<VifDriver>();
|
||||
|
||||
vifDrivers.add(_defaultVifDriver);
|
||||
if (TungstenService.isTungstenEnabled(Long.parseLong(_dcId))) {
|
||||
if (isTungstenEnabled) {
|
||||
vifDrivers.add(tungstenVifDriver);
|
||||
}
|
||||
vifDrivers.addAll(_trafficTypeVifDrivers.values());
|
||||
|
||||
@ -107,7 +107,8 @@ public class VRouterVifDriver extends VifDriverBase {
|
||||
@Override
|
||||
public boolean isExistingBridge(String bridgeName) {
|
||||
File f = new File("/sys/devices/virtual/net/" + bridgeName);
|
||||
return f.exists();
|
||||
File bridge = new File("/sys/devices/virtual/net/" + bridgeName + "/bridge");
|
||||
return f.exists() && ! bridge.exists();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -25,7 +25,6 @@ import com.cloud.network.element.TungstenProviderVO;
|
||||
import com.cloud.network.lb.LoadBalancingRule;
|
||||
import com.cloud.vm.VMInstanceVO;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
import org.apache.cloudstack.network.tungsten.api.response.TungstenFabricAddressGroupResponse;
|
||||
import org.apache.cloudstack.network.tungsten.api.response.TungstenFabricApplicationPolicySetResponse;
|
||||
import org.apache.cloudstack.network.tungsten.api.response.TungstenFabricFirewallPolicyResponse;
|
||||
@ -42,13 +41,6 @@ import java.util.List;
|
||||
|
||||
public interface TungstenService {
|
||||
|
||||
static final ConfigKey<Boolean> TUNGSTEN_ENABLED = new ConfigKey<Boolean>(Boolean.class, "tungsten.plugin.enable", "Advanced", "false",
|
||||
"Indicates whether to enable the Tungsten plugin", false, ConfigKey.Scope.Zone, null);
|
||||
|
||||
static Boolean isTungstenEnabled(long zoneId) {
|
||||
return TUNGSTEN_ENABLED.valueIn(zoneId);
|
||||
}
|
||||
|
||||
String getTungstenProjectFqn(Network network);
|
||||
|
||||
List<TungstenProviderVO> getTungstenProviders();
|
||||
|
||||
@ -115,8 +115,6 @@ import net.juniper.tungsten.api.types.VirtualMachineInterface;
|
||||
import net.juniper.tungsten.api.types.VirtualNetwork;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.context.CallContext;
|
||||
import org.apache.cloudstack.framework.config.ConfigKey;
|
||||
import org.apache.cloudstack.framework.config.Configurable;
|
||||
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
|
||||
import org.apache.cloudstack.framework.messagebus.MessageBus;
|
||||
import org.apache.cloudstack.network.tungsten.agent.api.AddTungstenNetworkGatewayToLogicalRouterCommand;
|
||||
@ -230,7 +228,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class TungstenServiceImpl extends ManagerBase implements TungstenService, Configurable {
|
||||
public class TungstenServiceImpl extends ManagerBase implements TungstenService {
|
||||
private static final Logger s_logger = Logger.getLogger(TungstenServiceImpl.class);
|
||||
|
||||
private static final String NETWORK = "network";
|
||||
@ -2540,16 +2538,4 @@ public class TungstenServiceImpl extends ManagerBase implements TungstenService,
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getConfigComponentName() {
|
||||
return TungstenServiceImpl.class.getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigKey<?>[] getConfigKeys() {
|
||||
return new ConfigKey<?>[] {
|
||||
TUNGSTEN_ENABLED
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
0
scripts/vm/network/tungsten/create_tap_device.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/create_tap_device.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/delete_tap_device.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/delete_tap_device.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/setup_tungsten_vrouter.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/setup_tungsten_vrouter.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/update_tungsten_loadbalancer_ssl.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/update_tungsten_loadbalancer_ssl.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/update_tungsten_loadbalancer_stats.sh
Normal file → Executable file
0
scripts/vm/network/tungsten/update_tungsten_loadbalancer_stats.sh
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user