mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
parent
594c70dde0
commit
2752c49fa7
@ -721,6 +721,13 @@ public class AgentProperties{
|
|||||||
*/
|
*/
|
||||||
public static final Property<Integer> IOTHREADS = new Property<>("iothreads", 1);
|
public static final Property<Integer> IOTHREADS = new Property<>("iothreads", 1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BGP controll CIDR
|
||||||
|
* Data type: String.<br>
|
||||||
|
* Default value: <code>169.254.0.0/16</code>
|
||||||
|
*/
|
||||||
|
public static final Property<String> CONTROL_CIDR = new Property<>("control.cidr", "169.254.0.0/16");
|
||||||
|
|
||||||
public static class Property <T>{
|
public static class Property <T>{
|
||||||
private String name;
|
private String name;
|
||||||
private T defaultValue;
|
private T defaultValue;
|
||||||
|
|||||||
@ -65,10 +65,7 @@ public class BridgeVifDriver extends VifDriverBase {
|
|||||||
|
|
||||||
String networkScriptsDir = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_SCRIPTS_DIR);
|
String networkScriptsDir = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_SCRIPTS_DIR);
|
||||||
|
|
||||||
String controlCidr = (String)params.get("control.cidr");
|
_controlCidr = getControlCidr(_controlCidr);
|
||||||
if (StringUtils.isNotBlank(controlCidr)) {
|
|
||||||
_controlCidr = controlCidr;
|
|
||||||
}
|
|
||||||
|
|
||||||
String value = (String)params.get("scripts.timeout");
|
String value = (String)params.get("scripts.timeout");
|
||||||
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
|
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.libvirt.LibvirtException;
|
import org.libvirt.LibvirtException;
|
||||||
|
|
||||||
@ -71,10 +70,7 @@ public class IvsVifDriver extends VifDriverBase {
|
|||||||
}
|
}
|
||||||
_ivsIfUpPath = Script.findScript(utilScriptsDir, "qemu-ivs-ifup");
|
_ivsIfUpPath = Script.findScript(utilScriptsDir, "qemu-ivs-ifup");
|
||||||
|
|
||||||
String controlCidr = (String)params.get("control.cidr");
|
_controlCidr = getControlCidr(_controlCidr);
|
||||||
if (StringUtils.isNotBlank(controlCidr)) {
|
|
||||||
_controlCidr = controlCidr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -60,10 +60,7 @@ public class OvsVifDriver extends VifDriverBase {
|
|||||||
dpdkDriver = new DpdkDriverImpl();
|
dpdkDriver = new DpdkDriverImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
String controlCidr = (String)params.get("control.cidr");
|
_controlCidr = getControlCidr(_controlCidr);
|
||||||
if (StringUtils.isNotBlank(controlCidr)) {
|
|
||||||
_controlCidr = controlCidr;
|
|
||||||
}
|
|
||||||
|
|
||||||
String value = (String)params.get("scripts.timeout");
|
String value = (String)params.get("scripts.timeout");
|
||||||
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
|
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
|
||||||
|
|||||||
@ -23,6 +23,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.naming.ConfigurationException;
|
import javax.naming.ConfigurationException;
|
||||||
|
|
||||||
|
import com.cloud.agent.properties.AgentProperties;
|
||||||
|
import com.cloud.agent.properties.AgentPropertiesFileHandler;
|
||||||
import org.libvirt.LibvirtException;
|
import org.libvirt.LibvirtException;
|
||||||
|
|
||||||
import com.cloud.agent.api.to.NicTO;
|
import com.cloud.agent.api.to.NicTO;
|
||||||
@ -41,6 +43,11 @@ public abstract class VifDriverBase implements VifDriver {
|
|||||||
_pifs = (Map<String, String>)params.get("libvirt.host.pifs");
|
_pifs = (Map<String, String>)params.get("libvirt.host.pifs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getControlCidr(String defaultValue) {
|
||||||
|
String controlCidr = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.CONTROL_CIDR);
|
||||||
|
return controlCidr;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter, Map<String, String> extraConfig) throws InternalErrorException, LibvirtException;
|
public abstract LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter, Map<String, String> extraConfig) throws InternalErrorException, LibvirtException;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user