cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kelven Yang <kelven.y...@citrix.com>
Subject Re: Job Queue Question
Date Mon, 14 Jul 2014 22:09:23 GMT
Mike,

This is related to serializing activities to the VM. When VM has multiple
disks and volume-semantic API could create situations that there exist
multiple volume operations happening at the same time on the same VM.

Kelven

On 7/14/14, 2:23 PM, "Mike Tutkowski" <mike.tutkowski@solidfire.com> wrote:

>Hi,
>
>I have a question about this logic (related to resizing a volume):
>
>            AsyncJobExecutionContext jobContext =
>AsyncJobExecutionContext.getCurrentExecutionContext();
>
>
>            if (!VmJobEnabled.value() ||
>jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER)) {
>
>                // avoid re-entrance
>
>
>                VmWorkJobVO placeHolder = null;
>
>
>                if (VmJobEnabled.value()) {
>
>                    placeHolder = createPlaceHolderWork(userVm.getId());
>
>                }
>
>
>                try {
>
>                    return orchestrateResizeVolume(volume.getId(),
>currentSize, newSize,
>
>                        newDiskOffering != null ?
>cmd.getNewDiskOfferingId() : null, shrinkOk);
>
>                } finally {
>
>                    if (VmJobEnabled.value()) {
>
>                        _workJobDao.expunge(placeHolder.getId());
>
>                    }
>
>                }
>
>
>            } else {
>
>                Outcome<Volume> outcome =
>resizeVolumeThroughJobQueue(userVm.getId(), volume.getId(), currentSize,
>newSize,
>
>                        newDiskOffering != null ?
>cmd.getNewDiskOfferingId() : null, shrinkOk);
>
>
>Why would one resize the volume via the job queue versus the other path?
>
>Thanks!
>-- 
>*Mike Tutkowski*
>*Senior CloudStack Developer, SolidFire Inc.*
>e: mike.tutkowski@solidfire.com
>o: 303.746.7302
>Advancing the way the world uses the cloud
><http://solidfire.com/solution/overview/?video=play>**


Mime
View raw message