Merge remote-tracking branch 'origin/4.13'

This commit is contained in:
Rohit Yadav 2020-02-13 11:33:40 +05:30
commit 5a42862d41
2 changed files with 11 additions and 6 deletions

View File

@ -49,6 +49,7 @@ import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
import org.apache.cloudstack.framework.jobs.AsyncJobExecutionContext;
import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao;
import org.apache.cloudstack.framework.jobs.dao.VmWorkJobDao;
import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao;
import org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDao;
import org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDao;
@ -131,6 +132,8 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
@Inject
private VMInstanceDao _vmInstanceDao;
@Inject
private VmWorkJobDao _vmWorkJobDao;
@Inject
private VolumeDetailsDao _volumeDetailsDao;
@Inject
private VolumeDao _volsDao;
@ -898,6 +901,9 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
Transaction.execute(new TransactionCallbackNoReturn() {
@Override
public void doInTransactionWithoutResult(TransactionStatus status) {
if ("VmWork".equals(job.getType())) {
_vmWorkJobDao.expunge(job.getId());
}
_jobDao.expunge(job.getId());
// purge corresponding sync queue item
_queueMgr.purgeAsyncJobQueueItemId(job.getId());

View File

@ -1702,13 +1702,13 @@
if (newDiskOffering != null && newDiskOffering.length > 0) {
array1.push("&diskofferingid=" + encodeURIComponent(newDiskOffering));
}
if (selectedDiskOfferingObj.iscustomized == true) {
if (args.context.volumes[0].type == "ROOT" || selectedDiskOfferingObj.iscustomized == true) {
cloudStack.addNewSizeToCommandUrlParameterArrayIfItIsNotNullAndHigherThanZero(array1, args.data.newsize);
}
var minIops;
var maxIops
if (selectedDiskOfferingObj.iscustomizediops == true) {
if (selectedDiskOfferingObj != null && selectedDiskOfferingObj.iscustomizediops == true) {
minIops = args.data.minIops;
maxIops = args.data.maxIops;
}
@ -1720,13 +1720,12 @@
if (maxIops != null && maxIops.length > 0) {
array1.push("&maxiops=" + encodeURIComponent(maxIops));
}
//if original disk size > new disk size
if ((args.context.volumes[0].type == "ROOT")
&& (args.context.volumes[0].size > (newSize * (1024 * 1024 * 1024)))) {
//if original disk size > new disk size
if (args.context.volumes[0].type == "ROOT" &&
args.context.volumes[0].size > (args.data.newsize * (1024 * 1024 * 1024))) {
return args.response.error('message.volume.root.shrink.disk.size');
}
$.ajax({
url: createURL("resizeVolume&id=" + args.context.volumes[0].id + array1.join("")),
dataType: "json",