mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	Merge branch '4.10'
This commit is contained in:
		
						commit
						619da91386
					
				| @ -176,3 +176,7 @@ hypervisor.type=kvm | |||||||
| # vm.rng.rate.period=1000 | # vm.rng.rate.period=1000 | ||||||
| # The number of milliseconds in which the guest is allowed to obtain the bytes | # The number of milliseconds in which the guest is allowed to obtain the bytes | ||||||
| # specified above. | # specified above. | ||||||
|  | 
 | ||||||
|  | # router.aggregation.command.each.timeout=600 | ||||||
|  | # timeout value for aggregation commands send to virtual router | ||||||
|  | # | ||||||
|  | |||||||
| @ -92,10 +92,6 @@ public class UpdateVMAffinityGroupCmd extends BaseAsyncCmd { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public List<Long> getAffinityGroupIdList() { |     public List<Long> getAffinityGroupIdList() { | ||||||
|         if (affinityGroupNameList != null && affinityGroupIdList != null) { |  | ||||||
|             throw new InvalidParameterValueException("affinitygroupids parameter is mutually exclusive with affinitygroupnames parameter"); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         // transform group names to ids here |         // transform group names to ids here | ||||||
|         if (affinityGroupNameList != null) { |         if (affinityGroupNameList != null) { | ||||||
|             List<Long> affinityGroupIds = new ArrayList<Long>(); |             List<Long> affinityGroupIds = new ArrayList<Long>(); | ||||||
| @ -138,6 +134,14 @@ public class UpdateVMAffinityGroupCmd extends BaseAsyncCmd { | |||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException { |     public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException { | ||||||
|  |         if (affinityGroupNameList != null && affinityGroupIdList != null) { | ||||||
|  |             throw new InvalidParameterValueException("affinitygroupids parameter is mutually exclusive with affinitygroupnames parameter"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (affinityGroupNameList == null && affinityGroupIdList == null) { | ||||||
|  |             throw new InvalidParameterValueException("affinitygroupids parameter or affinitygroupnames parameter must be given"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         CallContext.current().setEventDetails("VM ID: " + getId()); |         CallContext.current().setEventDetails("VM ID: " + getId()); | ||||||
|         UserVm result = _affinityGroupService.updateVMAffinityGroups(getId(), getAffinityGroupIdList()); |         UserVm result = _affinityGroupService.updateVMAffinityGroups(getId(), getAffinityGroupIdList()); | ||||||
|         ArrayList<VMDetails> dc = new ArrayList<VMDetails>(); |         ArrayList<VMDetails> dc = new ArrayList<VMDetails>(); | ||||||
|  | |||||||
| @ -283,7 +283,10 @@ public class VirtualRoutingResource { | |||||||
|         _port = NumbersUtil.parseInt(value, 3922); |         _port = NumbersUtil.parseInt(value, 3922); | ||||||
| 
 | 
 | ||||||
|         value = (String)params.get("router.aggregation.command.each.timeout"); |         value = (String)params.get("router.aggregation.command.each.timeout"); | ||||||
|         _eachTimeout = Duration.standardSeconds(NumbersUtil.parseInt(value, 10)); |         _eachTimeout = Duration.standardSeconds(NumbersUtil.parseInt(value, (int)VRScripts.VR_SCRIPT_EXEC_TIMEOUT.getStandardSeconds())); | ||||||
|  |         if (s_logger.isDebugEnabled()){ | ||||||
|  |             s_logger.debug("The router.aggregation.command.each.timeout in seconds is set to " + _eachTimeout.getStandardSeconds()); | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         if (_vrDeployer == null) { |         if (_vrDeployer == null) { | ||||||
|             throw new ConfigurationException("Unable to find the resource for VirtualRouterDeployer!"); |             throw new ConfigurationException("Unable to find the resource for VirtualRouterDeployer!"); | ||||||
| @ -387,8 +390,8 @@ public class VirtualRoutingResource { | |||||||
|                 ScriptConfigItem scriptConfigItem = new ScriptConfigItem(VRScripts.VR_CFG, "-c " + VRScripts.CONFIG_CACHE_LOCATION + cfgFileName); |                 ScriptConfigItem scriptConfigItem = new ScriptConfigItem(VRScripts.VR_CFG, "-c " + VRScripts.CONFIG_CACHE_LOCATION + cfgFileName); | ||||||
|                 // 120s is the minimal timeout |                 // 120s is the minimal timeout | ||||||
|                 Duration timeout = _eachTimeout.withDurationAdded(_eachTimeout.getStandardSeconds(), answerCounts); |                 Duration timeout = _eachTimeout.withDurationAdded(_eachTimeout.getStandardSeconds(), answerCounts); | ||||||
|                 if (timeout.isShorterThan(VRScripts.VR_SCRIPT_EXEC_TIMEOUT)) { |                 if (s_logger.isDebugEnabled()){ | ||||||
|                     timeout = VRScripts.VR_SCRIPT_EXEC_TIMEOUT; |                     s_logger.debug("Aggregate action timeout in seconds is " + timeout.getStandardSeconds()); | ||||||
|                 } |                 } | ||||||
| 
 | 
 | ||||||
|                 ExecutionResult result = applyConfigToVR(cmd.getRouterAccessIp(), fileConfigItem, timeout); |                 ExecutionResult result = applyConfigToVR(cmd.getRouterAccessIp(), fileConfigItem, timeout); | ||||||
|  | |||||||
| @ -25,25 +25,9 @@ import java.util.Set; | |||||||
| 
 | 
 | ||||||
| import javax.inject.Inject; | import javax.inject.Inject; | ||||||
| 
 | 
 | ||||||
| import com.google.common.collect.FluentIterable; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDhcpDomainOption; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDhcpVMOption; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDomain; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspNetwork; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspNic; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspStaticNat; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspVm; |  | ||||||
| 
 |  | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import com.google.common.base.Strings; |  | ||||||
| import com.google.common.collect.Iterables; |  | ||||||
| import com.google.common.collect.LinkedListMultimap; |  | ||||||
| import com.google.common.collect.Lists; |  | ||||||
| import com.google.common.collect.Maps; |  | ||||||
| 
 |  | ||||||
| import org.apache.cloudstack.resourcedetail.VpcDetailVO; | import org.apache.cloudstack.resourcedetail.VpcDetailVO; | ||||||
| import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao; | import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
| 
 | 
 | ||||||
| import com.cloud.agent.AgentManager; | import com.cloud.agent.AgentManager; | ||||||
| import com.cloud.agent.api.Answer; | import com.cloud.agent.api.Answer; | ||||||
| @ -98,6 +82,20 @@ import com.cloud.vm.VMInstanceVO; | |||||||
| import com.cloud.vm.VirtualMachine; | import com.cloud.vm.VirtualMachine; | ||||||
| import com.cloud.vm.VirtualMachineProfile; | import com.cloud.vm.VirtualMachineProfile; | ||||||
| import com.cloud.vm.dao.VMInstanceDao; | import com.cloud.vm.dao.VMInstanceDao; | ||||||
|  | import com.google.common.base.Strings; | ||||||
|  | import com.google.common.collect.FluentIterable; | ||||||
|  | import com.google.common.collect.Iterables; | ||||||
|  | import com.google.common.collect.LinkedListMultimap; | ||||||
|  | import com.google.common.collect.Lists; | ||||||
|  | import com.google.common.collect.Maps; | ||||||
|  | 
 | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspDhcpDomainOption; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspDhcpVMOption; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspDomain; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspNetwork; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspNic; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspStaticNat; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspVm; | ||||||
| 
 | 
 | ||||||
| public class NuageVspGuestNetworkGuru extends GuestNetworkGuru { | public class NuageVspGuestNetworkGuru extends GuestNetworkGuru { | ||||||
|     public static final Logger s_logger = Logger.getLogger(NuageVspGuestNetworkGuru.class); |     public static final Logger s_logger = Logger.getLogger(NuageVspGuestNetworkGuru.class); | ||||||
| @ -335,7 +333,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru { | |||||||
|             VspStaticNat vspStaticNat = null; |             VspStaticNat vspStaticNat = null; | ||||||
|             if (staticNatIp != null) { |             if (staticNatIp != null) { | ||||||
|                 VlanVO staticNatVlan = _vlanDao.findById(staticNatIp.getVlanId()); |                 VlanVO staticNatVlan = _vlanDao.findById(staticNatIp.getVlanId()); | ||||||
|                 vspStaticNat = _nuageVspEntityBuilder.buildVspStaticNat(null, staticNatIp, staticNatVlan, null); |                 vspStaticNat = _nuageVspEntityBuilder.buildVspStaticNat(null, staticNatIp, staticNatVlan, vspNic); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             boolean defaultHasDns = getDefaultHasDns(networkHasDnsCache, nicFromDb); |             boolean defaultHasDns = getDefaultHasDns(networkHasDnsCache, nicFromDb); | ||||||
|  | |||||||
| @ -19,6 +19,20 @@ | |||||||
| 
 | 
 | ||||||
| package com.cloud.util; | package com.cloud.util; | ||||||
| 
 | 
 | ||||||
|  | import java.util.HashSet; | ||||||
|  | import java.util.Iterator; | ||||||
|  | import java.util.List; | ||||||
|  | import java.util.Map; | ||||||
|  | import java.util.Set; | ||||||
|  | import java.util.TreeSet; | ||||||
|  | 
 | ||||||
|  | import javax.annotation.Nullable; | ||||||
|  | import javax.inject.Inject; | ||||||
|  | 
 | ||||||
|  | import org.apache.cloudstack.framework.config.dao.ConfigurationDao; | ||||||
|  | import org.apache.commons.lang.StringUtils; | ||||||
|  | import org.apache.log4j.Logger; | ||||||
|  | 
 | ||||||
| import com.cloud.dc.Vlan; | import com.cloud.dc.Vlan; | ||||||
| import com.cloud.dc.VlanVO; | import com.cloud.dc.VlanVO; | ||||||
| import com.cloud.dc.dao.VlanDao; | import com.cloud.dc.dao.VlanDao; | ||||||
| @ -57,9 +71,10 @@ import com.google.common.base.Predicate; | |||||||
| import com.google.common.collect.Iterables; | import com.google.common.collect.Iterables; | ||||||
| import com.google.common.collect.Lists; | import com.google.common.collect.Lists; | ||||||
| import com.google.common.collect.Maps; | import com.google.common.collect.Maps; | ||||||
|  | 
 | ||||||
| import net.nuage.vsp.acs.client.api.model.VspAclRule; | import net.nuage.vsp.acs.client.api.model.VspAclRule; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDhcpDomainOption; |  | ||||||
| import net.nuage.vsp.acs.client.api.model.VspAddressRange; | import net.nuage.vsp.acs.client.api.model.VspAddressRange; | ||||||
|  | import net.nuage.vsp.acs.client.api.model.VspDhcpDomainOption; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDhcpVMOption; | import net.nuage.vsp.acs.client.api.model.VspDhcpVMOption; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDomain; | import net.nuage.vsp.acs.client.api.model.VspDomain; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDomainCleanUp; | import net.nuage.vsp.acs.client.api.model.VspDomainCleanUp; | ||||||
| @ -68,18 +83,6 @@ import net.nuage.vsp.acs.client.api.model.VspNic; | |||||||
| import net.nuage.vsp.acs.client.api.model.VspStaticNat; | import net.nuage.vsp.acs.client.api.model.VspStaticNat; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspVm; | import net.nuage.vsp.acs.client.api.model.VspVm; | ||||||
| import net.nuage.vsp.acs.client.common.model.Pair; | import net.nuage.vsp.acs.client.common.model.Pair; | ||||||
| import org.apache.cloudstack.framework.config.dao.ConfigurationDao; |  | ||||||
| import org.apache.commons.lang.StringUtils; |  | ||||||
| import org.apache.log4j.Logger; |  | ||||||
| 
 |  | ||||||
| import javax.annotation.Nullable; |  | ||||||
| import javax.inject.Inject; |  | ||||||
| import java.util.HashSet; |  | ||||||
| import java.util.Iterator; |  | ||||||
| import java.util.List; |  | ||||||
| import java.util.Map; |  | ||||||
| import java.util.Set; |  | ||||||
| import java.util.TreeSet; |  | ||||||
| 
 | 
 | ||||||
| public class NuageVspEntityBuilder { | public class NuageVspEntityBuilder { | ||||||
|     private static final Logger s_logger = Logger.getLogger(NuageVspEntityBuilder.class); |     private static final Logger s_logger = Logger.getLogger(NuageVspEntityBuilder.class); | ||||||
| @ -380,25 +383,30 @@ public class NuageVspEntityBuilder { | |||||||
|         return vspNicBuilder.build(); |         return vspNicBuilder.build(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public VspStaticNat buildVspStaticNat(Boolean forRevoke, IPAddressVO staticNatIp, VlanVO staticNatVlan, NicVO nic) { |     public VspStaticNat buildVspStaticNat(Boolean forRevoke, IPAddressVO staticNatIp, VlanVO staticNatVlan, VspNic vspNic) { | ||||||
|         VspStaticNat.Builder vspStaticNatBuilder = new VspStaticNat.Builder() |         VspStaticNat.Builder vspStaticNatBuilder = new VspStaticNat.Builder() | ||||||
|                 .ipUuid(staticNatIp.getUuid()) |                 .ipUuid(staticNatIp.getUuid()) | ||||||
|                 .ipAddress(staticNatIp.getAddress().addr()) |                 .ipAddress(staticNatIp.getAddress().addr()) | ||||||
|                 .revoke(forRevoke) |                 .revoke(forRevoke) | ||||||
|                 .oneToOneNat(staticNatIp.isOneToOneNat()) |                 .oneToOneNat(staticNatIp.isOneToOneNat()) | ||||||
|  |                 .state(getEnumValue(staticNatIp.getState(), VspStaticNat.State.class)) | ||||||
|                 .vlanUuid(staticNatVlan.getUuid()) |                 .vlanUuid(staticNatVlan.getUuid()) | ||||||
|                 .vlanGateway(staticNatVlan.getVlanGateway()) |                 .vlanGateway(staticNatVlan.getVlanGateway()) | ||||||
|                 .vlanNetmask(staticNatVlan.getVlanNetmask()) |                 .vlanNetmask(staticNatVlan.getVlanNetmask()) | ||||||
|                 .vlanUnderlay(NuageVspUtil.isUnderlayEnabledForVlan(_vlanDetailsDao, staticNatVlan)); |                 .vlanUnderlay(NuageVspUtil.isUnderlayEnabledForVlan(_vlanDetailsDao, staticNatVlan)); | ||||||
| 
 | 
 | ||||||
|         if (nic != null) { |         if (vspNic != null) { | ||||||
|             VspNic vspNic = buildVspNic(nic); |  | ||||||
|             vspStaticNatBuilder.nic(vspNic); |             vspStaticNatBuilder.nic(vspNic); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return vspStaticNatBuilder.build(); |         return vspStaticNatBuilder.build(); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public VspStaticNat buildVspStaticNat(Boolean forRevoke, IPAddressVO staticNatIp, VlanVO staticNatVlan, NicVO nic) { | ||||||
|  |         VspNic vspNic = (nic != null) ?buildVspNic(nic) : null; | ||||||
|  |         return buildVspStaticNat(forRevoke, staticNatIp, staticNatVlan, vspNic); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public VspAclRule buildVspAclRule(FirewallRule firewallRule, Network network) { |     public VspAclRule buildVspAclRule(FirewallRule firewallRule, Network network) { | ||||||
|         VspAclRule.Builder vspAclRuleBuilder = new VspAclRule.Builder() |         VspAclRule.Builder vspAclRuleBuilder = new VspAclRule.Builder() | ||||||
|                 .uuid(firewallRule.getUuid()) |                 .uuid(firewallRule.getUuid()) | ||||||
| @ -506,4 +514,20 @@ public class NuageVspEntityBuilder { | |||||||
| 
 | 
 | ||||||
|         return vspDhcpDomainBuilder.build(); |         return vspDhcpDomainBuilder.build(); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     private <E extends Enum<E>> E getEnumValue(Enum cloudstackValue, Class<E> target) { | ||||||
|  |         try { | ||||||
|  |             return Enum.valueOf(target, cloudstackValue.name()); | ||||||
|  |         } catch (IllegalArgumentException e) { | ||||||
|  |             return null; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     private <E extends Enum<E>> E getEnumValue(Enum cloudstackValue, E defaultValue) { | ||||||
|  |         try { | ||||||
|  |             return Enum.valueOf(defaultValue.getDeclaringClass(), cloudstackValue.name()); | ||||||
|  |         } catch (IllegalArgumentException e) { | ||||||
|  |             return defaultValue; | ||||||
|  |         } | ||||||
|  |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -19,19 +19,17 @@ | |||||||
| 
 | 
 | ||||||
| package com.cloud.util; | package com.cloud.util; | ||||||
| 
 | 
 | ||||||
| import net.nuage.vsp.acs.client.api.model.Protocol; | import static org.junit.Assert.assertEquals; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspAclRule; | import static org.junit.Assert.assertNotNull; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspDomain; | import static org.junit.Assert.assertNull; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspNetwork; | import static org.mockito.Matchers.anyLong; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspNic; | import static org.mockito.Matchers.anyString; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspStaticNat; | import static org.mockito.Mockito.mock; | ||||||
| import net.nuage.vsp.acs.client.api.model.VspVm; | import static org.mockito.Mockito.when; | ||||||
| 
 | 
 | ||||||
| import org.junit.Before; | import org.junit.Before; | ||||||
| import org.junit.Test; | import org.junit.Test; | ||||||
| 
 | 
 | ||||||
| import com.google.common.collect.Lists; |  | ||||||
| 
 |  | ||||||
| import com.cloud.NuageTest; | import com.cloud.NuageTest; | ||||||
| import com.cloud.dc.VlanDetailsVO; | import com.cloud.dc.VlanDetailsVO; | ||||||
| import com.cloud.dc.VlanVO; | import com.cloud.dc.VlanVO; | ||||||
| @ -39,6 +37,7 @@ import com.cloud.dc.dao.VlanDao; | |||||||
| import com.cloud.dc.dao.VlanDetailsDao; | import com.cloud.dc.dao.VlanDetailsDao; | ||||||
| import com.cloud.domain.DomainVO; | import com.cloud.domain.DomainVO; | ||||||
| import com.cloud.domain.dao.DomainDao; | import com.cloud.domain.dao.DomainDao; | ||||||
|  | import com.cloud.network.IpAddress; | ||||||
| import com.cloud.network.Network; | import com.cloud.network.Network; | ||||||
| import com.cloud.network.dao.IPAddressDao; | import com.cloud.network.dao.IPAddressDao; | ||||||
| import com.cloud.network.dao.IPAddressVO; | import com.cloud.network.dao.IPAddressVO; | ||||||
| @ -58,14 +57,15 @@ import com.cloud.utils.net.Ip; | |||||||
| import com.cloud.vm.NicProfile; | import com.cloud.vm.NicProfile; | ||||||
| import com.cloud.vm.NicVO; | import com.cloud.vm.NicVO; | ||||||
| import com.cloud.vm.VirtualMachine; | import com.cloud.vm.VirtualMachine; | ||||||
|  | import com.google.common.collect.Lists; | ||||||
| 
 | 
 | ||||||
| import static org.junit.Assert.assertEquals; | import net.nuage.vsp.acs.client.api.model.Protocol; | ||||||
| import static org.junit.Assert.assertNotNull; | import net.nuage.vsp.acs.client.api.model.VspAclRule; | ||||||
| import static org.junit.Assert.assertNull; | import net.nuage.vsp.acs.client.api.model.VspDomain; | ||||||
| import static org.mockito.Matchers.anyLong; | import net.nuage.vsp.acs.client.api.model.VspNetwork; | ||||||
| import static org.mockito.Matchers.anyString; | import net.nuage.vsp.acs.client.api.model.VspNic; | ||||||
| import static org.mockito.Mockito.mock; | import net.nuage.vsp.acs.client.api.model.VspStaticNat; | ||||||
| import static org.mockito.Mockito.when; | import net.nuage.vsp.acs.client.api.model.VspVm; | ||||||
| 
 | 
 | ||||||
| public class NuageVspEntityBuilderTest extends NuageTest { | public class NuageVspEntityBuilderTest extends NuageTest { | ||||||
| 
 | 
 | ||||||
| @ -361,6 +361,7 @@ public class NuageVspEntityBuilderTest extends NuageTest { | |||||||
|         when(_mockedStaticNatIp.getAddress()).thenReturn(new Ip("10.10.10.2")); |         when(_mockedStaticNatIp.getAddress()).thenReturn(new Ip("10.10.10.2")); | ||||||
|         when(_mockedStaticNatIp.isOneToOneNat()).thenReturn(true); |         when(_mockedStaticNatIp.isOneToOneNat()).thenReturn(true); | ||||||
|         when(_mockedStaticNatIp.getVmIp()).thenReturn("192.168.0.24"); |         when(_mockedStaticNatIp.getVmIp()).thenReturn("192.168.0.24"); | ||||||
|  |         when(_mockedStaticNatIp.getState()).thenReturn(IpAddress.State.Allocated); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void setUpMockedStaticNatVlan() { |     private void setUpMockedStaticNatVlan() { | ||||||
|  | |||||||
| @ -481,7 +481,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc | |||||||
|         @Override |         @Override | ||||||
|         protected void runInContext() { |         protected void runInContext() { | ||||||
|             try { |             try { | ||||||
|                 s_logger.debug("HostOutOfBandManagementStatsCollector is running..."); |                 s_logger.trace("HostOutOfBandManagementStatsCollector is running..."); | ||||||
|                 List<OutOfBandManagementVO> outOfBandManagementHosts = outOfBandManagementDao.findAllByManagementServer(ManagementServerNode.getManagementServerId()); |                 List<OutOfBandManagementVO> outOfBandManagementHosts = outOfBandManagementDao.findAllByManagementServer(ManagementServerNode.getManagementServerId()); | ||||||
|                 if (outOfBandManagementHosts == null) { |                 if (outOfBandManagementHosts == null) { | ||||||
|                     return; |                     return; | ||||||
| @ -511,7 +511,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc | |||||||
|         @Override |         @Override | ||||||
|         protected void runInContext() { |         protected void runInContext() { | ||||||
|             try { |             try { | ||||||
|                 s_logger.debug("VmStatsCollector is running..."); |                 s_logger.trace("VmStatsCollector is running..."); | ||||||
| 
 | 
 | ||||||
|                 SearchCriteria<HostVO> sc = _hostDao.createSearchCriteria(); |                 SearchCriteria<HostVO> sc = _hostDao.createSearchCriteria(); | ||||||
|                 sc.addAnd("status", SearchCriteria.Op.EQ, Status.Up.toString()); |                 sc.addAnd("status", SearchCriteria.Op.EQ, Status.Up.toString()); | ||||||
|  | |||||||
| @ -90,7 +90,7 @@ except-interface=lo | |||||||
| # want dnsmasq to really bind only the interfaces it is listening on, | # want dnsmasq to really bind only the interfaces it is listening on, | ||||||
| # uncomment this option. About the only time you may need this is when | # uncomment this option. About the only time you may need this is when | ||||||
| # running another nameserver on the same machine. | # running another nameserver on the same machine. | ||||||
| bind-interfaces | #bind-interfaces | ||||||
| 
 | 
 | ||||||
| # If you don't want dnsmasq to read /etc/hosts, uncomment the | # If you don't want dnsmasq to read /etc/hosts, uncomment the | ||||||
| # following line. | # following line. | ||||||
|  | |||||||
| @ -1040,7 +1040,6 @@ class TestUpdateVMAffinityGroups(cloudstackTestCase): | |||||||
|         for aff_grp in aff_grps: |         for aff_grp in aff_grps: | ||||||
|             aff_grp.delete(self.api_client) |             aff_grp.delete(self.api_client) | ||||||
| 
 | 
 | ||||||
|     @unittest.skip("Skip - Failing - work in progress") |  | ||||||
|     @attr(tags=["simulator", "basic", "advanced", "multihost", "NotRun"]) |     @attr(tags=["simulator", "basic", "advanced", "multihost", "NotRun"]) | ||||||
|     def test_04_update_aff_grp_remove_all(self): |     def test_04_update_aff_grp_remove_all(self): | ||||||
|         """ |         """ | ||||||
| @ -1087,6 +1086,32 @@ class TestUpdateVMAffinityGroups(cloudstackTestCase): | |||||||
|         for aff_grp in aff_grps: |         for aff_grp in aff_grps: | ||||||
|             aff_grp.delete(self.api_client) |             aff_grp.delete(self.api_client) | ||||||
| 
 | 
 | ||||||
|  |     @attr(tags=["simulator", "basic", "advanced", "multihost", "NotRun"]) | ||||||
|  |     def test_06_update_aff_grp_invalid_args(self): | ||||||
|  |         """ | ||||||
|  |             Update the list of Affinity Groups with either both args or none | ||||||
|  |         """ | ||||||
|  | 
 | ||||||
|  |         self.create_aff_grp(aff_grp=self.services["host_anti_affinity"]) | ||||||
|  |         self.create_aff_grp(aff_grp=self.services["host_anti_affinity"]) | ||||||
|  |         vm1, hostid1 = self.create_vm_in_aff_grps([], account_name=self.account.name, domain_id=self.domain.id) | ||||||
|  | 
 | ||||||
|  |         aff_grps = [self.aff_grp[0], self.aff_grp[1]] | ||||||
|  |         vm1.stop(self.api_client) | ||||||
|  | 
 | ||||||
|  |         with self.assertRaises(Exception): | ||||||
|  |             vm1.update_affinity_group(self.api_client) | ||||||
|  | 
 | ||||||
|  |         with self.assertRaises(Exception): | ||||||
|  |             vm1.update_affinity_group(self.api_client, affinitygroupids=[self.aff_grp[0].id], affinitygroupnames=[self.aff_grp[1].name]) | ||||||
|  | 
 | ||||||
|  |         vm1.update_affinity_group(self.api_client, affinitygroupids=[]) | ||||||
|  | 
 | ||||||
|  |         vm1.delete(self.api_client) | ||||||
|  |         # Can cleanup affinity groups since none are set on the VM | ||||||
|  |         for aff_grp in aff_grps: | ||||||
|  |             aff_grp.delete(self.api_client) | ||||||
|  | 
 | ||||||
| class TestDeployVMAffinityGroups(cloudstackTestCase): | class TestDeployVMAffinityGroups(cloudstackTestCase): | ||||||
| 
 | 
 | ||||||
|     @classmethod |     @classmethod | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user