From 15eab829c737dc9ec97721b9bab94c271d0a390d Mon Sep 17 00:00:00 2001 From: Sudhansu Date: Fri, 2 Dec 2016 15:49:08 +0530 Subject: [PATCH 01/11] CLOUDSTACK-9649: In the management server log there is an error related to 0.0.0.0 IP address Added guest ip of VR as control ip for a Basic zone with VMware. --- .../VirtualNetworkApplianceManagerImpl.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 3332393f652..e877f023702 100644 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1208,10 +1208,9 @@ Configurable, StateListener nics = _nicDao.listByVmId(router.getId()); + for (final NicVO nic : nics) { + final NetworkVO nc = _networkDao.findById(nic.getNetworkId()); + if (nc.getTrafficType() == TrafficType.Guest && nic.getIPv4Address() != null) { + controlIP = nic.getIPv4Address(); + break; + } + } + s_logger.debug("Vmware with Basic network selected Guest NIC ip as control IP " + controlIP ); + }else{ + controlIP = _routerControlHelper.getRouterControlIp(router.getId()); + } + + s_logger.debug("IP of control NIC " + controlIP ); + return controlIP; + } + @Override public boolean finalizeVirtualMachineProfile(final VirtualMachineProfile profile, final DeployDestination dest, final ReservationContext context) { From e8a4a19cc934e54c9a650eb42341c0cebfde60d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Aur=C3=A8le=20Brothier?= Date: Tue, 15 Nov 2016 09:39:11 +0100 Subject: [PATCH 02/11] CLOUDSTACK-9597: Should not fetch resource count for removed entity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-Aurèle Brothier --- .../configuration/dao/ResourceCountDaoImpl.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java b/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java index 879515a455e..f7cd3cbf86f 100644 --- a/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java +++ b/engine/schema/src/com/cloud/configuration/dao/ResourceCountDaoImpl.java @@ -21,8 +21,12 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.annotation.PostConstruct; import javax.inject.Inject; +import com.cloud.domain.DomainVO; +import com.cloud.user.AccountVO; +import com.cloud.utils.db.JoinBuilder; import org.springframework.stereotype.Component; import com.cloud.configuration.Resource; @@ -59,11 +63,21 @@ public class ResourceCountDaoImpl extends GenericDaoBase TypeSearch.done(); AccountSearch = createSearchBuilder(); + DomainSearch = createSearchBuilder(); + } + + @PostConstruct + protected void configure() { AccountSearch.and("accountId", AccountSearch.entity().getAccountId(), SearchCriteria.Op.NNULL); + SearchBuilder joinAccount = _accountDao.createSearchBuilder(); + joinAccount.and("notremoved", joinAccount.entity().getRemoved(), SearchCriteria.Op.NULL); + AccountSearch.join("account", joinAccount, AccountSearch.entity().getAccountId(), joinAccount.entity().getId(), JoinBuilder.JoinType.INNER); AccountSearch.done(); - DomainSearch = createSearchBuilder(); DomainSearch.and("domainId", DomainSearch.entity().getDomainId(), SearchCriteria.Op.NNULL); + SearchBuilder joinDomain = _domainDao.createSearchBuilder(); + joinDomain.and("notremoved", joinDomain.entity().getRemoved(), SearchCriteria.Op.NULL); + DomainSearch.join("domain", joinDomain, DomainSearch.entity().getDomainId(), joinDomain.entity().getId(), JoinBuilder.JoinType.INNER); DomainSearch.done(); } From 25efc1acd6ee5b14244b5000643f388b5414c300 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Maharana Date: Wed, 7 Dec 2016 13:29:30 +0530 Subject: [PATCH 03/11] CLOUDSTACK-9639: Unable to create shared network with vLan isolation --- .../cloud/configuration/ConfigurationManagerImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index f8a1fac90fd..c70d7a17967 100644 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -3052,12 +3052,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati // Check if the new VLAN's subnet conflicts with the guest network // in // the specified zone (guestCidr is null for basic zone) + // when adding shared network with same cidr of zone guest cidr, + // if the specified vlan is not present in zone, physical network, allow to create the network as the isolation is based on VLAN. final String guestNetworkCidr = zone.getGuestNetworkCidr(); - if (guestNetworkCidr != null) { - if (NetUtils.isNetworksOverlap(newCidr, guestNetworkCidr)) { - throw new InvalidParameterValueException("The new IP range you have specified has overlapped with the guest network in zone: " + zone.getName() - + ". Please specify a different gateway/netmask."); - } + if (guestNetworkCidr != null && NetUtils.isNetworksOverlap(newCidr, guestNetworkCidr) && _zoneDao.findVnet(zoneId, physicalNetworkId, vlanId).isEmpty() != true) { + throw new InvalidParameterValueException("The new IP range you have specified has overlapped with the guest network in zone: " + zone.getName() + + "along with existing Vlan also. Please specify a different gateway/netmask"); } // Check if there are any errors with the IP range From fed58eebdd04cf656ada7037d5c43214c1f23b61 Mon Sep 17 00:00:00 2001 From: Jayapalu Date: Thu, 8 Dec 2016 16:27:16 +0530 Subject: [PATCH 04/11] CLOUDSTACK-9615: Fixed applying ingress rules without ports --- systemvm/patches/debian/config/opt/cloud/bin/configure.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/config/opt/cloud/bin/configure.py index dd62f1aa605..5a2a9eda296 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/configure.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/configure.py @@ -122,10 +122,10 @@ class CsAcl(CsDataBag): rnge = '' if "first_port" in self.rule.keys() and \ self.rule['first_port'] == self.rule['last_port']: - rnge = self.rule['first_port'] + rnge = " --dport %s " %self.rule['first_port'] if "first_port" in self.rule.keys() and \ self.rule['first_port'] != self.rule['last_port']: - rnge = "%s:%s" % (rule['first_port'], rule['last_port']) + rnge = " --dport %s:%s" % (rule['first_port'], rule['last_port']) if self.direction == 'ingress': if rule['protocol'] == "icmp": self.fw.append(["mangle", "front", @@ -140,7 +140,7 @@ class CsAcl(CsDataBag): " -s %s " % cidr + " -p %s " % rule['protocol'] + " -m %s " % rule['protocol'] + - " --dport %s -j RETURN" % rnge]) + " %s -j RETURN" % rnge]) logging.debug("Current ACL IP direction is ==> %s", self.direction) if self.direction == 'egress': @@ -174,7 +174,7 @@ class CsAcl(CsDataBag): fwr += " -s %s " % cidr + \ " -p %s " % rule['protocol'] + \ " -m %s " % rule['protocol'] + \ - " --dport %s" % rnge + " %s" % rnge elif rule['protocol'] == "all": fwr += " -s %s " % cidr From d2ca30a1330bdd5931b8a059a8db7a4cf1327d80 Mon Sep 17 00:00:00 2001 From: Jayapalu Date: Mon, 12 Dec 2016 11:57:12 +0530 Subject: [PATCH 05/11] CLOUDSTACK-9617: Fixed enabling remote access after PF or LB configured on vpn tcp ports --- .../com/cloud/network/firewall/FirewallManagerImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java index b7e0d1412d0..d633a8ba869 100644 --- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java +++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java @@ -429,7 +429,13 @@ public class FirewallManagerImpl extends ManagerBase implements FirewallService, boolean allowStaticNat = (rule.getPurpose() == Purpose.StaticNat && newRule.getPurpose() == Purpose.StaticNat && !newRule.getProtocol().equalsIgnoreCase(rule.getProtocol())); - if (!(allowPf || allowStaticNat || oneOfRulesIsFirewall)) { + boolean allowVpnPf = + (rule.getPurpose() == Purpose.PortForwarding && newRule.getPurpose() == Purpose.Vpn && !newRule.getProtocol().equalsIgnoreCase(rule.getProtocol())); + + boolean allowVpnLb = + (rule.getPurpose() == Purpose.LoadBalancing && newRule.getPurpose() == Purpose.Vpn && !newRule.getProtocol().equalsIgnoreCase(rule.getProtocol())); + + if (!(allowPf || allowStaticNat || oneOfRulesIsFirewall || allowVpnPf || allowVpnLb)) { throw new NetworkRuleConflictException("The range specified, " + newRule.getSourcePortStart() + "-" + newRule.getSourcePortEnd() + ", conflicts with rule " + rule.getId() + " which has " + rule.getSourcePortStart() + "-" + rule.getSourcePortEnd()); } From 32e9e29a17a04fc844f75e25f611b860528835f1 Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Wed, 14 Dec 2016 00:10:42 +0530 Subject: [PATCH 06/11] CLOUDSTACK-9673 Exception occured while creating the CPVM in the VmWare Setup over standard vSwitches Issue ==== Exception occured while creating the CPVM in the VmWare Setup using standard vswitches. StartCommand failed due to Exception: com.vmware.vim25.AlreadyExists message: [] com.vmware.vim25.AlreadyExistsFaultMsg: The specified key, name, or identifier already exists Fix === Ensure synchronization while attempting to create port group such that simultaneous attempts are not made with same port group name on same ESXi host. Signed-off-by: Sateesh Chodapuneedi --- .../vmware/resource/VmwareResource.java | 16 +++--- .../cloud/hypervisor/vmware/mo/HostMO.java | 54 +++++++++++++++++++ .../vmware/mo/HypervisorHostHelper.java | 7 ++- 3 files changed, 65 insertions(+), 12 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 830a75b4951..ad4ae267528 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -1125,11 +1125,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa * so we assume that it's VLAN for now */ if (VirtualSwitchType.StandardVirtualSwitch == vSwitchType) { - synchronized (vmMo.getRunningHost().getMor().getValue().intern()) { - networkInfo = - HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), "cloud.public", vmMo.getRunningHost(), vlanId, null, null, - _opsTimeout, true, BroadcastDomainType.Vlan, null); - } + networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), + "cloud.public", vmMo.getRunningHost(), vlanId, null, null, + _opsTimeout, true, BroadcastDomainType.Vlan, null); } else { networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), "cloud.public", vmMo.getRunningHost(), vlanId, null, null, null, @@ -2852,11 +2850,9 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa s_logger.info("Prepare network on " + switchType + " " + switchName + " with name prefix: " + namePrefix); if (VirtualSwitchType.StandardVirtualSwitch == switchType) { - synchronized(hostMo.getMor().getValue().intern()) { - networkInfo = HypervisorHostHelper.prepareNetwork(switchName, namePrefix, hostMo, getVlanInfo(nicTo, vlanToken), nicTo.getNetworkRateMbps(), - nicTo.getNetworkRateMulticastMbps(), _opsTimeout, - !namePrefix.startsWith("cloud.private"), nicTo.getBroadcastType(), nicTo.getUuid()); - } + networkInfo = HypervisorHostHelper.prepareNetwork(switchName, namePrefix, hostMo, + getVlanInfo(nicTo, vlanToken), nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), + _opsTimeout, !namePrefix.startsWith("cloud.private"), nicTo.getBroadcastType(), nicTo.getUuid()); } else { String vlanId = getVlanInfo(nicTo, vlanToken); diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java index d8fa7f355db..c008e6b01e7 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java @@ -1110,4 +1110,58 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost { } return networkName; } + + public void createPortGroup(HostVirtualSwitch vSwitch, String portGroupName, Integer vlanId, + HostNetworkSecurityPolicy secPolicy, HostNetworkTrafficShapingPolicy shapingPolicy, long timeOutMs) + throws Exception { + assert (portGroupName != null); + + // Prepare lock to avoid simultaneous execution of the synchronized block for + // duplicate port groups on the ESXi host it's being created on. + String hostPortGroup = _mor.getValue() + "-" + portGroupName; + synchronized (hostPortGroup.intern()) { + // Check if port group exists already + if (hasPortGroup(vSwitch, portGroupName)) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Found port group " + portGroupName + " in vSwitch " + vSwitch.getName() + + ". Not attempting to create port group as it already exists."); + } + return; + } else { + if (s_logger.isDebugEnabled()) { + s_logger.debug("Port group " + portGroupName + " doesn't exist in vSwitch " + vSwitch.getName() + + ". Attempting to create port group in this vSwitch."); + } + } + // Create port group if not exists already + createPortGroup(vSwitch, portGroupName, vlanId, secPolicy, shapingPolicy); + + // Wait for port group to turn up ready on vCenter upto timeout of timeOutMs milli seconds + waitForPortGroup(portGroupName, timeOutMs); + } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("Successfully created port group " + portGroupName + " in vSwitch " + vSwitch.getName() + + " on host " + getHostName()); + } + } + + public ManagedObjectReference waitForPortGroup(String networkName, long timeOutMs) throws Exception { + ManagedObjectReference morNetwork = null; + // if portGroup is just created, getNetwork may fail to retrieve it, we + // need to retry + long startTick = System.currentTimeMillis(); + while (System.currentTimeMillis() - startTick <= timeOutMs) { + morNetwork = getNetworkMor(networkName); + if (morNetwork != null) { + break; + } + + if (s_logger.isInfoEnabled()) { + s_logger.info("Waiting for network " + networkName + " to be ready"); + } + Thread.sleep(1000); + } + return morNetwork; + } } diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java index fb63b1218b4..71c007d2279 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java @@ -1082,8 +1082,11 @@ public class HypervisorHostHelper { } } else { if (!hostMo.hasPortGroup(vSwitch, networkName)) { - hostMo.createPortGroup(vSwitch, networkName, vid, secPolicy, shapingPolicy); - bWaitPortGroupReady = true; + hostMo.createPortGroup(vSwitch, networkName, vid, secPolicy, shapingPolicy, timeOutMs); + // Setting flag "bWaitPortGroupReady" to false. + // This flag indicates whether we need to wait for portgroup on vCenter. + // Above createPortGroup() method itself ensures creation of portgroup as well as wait for portgroup. + bWaitPortGroupReady = false; } else { HostPortGroupSpec spec = hostMo.getPortGroupSpec(networkName); if (!isSpecMatch(spec, vid, shapingPolicy)) { From 674bb064a343ea755c2f7dd3e173f8e0de6d2d85 Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Wed, 14 Dec 2016 01:52:15 +0530 Subject: [PATCH 07/11] CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots Issue ==== Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM. Per the code that detects the presence of a snapshot, we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree. The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM. This results in start failure. Fix === Ensure correct detection of VM snapshots in the VM snapshot tree Signed-off-by: Sateesh Chodapuneedi --- .../com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java index 8b9d4e73bea..22c0b5a9e0a 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java @@ -661,7 +661,14 @@ public class VirtualMachineMO extends BaseMO { public boolean hasSnapshot() throws Exception { VirtualMachineSnapshotInfo info = getSnapshotInfo(); if (info != null) { - return info.getCurrentSnapshot() != null; + ManagedObjectReference currentSnapshot = info.getCurrentSnapshot(); + if (currentSnapshot != null) { + return true; + } + List rootSnapshotList = info.getRootSnapshotList(); + if (rootSnapshotList != null && rootSnapshotList.size() > 0) { + return true; + } } return false; } From 7d678dfcaeaae7ea813132fc9a85572321032c3d Mon Sep 17 00:00:00 2001 From: Jayapalu Date: Thu, 24 Nov 2016 16:17:09 +0530 Subject: [PATCH 08/11] CLOUDSTACK-9612: Fixed issue in restarting redundant network with cleanup Rvr Network with cleanup which is updated from the isolated network is failed. Corrected the column name string issue. This closes #1781 (cherry picked from commit 0f742e17237fc84d5e86dae9a67c7ef6a0b6c80c) Signed-off-by: Rohit Yadav --- engine/schema/src/com/cloud/network/dao/NetworkVO.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java index 5b8ded76649..ee5c6b54ef8 100644 --- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java +++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java @@ -104,7 +104,7 @@ public class NetworkVO implements Network { State state; @Column(name = "redundant") - boolean isRedundant; + boolean redundant; @Column(name = "dns1") String dns1; @@ -205,7 +205,7 @@ public class NetworkVO implements Network { this.networkOfferingId = networkOfferingId; this.dataCenterId = dataCenterId; this.physicalNetworkId = physicalNetworkId; - this.isRedundant = isRedundant; + this.redundant = isRedundant; if (state == null) { this.state = State.Allocated; } else { @@ -301,7 +301,7 @@ public class NetworkVO implements Network { @Override public boolean isRedundant() { - return this.isRedundant; + return this.redundant; } // don't use this directly when possible, use Network state machine instead @@ -632,7 +632,7 @@ public class NetworkVO implements Network { } public void setIsReduntant(boolean reduntant) { - this.isRedundant = reduntant; + this.redundant = reduntant; } } From b0535d770d108ae219149b5a115c8953d89691d9 Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Wed, 14 Dec 2016 01:52:15 +0530 Subject: [PATCH 09/11] CLOUDSTACK-9676 Start instance fails after reverting to a VM snapshot, when there are child VM snapshots Issue ==== Start instance fails after reverting to a VM snapshot, when there is 1 or more child VM snapshots in the snapshot tree of the VM. Per the code that detects the presence of a snapshot, we are checking for only current snapshot instead of checking presence of any snapshot in the snapshot tree. The failure to detect all snapshots means ACP reconfigures the VM in wrong way assuming there are no snapshots for the VM. This results in start failure. Fix === Ensure correct detection of VM snapshots in the VM snapshot tree This closes #1828 Signed-off-by: Sateesh Chodapuneedi (cherry picked from commit 673bb25b5936d1c54e9210781280e9ddc507c830) Signed-off-by: Rohit Yadav --- .../com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java index 8b9d4e73bea..22c0b5a9e0a 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java @@ -661,7 +661,14 @@ public class VirtualMachineMO extends BaseMO { public boolean hasSnapshot() throws Exception { VirtualMachineSnapshotInfo info = getSnapshotInfo(); if (info != null) { - return info.getCurrentSnapshot() != null; + ManagedObjectReference currentSnapshot = info.getCurrentSnapshot(); + if (currentSnapshot != null) { + return true; + } + List rootSnapshotList = info.getRootSnapshotList(); + if (rootSnapshotList != null && rootSnapshotList.size() > 0) { + return true; + } } return false; } From cdbe847d29cb077f18913c981459d6b923dc458a Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 22 Dec 2016 15:20:54 +0530 Subject: [PATCH 10/11] CLOUDSTACK-9688: Fix failing test_volumes on centos7/kvm Due to OS/hypervisor/environmental configuration, detaching a disk/device using libvirt can be successful without updating the domain configuration (xml). This leads to reattachment failure as the device is blocked until the next reboot. This fixes a specific environment case by performing stop/start on the VM only in case of KVM, which will recreate a fresh domain config (xml) as KVM VMs have transient domain configs (xmls don't persist). Signed-off-by: Rohit Yadav --- test/integration/smoke/test_volumes.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 4dcf26387ad..28087b11262 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -378,6 +378,11 @@ class TestVolumes(cloudstackTestCase): #Clean up, terminate the created volumes if self.attached: self.virtual_machine.detach_volume(self.apiClient, self.volume) + + if self.virtual_machine.hypervisor == "KVM": + self.virtual_machine.stop(self.apiClient) + self.virtual_machine.start(self.apiClient) + cleanup_resources(self.apiClient, self.cleanup) return From b25bb10c5905506f37d5ddf9576aa40247a25d18 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 23 Dec 2016 14:46:36 +0530 Subject: [PATCH 11/11] CLOUDSTACK-9688: Fix VR smoke test failure in vpc_vpn The test_vpc_vpn uses a cidr that overlaps with the base test environment's CIDR causing intermittent failure. This changes the cidr to not overlap with underlying infra and avoid future failures. Signed-off-by: Rohit Yadav --- test/integration/smoke/test_vpc_vpn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 966f40d4071..ddf76930050 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -168,7 +168,7 @@ class Services: "vpc2": { "name": "TestVPC", "displaytext": "VPC2", - "cidr": '10.2.0.0/16' + "cidr": '10.3.0.0/16' }, "network_1": { "name": "Test Network", @@ -180,13 +180,13 @@ class Services: "name": "Test Network", "displaytext": "Test Network", "netmask": '255.255.255.0', - "gateway": "10.2.1.1" + "gateway": "10.3.1.1" }, "vpn": { "vpn_user": "root", "vpn_pass": "Md1s#dc", "vpn_pass_fail": "abc!123", # too short - "iprange": "10.2.2.1-10.2.2.10", + "iprange": "10.3.2.1-10.3.2.10", "fordisplay": "true" }, "vpncustomergateway": {