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.tutkow...@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.tutkow...@solidfire.com >o: 303.746.7302 >Advancing the way the world uses the cloud ><http://solidfire.com/solution/overview/?video=play>**