Most of storage manipulation methods, for example CreateOrModifyVG, can be time-consuming. Therefore the methods only check input parameters and return immediately with a reference to LMI_StorageJob instance. The operation itself is performed asynchronously on the server in a separate thread.
The returned LMI_StorageJob instance can be then used to either pull the operation status or applications can subscribe for job events and get an indication when status of a job changes.
Currently, only one job is being executed at a time, all others are enqueued and executed later.
|Finished OK||Completed, OK||Completed|
Job.RequestStateChange method can be used to suspend, resume and cancel a job, while following rules apply:
- Only Queued job can be suspended.
- Only Suspended job can be resumed.
- Only Queued or Suspended job can be cancelled.
Running job cannot be terminated in any way.
By default, all job instances disappear automatically after 60 seconds after they reach any final state. This can be overridden by setting TimeBeforeRemoval and DeleteOnCompletion properties of a job.
Return value and output parameters¶
Return value and output parameters of an asynchronous method call are stored in LMI_StorageJob.JobOutParameters property, which is EmbeddedObject of a class, which has property for each output parameter of the asynchronous method. The method return value itself is available there too, as __ReturnValue property.
For compatibility with SMI-S, the output parameters are also included in LMI_StorageMethodResult.PostCallIndication property, which is associated to the job. The property itself is embedded instance of CIM_InstMethodCall class. Return value is stored in its ReturnValue property. Output parameters are stored in its MethodParameters property.
Supported event filters¶
PercentComplete property of a job changed:
SELECT * FROM LMI_StorageInstModification WHERE SourceInstance ISA LMI_StorageJob AND SourceInstance.CIM_ConcreteJob::PercentComplete <> PreviousInstance.CIM_ConcreteJob::PercentComplete
State of a job changed:
SELECT FROM LMI_StorageInstModification WHERE SourceInstance ISA CIM_ConcreteJob AND SourceInstance.CIM_ConcreteJob::JobState <> PreviousInstance.CIM_ConcreteJob::JobState
A job reaches state “Completed/OK”:
SELECT * FROM LMI_StorageInstModification WHERE SourceInstance ISA LMI_StorageJob AND SourceInstance.CIM_ConcreteJob::JobState = 7
A job reaches state “Completed/Error”:
SELECT * FROM LMI_StorageInstModification WHERE SourceInstance ISA LMI_StorageJob AND SourceInstance.CIM_ConcreteJob::JobState = 10
New job was created:
SELECT * FROM LMI_StorageInstCreation WHERE SourceInstance ISA LMI_StorageJob
All other indication filter queries will be rejected.