I see...so, in case, for example, this API call is being executed in multiple places at the same time, we are making sure we send the commands to the VM in a serial fashion.
On Mon, Jul 14, 2014 at 4:09 PM, Kelven Yang <kelven.y...@citrix.com> wrote: > 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>* * > > -- *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>*™*