Skip to content

Commit 66aeff8

Browse files
committed
smoke test failure + minor fixes
1 parent e82bcfd commit 66aeff8

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

api/src/main/java/com/cloud/vm/UserVmService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
416416
void deletePrivateTemplateRecord(Long templateId);
417417

418418
HypervisorType getHypervisorTypeOfUserVM(long vmid);
419-
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
419+
420+
UserVm createVirtualMachine(DeployVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException,
420421
StorageUnavailableException, ResourceAllocationException;
421422

422423
/**

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ public void allocate(final String vmInstanceName, final VirtualMachineTemplate t
573573
long diskOfferingSize = diskOffering.getDiskSize() / (1024 * 1024 * 1024);
574574
VMTemplateVO dataDiskTemplate = _templateDao.findById(dataDiskTemplateToDiskOfferingMap.getKey());
575575
volumeMgr.allocateRawVolume(Type.DATADISK, "DATA-" + persistedVm.getId() + "-" + String.valueOf( diskNumber), diskOffering, diskOfferingSize, null, null,
576-
persistedVm, dataDiskTemplate, owner, diskNumber);
577-
diskNumber++;
576+
persistedVm, dataDiskTemplate, owner, diskNumber);
577+
diskNumber++;
578578
}
579579
}
580580
} finally {

server/src/main/java/org/apache/cloudstack/resource/ResourceCleanupServiceImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,20 +324,18 @@ protected Pair<List<Long>, List<Long>> getFilteredVmIdsForSnapshotsAndBackups(Li
324324
}
325325
currentSkippedVmIds.addAll(vmIdsWithActiveVolumeSnapshots);
326326
}
327-
if (CollectionUtils.isNotEmpty(currentSkippedVmIds)) {
328-
vmIds.removeAll(currentSkippedVmIds);
329-
}
330327

331328
List<BackupVO> backups = backupDao.searchByVmIds(vmIds);
332-
if (CollectionUtils.isNotEmpty(activeSnapshots)) {
329+
if (CollectionUtils.isNotEmpty(backups)) {
333330
HashSet<Long> vmIdsWithBackups = backups.stream().map(BackupVO::getVmId)
334331
.collect(Collectors.toCollection(HashSet::new));
335332
if (logger.isDebugEnabled()) {
336333
logger.debug(String.format("Skipping purging VMs with IDs %s as they have backups",
337-
StringUtils.join(vmIdsWithActiveVolumeSnapshots)));
334+
StringUtils.join(vmIdsWithBackups)));
338335
}
339336
currentSkippedVmIds.addAll(vmIdsWithBackups);
340337
}
338+
341339
if (CollectionUtils.isNotEmpty(currentSkippedVmIds)) {
342340
vmIds.removeAll(currentSkippedVmIds);
343341
}

test/integration/smoke/test_attach_multiple_volumes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ def test_attach_multiple_volumes(self):
285285
self.query_async_job(vol3_jobId.jobid)
286286
self.query_async_job(vol4_jobId.jobid)
287287

288+
time.sleep(60)
289+
288290
# List all the volumes attached to the instance. Includes even the Root disk.
289291
list_volume_response = Volume.list(
290292
self.apiClient,
@@ -337,6 +339,8 @@ def test_attach_and_distribute_multiple_volumes(self):
337339
self.query_async_job(vol5_jobId.jobid)
338340
self.query_async_job(vol6_jobId.jobid)
339341

342+
time.sleep(60)
343+
340344
volumes = Volume.list(self.apiClient,
341345
virtualmachineid=self.virtual_machine.id,
342346
type="DATADISK",

0 commit comments

Comments
 (0)