Skip to content

Commit fa7c1e2

Browse files
authored
CLOUDSTACK-10227: Stabilization fixes for 4.11.0.0 (#2403)
This fixes regression failures seen in Trillian, fixes NPEs that cause Travis related failures. This also removes the aria2 dependency from rpms that require users to enable/install epel-release. This finally updates the checksums for 4.11 systemvmtemplates in db upgrade path. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent a30a31c commit fa7c1e2

File tree

13 files changed

+50
-40
lines changed

13 files changed

+50
-40
lines changed

api/src/org/apache/cloudstack/api/response/HostHAResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ public HAConfig.HAState getHaState() {
8484

8585
public void setHaState(HAConfig.HAState haState) {
8686
this.haState = haState;
87+
if (haState == null) {
88+
this.haState = HAConfig.HAState.Disabled;
89+
}
8790
}
8891

8992
public String getProvider() {

engine/schema/src/com/cloud/upgrade/dao/Upgrade41000to41100.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ private void updateSystemVmTemplates(final Connection conn) {
167167

168168
final Map<Hypervisor.HypervisorType, String> newTemplateUrl = new HashMap<Hypervisor.HypervisorType, String>() {
169169
{
170-
// FIXME: upload templates
171170
put(Hypervisor.HypervisorType.KVM, "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-kvm.qcow2.bz2");
172171
put(Hypervisor.HypervisorType.VMware, "https://download.cloudstack.org/systemvm/4.11/systemvmtemplate-4.11.0-vmware.ova");
173172
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) {
179178

180179
final Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new HashMap<Hypervisor.HypervisorType, String>() {
181180
{
182-
// FIXME: update checksums?
183-
put(Hypervisor.HypervisorType.KVM, "bc2eac46f16a2ece6c19d4b89db41de3");
184-
put(Hypervisor.HypervisorType.XenServer, "908c28a8d4c232f960e0f84af7f86c80");
185-
put(Hypervisor.HypervisorType.VMware, "970bfb070a80bd74820881d8149643c1");
186-
put(Hypervisor.HypervisorType.Hyperv, "0adb35bd9f92e80d3fc63fcdd9bb55e5");
187-
put(Hypervisor.HypervisorType.LXC, "bc2eac46f16a2ece6c19d4b89db41de3");
188-
put(Hypervisor.HypervisorType.Ovm3, "94a41f0a5361933813bb34a51df56f56");
181+
put(Hypervisor.HypervisorType.KVM, "2d8d1e4eacc976814b97f02849481433");
182+
put(Hypervisor.HypervisorType.XenServer, "a5ecf7ed485e2da5ec1993069aa60553");
183+
put(Hypervisor.HypervisorType.VMware, "84dab5d1e8267b5dc85eb4eaa21a1efe");
184+
put(Hypervisor.HypervisorType.Hyperv, "d592ab6a2271303fe75b6a27f8e6bd53");
185+
put(Hypervisor.HypervisorType.LXC, "2d8d1e4eacc976814b97f02849481433");
186+
put(Hypervisor.HypervisorType.Ovm3, "60fe2227b89a8980ee09f89dc7b19582");
189187
}
190188
};
191189

packaging/centos63/cloud.spec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ Requires: perl
130130
Requires: libvirt-python
131131
Requires: qemu-img
132132
Requires: qemu-kvm
133-
Requires: epel-release
134-
Requires: aria2
135133
Provides: cloud-agent
136134
Obsoletes: cloud-agent < 4.1.0
137135
Obsoletes: cloud-agent-libs < 4.1.0

packaging/centos7/cloud.spec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ Requires: perl
111111
Requires: libvirt-python
112112
Requires: qemu-img
113113
Requires: qemu-kvm
114-
Requires: epel-release
115-
Requires: aria2
116114
Provides: cloud-agent
117115
Group: System Environment/Libraries
118116
%description agent

server/src/com/cloud/template/HypervisorTemplateAdapter.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ public boolean delete(TemplateProfile profile) {
451451

452452
if (imageStores == null || imageStores.size() == 0) {
453453
// already destroyed on image stores
454+
success = true;
454455
s_logger.info("Unable to find image store still having template: " + template.getName() + ", so just mark the template removed");
455456
} else {
456457
// Make sure the template is downloaded to all found image stores
@@ -536,10 +537,7 @@ public boolean delete(TemplateProfile profile) {
536537
templateZoneDao.remove(templateZone.getId());
537538
}
538539
}
539-
} catch (InterruptedException e) {
540-
s_logger.debug("Delete template Failed", e);
541-
throw new CloudRuntimeException("Delete template Failed", e);
542-
} catch (ExecutionException e) {
540+
} catch (InterruptedException|ExecutionException e) {
543541
s_logger.debug("Delete template Failed", e);
544542
throw new CloudRuntimeException("Delete template Failed", e);
545543
}
@@ -551,7 +549,7 @@ public boolean delete(TemplateProfile profile) {
551549

552550
}
553551
if (success) {
554-
if ((imageStores.size() > 1) && (profile.getZoneIdList() != null)) {
552+
if ((imageStores != null && imageStores.size() > 1) && (profile.getZoneIdList() != null)) {
555553
//if template is stored in more than one image stores, and the zone id is not null, then don't delete other templates.
556554
return success;
557555
}

server/src/org/apache/cloudstack/ha/HAManagerImpl.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,16 @@ private boolean checkHAOwnership(final HAConfig haConfig) {
199199

200200
private HAResource validateAndFindHAResource(final HAConfig haConfig) {
201201
HAResource resource = null;
202+
if (haConfig == null) {
203+
return null;
204+
}
202205
if (haConfig.getResourceType() == HAResource.ResourceType.Host) {
203206
final Host host = hostDao.findById(haConfig.getResourceId());
204207
if (host != null && host.getRemoved() != null) {
205208
return null;
206209
}
207210
resource = host;
208-
if (resource == null && haConfig.getState() != HAConfig.HAState.Disabled) {
211+
if (haConfig.getState() == null || (resource == null && haConfig.getState() != HAConfig.HAState.Disabled)) {
209212
disableHA(haConfig.getResourceId(), haConfig.getResourceType());
210213
return null;
211214
}
@@ -224,6 +227,9 @@ private HAResource validateAndFindHAResource(final HAConfig haConfig) {
224227
}
225228

226229
private HAProvider<HAResource> validateAndFindHAProvider(final HAConfig haConfig, final HAResource resource) {
230+
if (haConfig == null) {
231+
return null;
232+
}
227233
final HAProvider<HAResource> haProvider = haProviderMap.get(haConfig.getHaProvider());
228234
if (haProvider != null && !haProvider.isEligible(resource)) {
229235
if (haConfig.getState() != HAConfig.HAState.Ineligible) {
@@ -639,6 +645,10 @@ protected void runInContext() {
639645
}
640646
final List<HAConfig> haConfigList = new ArrayList<HAConfig>(haConfigDao.listAll());
641647
for (final HAConfig haConfig : haConfigList) {
648+
if (haConfig == null) {
649+
continue;
650+
}
651+
642652
if (!checkHAOwnership(haConfig)) {
643653
continue;
644654
}

test/integration/smoke/test_hostha_simulator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ def test_ha_configure_enabledisable_across_clusterzones(self):
352352
Zone > Cluster > Host
353353
"""
354354
host = self.getHost()
355+
self.configureAndDisableHostHa(host.id)
355356
self.configureAndEnableHostHa()
356357

357358
self.checkSyncToState('Available')

test/integration/smoke/test_public_ip_range.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def checkSystemVMUp():
218218
return True, response[0].id
219219
return False, None
220220

221-
res, systemvmId = wait_until(3, 100, checkSystemVMUp)
221+
res, systemvmId = wait_until(3, 200, checkSystemVMUp)
222222
if not res:
223223
raise Exception("Failed to wait for systemvm to be running")
224224
return systemvmId
@@ -336,13 +336,13 @@ def exists_public_ip_range_for_system_vms(self, zoneid):
336336
return False
337337

338338
@attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
339-
def test_dedicate_public_ip_range_for_system_vms_cpvm(self):
340-
"""Test CPVM Public IP
339+
def test_dedicate_public_ip_range_for_system_vms_01_ssvm(self):
340+
"""Test SSVM Public IP
341341
"""
342342
self.debug("Precondition: No public IP range dedicated for system vms in the environment")
343343
if self.exists_public_ip_range_for_system_vms(self.services["zoneid"]):
344344
self.skipTest("An existing IP range defined for system vms, aborting test")
345-
345+
346346
services = {
347347
"gateway":"192.168.100.1",
348348
"netmask":"255.255.255.0",
@@ -355,13 +355,13 @@ def test_dedicate_public_ip_range_for_system_vms_cpvm(self):
355355

356356
self.base_system_vm(
357357
services,
358-
'consoleproxy'
358+
'secondarystoragevm'
359359
)
360360
return
361361

362362
@attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
363-
def test_dedicate_public_ip_range_for_system_vms_ssvm(self):
364-
"""Test SSVM Public IP
363+
def test_dedicate_public_ip_range_for_system_vms_02_cpvm(self):
364+
"""Test CPVM Public IP
365365
"""
366366
self.debug("Precondition: No public IP range dedicated for system vms in the environment")
367367
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):
379379

380380
self.base_system_vm(
381381
services,
382-
'secondarystoragevm'
382+
'consoleproxy'
383383
)
384384
return

test/integration/smoke/test_ssvm.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ def test_01_list_sec_storage_vm(self):
198198
True,
199199
"Check list response returns a valid list"
200200
)
201-
iprange = ipranges_response[0]
202201

203202
# Fetch corresponding Physical Network of SSVM's Zone
204203
listphyntwk = PhysicalNetwork.list(
@@ -213,9 +212,14 @@ def test_01_list_sec_storage_vm(self):
213212
self.apiclient,
214213
physicalnetworkid=listphyntwk[0].id),
215214
list) is True):
216-
self.assertEqual(
217-
ssvm.gateway,
218-
iprange.gateway,
215+
gatewayFound = False
216+
for iprange in ipranges_response:
217+
if ssvm.gateway == iprange.gateway:
218+
gatewayFound = True
219+
break
220+
221+
self.assertTrue(
222+
gatewayFound,
219223
"Check gateway with that of corresponding ip range"
220224
)
221225

@@ -333,7 +337,6 @@ def test_02_list_cpvm_vm(self):
333337
True,
334338
"Check list response returns a valid list"
335339
)
336-
iprange = ipranges_response[0]
337340

338341
# Fetch corresponding Physical Network of SSVM's Zone
339342
listphyntwk = PhysicalNetwork.list(
@@ -348,13 +351,13 @@ def test_02_list_cpvm_vm(self):
348351
self.apiclient,
349352
physicalnetworkid=listphyntwk[0].id),
350353
list) is True):
351-
cpvmValidGateway = False
354+
gatewayFound = False
352355
for iprange in ipranges_response:
353356
if iprange.gateway == cpvm.gateway:
354-
cpvmValidGateway = True
357+
gatewayFound = True
355358
break
356359
self.assertTrue(
357-
cpvmValidGateway,
360+
gatewayFound,
358361
"Check gateway with that of corresponding ip range"
359362
)
360363

test/integration/smoke/test_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,6 @@ def setUpClass(cls):
540540
cls.services["template"]["ostypeid"] = template.ostypeid
541541
cls.services["template_2"]["ostypeid"] = template.ostypeid
542542
cls.services["ostypeid"] = template.ostypeid
543-
cls.services["isdynamicallyscalable"] = template.isdynamicallyscalable
544543
cls.account = Account.create(
545544
cls.apiclient,
546545
cls.services["account"],
@@ -590,6 +589,7 @@ def setUpClass(cls):
590589
account=cls.account.name,
591590
domainid=cls.account.domainid
592591
)
592+
cls.services["isdynamicallyscalable"] = cls.template_1.isdynamicallyscalable
593593
cls.template_2 = Template.create(
594594
cls.apiclient,
595595
cls.services["template_2"],

0 commit comments

Comments
 (0)