bug 7264: removing the unused param direct.attach.untagged.vlan.enabled; also changing the use of this param to Data_center.networktype.basic usage as this maps to the removed param in the case of direct untagged network. This is used in a check in recreatehostallocator

This commit is contained in:
abhishek 2010-12-08 13:55:39 -08:00
parent 14ef4c2d57
commit 61cf2308a1
3 changed files with 4 additions and 16 deletions

View File

@ -30,12 +30,11 @@ import org.apache.log4j.Logger;
import com.cloud.agent.AgentManager;
import com.cloud.agent.manager.allocator.HostAllocator;
import com.cloud.configuration.Config;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.dc.ClusterVO;
import com.cloud.dc.DataCenterVO;
import com.cloud.dc.HostPodVO;
import com.cloud.dc.PodCluster;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.dc.dao.ClusterDao;
import com.cloud.dc.dao.HostPodDao;
import com.cloud.host.Host;
@ -45,7 +44,6 @@ import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.StoragePoolDao;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.utils.Pair;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.utils.component.Inject;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
@ -59,7 +57,6 @@ public class RecreateHostAllocator extends FirstFitRoutingAllocator {
@Inject ClusterDao _clusterDao;
@Inject AgentManager _agentMgr;
@Inject VolumeDao _volsDao;
boolean _isDirect;
@Override
public Host allocateTo(VirtualMachineProfile<? extends VirtualMachine> vm, ServiceOffering offering, Host.Type type, DataCenterVO dc, HostPodVO pod,
@ -77,7 +74,9 @@ public class RecreateHostAllocator extends FirstFitRoutingAllocator {
}
List<PodCluster> pcs = _agentMgr.listByDataCenter(dc.getId());
if (_isDirect) {
//getting rid of direct.attached.untagged.vlan.enabled config param: Bug 7204
//basic network type for zone maps to direct untagged case
if (dc.getNetworkType().equals(NetworkType.Basic)) {
s_logger.debug("Direct Networking mode so we can only allow the host to be allocated in the same pod due to public ip address cannot change");
List<VolumeVO> vols = _volsDao.findByInstance(vm.getId());
VolumeVO vol = vols.get(0);
@ -118,11 +117,6 @@ public class RecreateHostAllocator extends FirstFitRoutingAllocator {
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
super.configure(name, params);
ComponentLocator locator = ComponentLocator.getCurrentLocator();
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
Map<String, String> dbParams = configDao.getConfiguration(params);
_isDirect = Boolean.parseBoolean(dbParams.get(Config.DirectAttachUntaggedVlanEnabled.key()));
return true;
}

View File

@ -659,10 +659,6 @@ public class ApiServer implements HttpRequestHandler {
if(directAttachNetworkGroupsEnabled == null)
directAttachNetworkGroupsEnabled = "false";
String directAttachedUntaggedEnabled = _ms.getConfigurationValue("direct.attach.untagged.vlan.enabled");
if (directAttachedUntaggedEnabled == null)
directAttachedUntaggedEnabled = "false";
String systemVmUseLocalStorage = _ms.getConfigurationValue("system.vm.use.local.storage");
if (systemVmUseLocalStorage == null)
systemVmUseLocalStorage = "false";
@ -679,7 +675,6 @@ public class ApiServer implements HttpRequestHandler {
// session.setAttribute("networktype", networkType);
session.setAttribute("hypervisortype", hypervisorType);
session.setAttribute("directattachnetworkgroupsenabled", directAttachNetworkGroupsEnabled);
session.setAttribute("directattacheduntaggedenabled", directAttachedUntaggedEnabled);
session.setAttribute("systemvmuselocalstorage", systemVmUseLocalStorage);
if (timezone != null) {

View File

@ -154,7 +154,6 @@ public enum Config {
DirectAttachNetworkGroupsEnabled("Advanced", ManagementServer.class, Boolean.class, "direct.attach.network.groups.enabled", "false", "Ec2-style distributed firewall for direct-attach VMs", "true,false"),
DirectAttachNetworkEnabled("Advanced", ManagementServer.class, Boolean.class, "direct.attach.network.externalIpAllocator.enabled", "false", "Direct-attach VMs using external DHCP server", "true,false"),
DirectAttachNetworkExternalAPIURL("Advanced", ManagementServer.class, String.class, "direct.attach.network.externalIpAllocator.url", null, "Direct-attach VMs using external DHCP server (API url)", null),
DirectAttachUntaggedVlanEnabled("Advanced", ManagementServer.class, String.class, "direct.attach.untagged.vlan.enabled", "false", "Indicate whether the system supports direct-attached untagged vlan", "true,false"),
CheckPodCIDRs("Advanced", ManagementServer.class, String.class, "check.pod.cidrs", "true", "If true, different pods must belong to different CIDR subnets.", "true,false"),
MD5Hashed("Advanced", ManagementServer.class, Boolean.class, "security.password.md5hashed", "true", "If set to false password is sent in clear text or else md5hashed", null),