Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/src/com/cloud/network/VirtualNetworkApplianceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,4 @@ public interface VirtualNetworkApplianceService {
VirtualRouter findRouter(long routerId);

List<Long> upgradeRouterTemplate(UpgradeRouterTemplateCmd cmd);

public static final String MinVRVersion = "4.4.1";
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.framework.config.ConfigKey.Scope;

import com.cloud.deploy.DataCenterDeployment;
import com.cloud.deploy.DeployDestination;
Expand Down Expand Up @@ -62,9 +63,13 @@ public interface NetworkOrchestrationService {
static final String NetworkLockTimeoutCK = "network.lock.timeout";
static final String GuestDomainSuffixCK = "guest.domain.suffix";
static final String NetworkThrottlingRateCK = "network.throttling.rate";
static final String MinVRVersionCK = "minreq.sysvmtemplate.version";

static final ConfigKey<String> MinVRVersion = new ConfigKey<String>(String.class, MinVRVersionCK, "Advanced", "4.4.4",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the minimum hardcoded version to 4.4.0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, 4.4.2 is the minimum as some fixes went into the 4.4 branch. I don't mind that instead of 4.4.4 that I did because I am an irritatingly formal guy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, alright :)

"What version should the Virtual Routers report", true, ConfigKey.Scope.Zone, null);

static final ConfigKey<Integer> NetworkLockTimeout = new ConfigKey<Integer>(Integer.class, NetworkLockTimeoutCK, "Network", "600",
"Lock wait timeout (seconds) while implementing network", true);
"Lock wait timeout (seconds) while implementing network", true, Scope.Global, null);
static final ConfigKey<String> GuestDomainSuffix = new ConfigKey<String>(String.class, GuestDomainSuffixCK, "Network", "cloud.internal",
"Default domain name for vms inside virtualized networks fronted by router", true, ConfigKey.Scope.Zone, null);
static final ConfigKey<Integer> NetworkThrottlingRate = new ConfigKey<Integer>("Network", Integer.class, NetworkThrottlingRateCK, "200",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
import org.apache.cloudstack.framework.config.ConfigDepot;
import org.apache.cloudstack.framework.config.ConfigKey;
import org.apache.cloudstack.framework.config.ConfigKey.Scope;
import org.apache.cloudstack.framework.config.Configurable;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.cloudstack.framework.messagebus.MessageBus;
Expand Down Expand Up @@ -3215,12 +3216,13 @@ public String getConfigComponentName() {
}

public static final ConfigKey<Integer> NetworkGcWait = new ConfigKey<Integer>(Integer.class, "network.gc.wait", "Advanced", "600",
"Time (in seconds) to wait before shutting down a network that's not in used", false);
"Time (in seconds) to wait before shutting down a network that's not in used", false, Scope.Global, null);
public static final ConfigKey<Integer> NetworkGcInterval = new ConfigKey<Integer>(Integer.class, "network.gc.interval", "Advanced", "600",
"Seconds to wait before checking for networks to shutdown", true);
"Seconds to wait before checking for networks to shutdown", true, Scope.Global, null);

@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[] {NetworkGcWait, NetworkGcInterval, NetworkLockTimeout, GuestDomainSuffix, NetworkThrottlingRate};
return new ConfigKey<?>[] {NetworkGcWait, NetworkGcInterval, NetworkLockTimeout, GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion};
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;

import com.cloud.network.VirtualNetworkApplianceService;

import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -573,7 +572,7 @@ public Answer WatchConsoleProxyLoad(WatchConsoleProxyLoadCommand cmd) {

@Override
public GetDomRVersionAnswer getDomRVersion(GetDomRVersionCmd cmd) {
String template_version = "CloudStack Release "+ VirtualNetworkApplianceService.MinVRVersion.toString();
String template_version = "CloudStack Release "+ NetworkOrchestrationService.MinVRVersion.defaultValue();
return new GetDomRVersionAnswer(cmd, null, template_version, UUID.randomUUID().toString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@
import javax.ejb.Local;
import javax.inject.Inject;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import org.apache.cloudstack.api.response.DomainRouterResponse;
import org.apache.cloudstack.api.response.NicResponse;
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import com.cloud.api.ApiResponseHelper;
import com.cloud.api.query.vo.DomainRouterJoinVO;
import com.cloud.maint.Version;
import com.cloud.network.Networks.TrafficType;
import com.cloud.network.VirtualNetworkApplianceService;
import com.cloud.network.router.VirtualRouter;
import com.cloud.network.router.VirtualRouter.Role;
import com.cloud.user.Account;
Expand Down Expand Up @@ -83,7 +82,7 @@ public DomainRouterResponse newDomainRouterResponse(DomainRouterJoinVO router, A
if (router.getTemplateVersion() != null) {
String routerVersion = Version.trimRouterVersion(router.getTemplateVersion());
routerResponse.setVersion(routerVersion);
routerResponse.setRequiresUpgrade((Version.compare(routerVersion, VirtualNetworkApplianceService.MinVRVersion) < 0));
routerResponse.setRequiresUpgrade((Version.compare(routerVersion, NetworkOrchestrationService.MinVRVersion.valueIn(router.getDataCenterId())) < 0));
} else {
routerResponse.setVersion("UNKNOWN");
routerResponse.setRequiresUpgrade(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3718,7 +3718,7 @@ private void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Co
protected boolean sendCommandsToRouter(final VirtualRouter router, final Commands cmds) throws AgentUnavailableException {
if(!checkRouterVersion(router)){
s_logger.debug("Router requires upgrade. Unable to send command to router:" + router.getId() + ", router template version : " + router.getTemplateVersion()
+ ", minimal required version : " + MinVRVersion);
+ ", minimal required version : " + NetworkOrchestrationService.MinVRVersion.valueIn(router.getDataCenterId()));
throw new CloudRuntimeException("Unable to send command. Upgrade in progress. Please contact administrator.");
}
Answer[] answers = null;
Expand Down Expand Up @@ -4355,8 +4355,10 @@ protected boolean checkRouterVersion(final VirtualRouter router) {
if(router.getTemplateVersion() == null){
return false;
}
long dcid = router.getDataCenterId();
final String dcVersion = NetworkOrchestrationService.MinVRVersion.valueIn(dcid);
final String trimmedVersion = Version.trimRouterVersion(router.getTemplateVersion());
return (Version.compare(trimmedVersion, MinVRVersion) >= 0);
return (Version.compare(trimmedVersion, dcVersion) >= 0);
}

private List<Long> rebootRouters(List<DomainRouterVO> routers){
Expand Down