cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rhtyd closed pull request #2403: CLOUDSTACK-10227: Stabilization fixes for 4.11.0.0
Date Thu, 01 Jan 1970 00:00:00 GMT
rhtyd closed pull request #2403: CLOUDSTACK-10227: Stabilization fixes for 4.11.0.0
URL: https://github.com/apache/cloudstack/pull/2403
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/api/src/org/apache/cloudstack/api/response/HostHAResponse.java b/api/src/org/apache/cloudstack/api/response/HostHAResponse.java
index 942250cbc21..a8b44bd5649 100644
--- a/api/src/org/apache/cloudstack/api/response/HostHAResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/HostHAResponse.java
@@ -84,6 +84,9 @@ public void setEnabled(Boolean enabled) {
 
     public void setHaState(HAConfig.HAState haState) {
         this.haState = haState;
+        if (haState == null) {
+            this.haState = HAConfig.HAState.Disabled;
+        }
     }
 
     public String getProvider() {
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
index 6afd976e7e2..53c2340665f 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java
@@ -167,7 +167,6 @@ private void updateSystemVmTemplates(final Connection conn) {
 
         final Map<Hypervisor.HypervisorType, String> newTemplateUrl = new HashMap<Hypervisor.HypervisorType,
String>() {
             {
-                // FIXME: upload templates
                 put(Hypervisor.HypervisorType.KVM, "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2");
                 put(Hypervisor.HypervisorType.VMware, "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-vmware.ova");
                 put(Hypervisor.HypervisorType.XenServer, "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-xen.vhd.bz2");
@@ -179,13 +178,12 @@ private void updateSystemVmTemplates(final Connection conn) {
 
         final Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new HashMap<Hypervisor.HypervisorType,
String>() {
             {
-                // FIXME: update checksums?
-                put(Hypervisor.HypervisorType.KVM, "bc2eac46f16a2ece6c19d4b89db41de3");
-                put(Hypervisor.HypervisorType.XenServer, "908c28a8d4c232f960e0f84af7f86c80");
-                put(Hypervisor.HypervisorType.VMware, "970bfb070a80bd74820881d8149643c1");
-                put(Hypervisor.HypervisorType.Hyperv, "0adb35bd9f92e80d3fc63fcdd9bb55e5");
-                put(Hypervisor.HypervisorType.LXC, "bc2eac46f16a2ece6c19d4b89db41de3");
-                put(Hypervisor.HypervisorType.Ovm3, "94a41f0a5361933813bb34a51df56f56");
+                put(Hypervisor.HypervisorType.KVM, "2d8d1e4eacc976814b97f02849481433");
+                put(Hypervisor.HypervisorType.XenServer, "a5ecf7ed485e2da5ec1993069aa60553");
+                put(Hypervisor.HypervisorType.VMware, "84dab5d1e8267b5dc85eb4eaa21a1efe");
+                put(Hypervisor.HypervisorType.Hyperv, "d592ab6a2271303fe75b6a27f8e6bd53");
+                put(Hypervisor.HypervisorType.LXC, "2d8d1e4eacc976814b97f02849481433");
+                put(Hypervisor.HypervisorType.Ovm3, "60fe2227b89a8980ee09f89dc7b19582");
             }
         };
 
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index ef9d0278598..898118fa96d 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -130,8 +130,6 @@ Requires: perl
 Requires: libvirt-python
 Requires: qemu-img
 Requires: qemu-kvm
-Requires: epel-release
-Requires: aria2
 Provides: cloud-agent
 Obsoletes: cloud-agent < 4.1.0
 Obsoletes: cloud-agent-libs < 4.1.0
diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec
index 78ee7d55199..f16858a4a8f 100644
--- a/packaging/centos7/cloud.spec
+++ b/packaging/centos7/cloud.spec
@@ -111,8 +111,6 @@ Requires: perl
 Requires: libvirt-python
 Requires: qemu-img
 Requires: qemu-kvm
-Requires: epel-release
-Requires: aria2
 Provides: cloud-agent
 Group: System Environment/Libraries
 %description agent
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index 10832593589..bfa73af6bcd 100644
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -451,6 +451,7 @@ public boolean delete(TemplateProfile profile) {
 
         if (imageStores == null || imageStores.size() == 0) {
             // already destroyed on image stores
+            success = true;
             s_logger.info("Unable to find image store still having template: " + template.getName()
+ ", so just mark the template removed");
         } else {
             // Make sure the template is downloaded to all found image stores
@@ -536,10 +537,7 @@ public boolean delete(TemplateProfile profile) {
                                 templateZoneDao.remove(templateZone.getId());
                             }
                         }
-                    } catch (InterruptedException e) {
-                        s_logger.debug("Delete template Failed", e);
-                        throw new CloudRuntimeException("Delete template Failed", e);
-                    } catch (ExecutionException e) {
+                    } catch (InterruptedException|ExecutionException e) {
                         s_logger.debug("Delete template Failed", e);
                         throw new CloudRuntimeException("Delete template Failed", e);
                     }
@@ -551,7 +549,7 @@ public boolean delete(TemplateProfile profile) {
 
         }
         if (success) {
-            if ((imageStores.size() > 1) && (profile.getZoneIdList() != null))
{
+            if ((imageStores != null && imageStores.size() > 1) && (profile.getZoneIdList()
!= null)) {
                 //if template is stored in more than one image stores, and the zone id is
not null, then don't delete other templates.
                 return success;
             }
diff --git a/server/src/org/apache/cloudstack/ha/HAManagerImpl.java b/server/src/org/apache/cloudstack/ha/HAManagerImpl.java
index 49d9432fa15..86ac0376de4 100644
--- a/server/src/org/apache/cloudstack/ha/HAManagerImpl.java
+++ b/server/src/org/apache/cloudstack/ha/HAManagerImpl.java
@@ -199,13 +199,16 @@ private boolean checkHAOwnership(final HAConfig haConfig) {
 
     private HAResource validateAndFindHAResource(final HAConfig haConfig) {
         HAResource resource = null;
+        if (haConfig == null) {
+            return null;
+        }
         if (haConfig.getResourceType() == HAResource.ResourceType.Host) {
             final Host host = hostDao.findById(haConfig.getResourceId());
             if (host != null && host.getRemoved() != null) {
                 return null;
             }
             resource = host;
-            if (resource == null && haConfig.getState() != HAConfig.HAState.Disabled)
{
+            if (haConfig.getState() == null || (resource == null && haConfig.getState()
!= HAConfig.HAState.Disabled)) {
                 disableHA(haConfig.getResourceId(), haConfig.getResourceType());
                 return null;
             }
@@ -224,6 +227,9 @@ private HAResource validateAndFindHAResource(final HAConfig haConfig)
{
     }
 
     private HAProvider<HAResource> validateAndFindHAProvider(final HAConfig haConfig,
final HAResource resource) {
+        if (haConfig == null) {
+            return null;
+        }
         final HAProvider<HAResource> haProvider = haProviderMap.get(haConfig.getHaProvider());
         if (haProvider != null && !haProvider.isEligible(resource)) {
             if (haConfig.getState() != HAConfig.HAState.Ineligible) {
@@ -639,6 +645,10 @@ protected void runInContext() {
                 }
                 final List<HAConfig> haConfigList = new ArrayList<HAConfig>(haConfigDao.listAll());
                 for (final HAConfig haConfig : haConfigList) {
+                    if (haConfig == null) {
+                        continue;
+                    }
+
                     if (!checkHAOwnership(haConfig)) {
                         continue;
                     }
diff --git a/test/integration/smoke/test_hostha_simulator.py b/test/integration/smoke/test_hostha_simulator.py
index bb5fcb97c37..4dfb9e9ba6c 100644
--- a/test/integration/smoke/test_hostha_simulator.py
+++ b/test/integration/smoke/test_hostha_simulator.py
@@ -352,6 +352,7 @@ def test_ha_configure_enabledisable_across_clusterzones(self):
             Zone > Cluster > Host
         """
         host = self.getHost()
+        self.configureAndDisableHostHa(host.id)
         self.configureAndEnableHostHa()
 
         self.checkSyncToState('Available')
diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py
index 664fdb4d482..92b35ad3fa4 100644
--- a/test/integration/smoke/test_public_ip_range.py
+++ b/test/integration/smoke/test_public_ip_range.py
@@ -218,7 +218,7 @@ def checkSystemVMUp():
                     return True, response[0].id
             return False, None
 
-        res, systemvmId = wait_until(3, 100, checkSystemVMUp)
+        res, systemvmId = wait_until(3, 200, checkSystemVMUp)
         if not res:
             raise Exception("Failed to wait for systemvm to be running")
         return systemvmId
@@ -336,13 +336,13 @@ def exists_public_ip_range_for_system_vms(self, zoneid):
         return False
 
     @attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
-    def test_dedicate_public_ip_range_for_system_vms_cpvm(self):
-        """Test CPVM Public IP
+    def test_dedicate_public_ip_range_for_system_vms_01_ssvm(self):
+        """Test SSVM Public IP
         """
         self.debug("Precondition: No public IP range dedicated for system vms in the environment")
         if self.exists_public_ip_range_for_system_vms(self.services["zoneid"]):
             self.skipTest("An existing IP range defined for system vms, aborting test")
-        
+
         services = {
             "gateway":"192.168.100.1",
             "netmask":"255.255.255.0",
@@ -355,13 +355,13 @@ def test_dedicate_public_ip_range_for_system_vms_cpvm(self):
 
         self.base_system_vm(
             services,
-            'consoleproxy'
+            'secondarystoragevm'
         )
         return
 
     @attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
-    def test_dedicate_public_ip_range_for_system_vms_ssvm(self):
-        """Test SSVM Public IP
+    def test_dedicate_public_ip_range_for_system_vms_02_cpvm(self):
+        """Test CPVM Public IP
         """
         self.debug("Precondition: No public IP range dedicated for system vms in the environment")
         if self.exists_public_ip_range_for_system_vms(self.services["zoneid"]):
@@ -379,6 +379,6 @@ def test_dedicate_public_ip_range_for_system_vms_ssvm(self):
 
         self.base_system_vm(
             services,
-            'secondarystoragevm'
+            'consoleproxy'
         )
         return
diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py
index f69761980cd..ad5c4ab344b 100644
--- a/test/integration/smoke/test_ssvm.py
+++ b/test/integration/smoke/test_ssvm.py
@@ -198,7 +198,6 @@ def test_01_list_sec_storage_vm(self):
                 True,
                 "Check list response returns a valid list"
             )
-            iprange = ipranges_response[0]
 
             # Fetch corresponding Physical Network of SSVM's Zone
             listphyntwk = PhysicalNetwork.list(
@@ -213,9 +212,14 @@ def test_01_list_sec_storage_vm(self):
                         self.apiclient,
                         physicalnetworkid=listphyntwk[0].id),
                     list) is True):
-                self.assertEqual(
-                    ssvm.gateway,
-                    iprange.gateway,
+                gatewayFound = False
+                for iprange in ipranges_response:
+                    if ssvm.gateway == iprange.gateway:
+                        gatewayFound = True
+                        break
+
+                self.assertTrue(
+                    gatewayFound,
                     "Check gateway with that of corresponding ip range"
                 )
 
@@ -333,7 +337,6 @@ def test_02_list_cpvm_vm(self):
                 True,
                 "Check list response returns a valid list"
             )
-            iprange = ipranges_response[0]
 
             # Fetch corresponding Physical Network of SSVM's Zone
             listphyntwk = PhysicalNetwork.list(
@@ -348,13 +351,13 @@ def test_02_list_cpvm_vm(self):
                         self.apiclient,
                         physicalnetworkid=listphyntwk[0].id),
                     list) is True):
-                cpvmValidGateway = False
+                gatewayFound = False
                 for iprange in ipranges_response:
                     if iprange.gateway == cpvm.gateway:
-                        cpvmValidGateway = True
+                        gatewayFound = True
                         break
                 self.assertTrue(
-                    cpvmValidGateway,
+                    gatewayFound,
                     "Check gateway with that of corresponding ip range"
                 )
 
diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py
index 22fead94d66..7057abe3342 100644
--- a/test/integration/smoke/test_templates.py
+++ b/test/integration/smoke/test_templates.py
@@ -540,7 +540,6 @@ def setUpClass(cls):
         cls.services["template"]["ostypeid"] = template.ostypeid
         cls.services["template_2"]["ostypeid"] = template.ostypeid
         cls.services["ostypeid"] = template.ostypeid
-        cls.services["isdynamicallyscalable"] = template.isdynamicallyscalable
         cls.account = Account.create(
                             cls.apiclient,
                             cls.services["account"],
@@ -590,6 +589,7 @@ def setUpClass(cls):
                                          account=cls.account.name,
                                          domainid=cls.account.domainid
                                          )
+        cls.services["isdynamicallyscalable"] = cls.template_1.isdynamicallyscalable
         cls.template_2 = Template.create(
                                          cls.apiclient,
                                          cls.services["template_2"],
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 879f7b56957..d40c0fd065f 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -246,8 +246,6 @@ def test_01_create_volume(self):
                 ret = checkVolumeSize(ssh_handle=ssh,volume_name=volume_name,size_to_verify=vol_sz)
             elif list_volume_response[0].hypervisor.lower() == "hyperv":
                 ret = checkVolumeSize(ssh_handle=ssh,volume_name="/dev/sdb",size_to_verify=vol_sz)
-            elif list_volume_response[0].hypervisor.lower() == "vmware":
-                ret = checkVolumeSize(ssh_handle=ssh,volume_name="/dev/sdb",size_to_verify=vol_sz)
             else:
                 ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz)
             self.debug(" Volume Size Expected %s  Actual :%s" %(vol_sz,ret[1]))
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 5f601d839e4..d9d3af0deb0 100755
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -258,8 +258,9 @@
                                                     $form.find('.form-item[rel=rootDiskControllerTypeKVM]').hide();
                                                     $form.find('.form-item[rel=directdownload]').hide();
 
-                                                    if (isAdmin())
+                                                    if (isAdmin()) {
                                                         $form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display',
'inline-block');
+                                                    }
                                                 } else if ($(this).val() == "KVM") {
                                                     $form.find('.form-item[rel=rootDiskControllerType]').hide();
                                                     $form.find('.form-item[rel=nicAdapterType]').hide();
@@ -267,7 +268,9 @@
                                                     $form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
                                                     $form.find('.form-item[rel=rootDiskControllerTypeKVM]').css('display',
'inline-block');
                                                     $form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display',
'inline-block');
-                                                    $form.find('.form-item[rel=directdownload]').css('display',
'inline-block');
+                                                    if (isAdmin()) {
+                                                      $form.find('.form-item[rel=directdownload]').css('display',
'inline-block');
+                                                    }
                                                 } else {
                                                     $form.find('.form-item[rel=rootDiskControllerType]').hide();
                                                     $form.find('.form-item[rel=nicAdapterType]').hide();
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 5f64e83c770..22bfafc2bad 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
@@ -1039,7 +1039,7 @@ public ComputeResourceSummary getHyperHostHardwareSummary() throws Exception
{
     @Override
     public boolean isHyperHostConnected() throws Exception {
         HostRuntimeInfo runtimeInfo = (HostRuntimeInfo)_context.getVimClient().getDynamicProperty(_mor,
"runtime");
-        return runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED;
+        return runtimeInfo != null && runtimeInfo.getConnectionState() == HostSystemConnectionState.CONNECTED;
     }
 
     public boolean revertToSnapshot(ManagedObjectReference morSnapshot) throws Exception
{


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message