Share via


Msvm_ConcreteJob class

A concrete version of job. This class represents a generic and instantiable unit of work, such as a batch or a print job and is specifically used in Hyper-V to track the progress of asynchronous operations.

The following syntax is simplified Managed Object Format (MOF) code, and it includes all of the inherited properties.

Syntax

[Dynamic, Provider("VmmsWmiInstanceAndMethodProvider"), AMENDMENT]
class Msvm_ConcreteJob : CIM_ConcreteJob
{
  string   Caption;
  string   Description;
  string   ElementName;
  datetime InstallDate;
  uint16   OperationalStatus[];
  string   Status;
  uint16   HealthState = 5;
  string   JobStatus;
  datetime TimeSubmitted;
  datetime ScheduledStartTime;
  datetime StartTime;
  datetime ElapsedTime;
  uint32   JobRunTimes = 1;
  uint8    RunMonth;
  sint8    RunDay;
  sint8    RunDayOfWeek;
  datetime RunStartInterval;
  uint16   LocalOrUtcTime;
  datetime UntilTime;
  string   Notify;
  string   Owner;
  uint32   Priority;
  uint16   PercentComplete;
  boolean  DeleteOnCompletion;
  uint16   ErrorCode;
  string   ErrorDescription;
  string   ErrorSummaryDescription;
  uint16   RecoveryAction;
  string   OtherRecoveryAction;
  string   InstanceID;
  string   Name;
  uint16   JobState;
  datetime TimeOfLastStateChange;
  string   StatusDescriptions[] = { "OK" };
  datetime TimeBeforeRemoval = 00000000000500.000000:000;
  boolean  Cancellable;
};

Members

The Msvm_ConcreteJob class has these types of members:

Methods

The Msvm_ConcreteJob class has these methods.

Method Description
GetError When the job is executing or has terminated without error, then this method returns no CIM_Error instance. However, if the job has failed because of some internal problem or because the job has been terminated by a client, then a CIM_Error instance is returned.
GetErrorEx When the job is executing or has terminated without error, then this method returns no Msvm_Error instance. However, if the job has failed because of some internal problem or because the job has been terminated by a client, then one or more Msvm_Error instance is returned.
KillJob This method is not supported.
RequestStateChange Requests that the state of the job be changed to the value specified in the RequestedState parameter. Invoking the RequestStateChange method multiple times could result in earlier requests being overwritten or lost. If 0 is returned, then the task completed successfully. Any other return code indicates an error condition.

Properties

The Msvm_ConcreteJob class has these properties.

Cancellable

Data type: boolean

Access type: Read-only

Indicates whether the job can be canceled. The value of this property does not guarantee that a request to cancel the job will succeed.

Caption

Data type: string

Access type: Read-only

Qualifiers: MaxLen (64)

A short textual description (one-line string) of the object. This property is inherited from CIM_ManagedElement.

DeleteOnCompletion

Data type: boolean

Access type: Read/write

This property is inherited from CIM_Job.

Description

Data type: string

Access type: Read-only

A textual description of the object. This property is inherited from CIM_ManagedElement.

ElapsedTime

Data type: datetime

Access type: Read-only

Qualifiers: SubType ("Interval")

The length of time that the job has been executing. This property is inherited from CIM_Job.

ElementName

Data type: string

Access type: Read-only

A user-friendly name for the object. This property is inherited from CIM_ManagedElement.

ErrorCode

Data type: uint16

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Job.ErrorDescription")

This property is inherited from CIM_Job.

ErrorDescription

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Job.ErrorCode")

This property is inherited from CIM_Job.

ErrorSummaryDescription

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Job.ErrorCode")

This property is inherited from CIM_Job.

HealthState

Data type: uint16

Access type: Read-only

The current health of the element. This attribute expresses the health of this element but not necessarily that of its subcomponents. The possible values are 0 to 30, where 5 means the element is entirely healthy and 30 means the element is completely non-functional. This property is inherited from CIM_ManagedSystemElement and it is always set to 5.

OK (5)

The element is fully functional and operates within normal operational parameters and without error.

InstallDate

Data type: datetime

Access type: Read-only

Qualifiers: MappingStrings ("MIF.DMTF|ComponentID|001.5")

The date and time the virtual machine configuration was created. This property is inherited from CIM_ManagedSystemElement.

InstanceID

Data type: string

Access type: Read-only

Qualifiers: Key

Within the scope of the instantiating namespace, the InstanceID property opaquely and uniquely identifies an instance of this class. To ensure uniqueness within the namespace, the value of the InstanceID property should be constructed by using the following preferred algorithm: "OrgID:LocalID" where OrgID and LocalID are separated by a colon (:), and where OrgID must include a copyrighted, trademarked, or otherwise unique name that is owned by the business entity that is creating or defining the InstanceID, or that is a registered ID that is assigned to the business entity by a recognized global authority. (This requirement is similar to the SchemaName_ClassName structure of schema class names.) In addition, to ensure uniqueness, OrgID must not contain a colon. When using this algorithm, the first colon to appear in InstanceID must appear between OrgID and LocalID. LocalID is chosen by the business entity and should not be reused to identify different underlying (real-world) elements. If the above preferred algorithm is not used, the defining entity must ensure that the resulting InstanceID is not reused across any InstanceIDs produced by this or other providers for the namespace of this instance. For Distributed Management Task Force (DMTF) defined instances, the preferred algorithm must be used with the OrgID set to "CIM". This property is inherited from CIM_ConcreteJob.

JobRunTimes

Data type: uint32

Access type: Read/write

This property is inherited from CIM_Job.

The possible values are.

(0)

Repeat the job until the time specified by the UntilTime property or until it is manually shut down.

(1)

Run the job once. This is the default value.

Run the job for the specified number of times.

JobState

Data type: uint16

Access type: Read-only

Qualifiers:

JobState is an integer enumeration that indicates the operational state of a job. It can also indicate transitions between these states, for example, "Shutting Down" and "Starting". This property is inherited from CIM_ConcreteJob.

The possible values are.

New (2)

The job has never been started.

Starting (3)

The job is moving from the New, Suspended, or Service states into the Running state.

Running (4)

The Job is running.

Suspended (5)

The Job is stopped, but can be restarted in a seamless manner.

Shutting Down (6)

The job is moving to a Completed, Terminated, or Killed state.

Completed (7)

The job has completed normally.

Terminated (8)

The job has been stopped by a Terminate state change request. The job and all its underlying processes are ended and can be restarted (this is job-specific) only as a new job.

Killed (9)

The job has been stopped by a Kill state change request. Underlying processes might have been left running, and cleanup might be required to free up resources.

Exception (10)

The Job is in an abnormal state that might be indicative of an error condition. Actual status might be displayed though job-specific objects.

Service (11)

The Job is in a vendor-specific state that supports problem discovery, or resolution, or both.

Query Pending (12)

The Job is waiting for a client to resolve a query.

DMTF Reserved

Reserved.

Vendor Reserved

Reserved.

JobStatus

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_ManagedSystemElement.OperationalStatus")

A free-form string that represents the job status. This property is inherited from CIM_Job.

LocalOrUtcTime

Data type: uint16

Access type: Read/write

This property is inherited from CIM_Job.

The possible values are.

Local Time (1)

Local time.

UTC Time (2)

UTC time.

Name

Data type: string

Access type: Read-only

Qualifiers: Required

The user-friendly name for this instance of a job. In addition, the user-friendly name can be used as a property for a search or query. (Note: the Name property does not have to be unique within a namespace.) This property is inherited from CIM_ConcreteJob.

Notify

Data type: string

Access type: Read/write

The user that is notified upon job completion or failure. This property is inherited from CIM_Job.

OperationalStatus

Data type: uint16 array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_ManagedSystemElement.StatusDescriptions")

The current statuses of the object. This property is inherited from CIM_ManagedSystemElement and each array element is always set to 2 (OK).

OtherRecoveryAction

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Job.RecoveryAction")

This property is inherited from CIM_Job.

Owner

Data type: string

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_OwningJobElement")

The user who submitted the job. This property is inherited from CIM_Job.

PercentComplete

Data type: uint16

Access type: Read-only

Qualifiers: Units ("Percent"), MinValue (0), MaxValue (101)

This property is inherited from CIM_Job.

Priority

Data type: uint32

Access type: Read/write

The importance of a job's execution. This property is inherited from CIM_Job.

RecoveryAction

Data type: uint16

Access type: Read-only

Qualifiers: ModelCorrespondence ("CIM_Job.OtherRecoveryAction")

This property is inherited from CIM_Job.

The possible values are.

Unknown (0)

Unknown.

Other (1)

Take the action specified in the OtherRecoveryAction property.

Do Not Continue (2)

Stop the job and update its status.

Continue With Next Job (3)

Run the next job in the queue.

Re-run Job (4)

Re-run job.

Run Recovery Job (5)

Run the recovery job.

RunDay

Data type: sint8

Access type: Read/write

Qualifiers: MinValue (-31), MaxValue (31), ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")

This property is inherited from CIM_Job.

RunDayOfWeek

Data type: sint8

Access type: Read/write

Qualifiers: ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunStartInterval")

This property is inherited from CIM_Job.

The possible values are.

-Saturday (-7)

The job is processed on the last Saturday on or before the day specified by RunDay.

-Friday (-6)

The job is processed on the last Friday on or before the day specified by RunDay.

-Thursday (-5)

The job is processed on the last Thursday on or before the day specified by RunDay.

-Wednesday (-4)

The job is processed on the last Wednesday on or before the day specified by RunDay.

-Tuesday (-3)

The job is processed on the last Tuesday on or before the day specified by RunDay.

-Monday (-2)

The job is processed on the last Monday on or before the day specified by RunDay.

-Sunday (-1)

The job is processed on the last Sunday on or before the day specified by RunDay.

ExactDayOfMonth (0)

RunDay indicates the day of the month when the job is processed.

Sunday (1)

The job is processed on the first Sunday on or after the day specified by RunDay.

Monday (2)

The job is processed on the first Monday on or after the day specified by RunDay.

Tuesday (3)

The job is processed on the first Tuesday on or after the day specified by RunDay.

Wednesday (4)

The job is processed on the first Wednesday on or after the day specified by RunDay.

Thursday (5)

The job is processed on the first Thursday on or after the day specified by RunDay.

Friday (6)

The job is processed on the first Friday on or after the day specified by RunDay.

Saturday (7)

The job is processed on the first Saturday on or after the day specified by RunDay.

RunMonth

Data type: uint8

Access type: Read/write

Qualifiers: ModelCorrespondence ("CIM_Job.RunDay", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")

This property is inherited from CIM_Job.

The possible values are.

January (0)

February (1)

March (2)

April (3)

May (4)

June (5)

July (6)

August (7)

September (8)

October (9)

November (10)

December (11)

RunStartInterval

Data type: datetime

Access type: Read/write

Qualifiers: SubType ("Interval"), ModelCorrespondence ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")

This property is inherited from CIM_Job.

ScheduledStartTime

Data type: datetime

Access type: Read/write

Qualifiers: Deprecated ("CIM_Job.RunMonth", "CIM_Job.RunDay", "CIM_Job.RunDayOfWeek", "CIM_Job.RunStartInterval")

This property is inherited from CIM_Job.

StartTime

Data type: datetime

Access type: Read-only

The time that the job began. This property is inherited from CIM_Job.

Status

Data type: string

Access type: Read-only

Qualifiers: Deprecated ("CIM_ManagedSystemElement.OperationalStatus"), MaxLen (10)

This property is inherited from CIM_ManagedSystemElement but it is not used.

StatusDescriptions

Data type: string array

Access type: Read-only

Qualifiers: ArrayType ("Indexed"), ModelCorrespondence ("CIM_ManagedSystemElement.OperationalStatus")

Strings that describe the various OperationalStatus array values. This property is inherited from CIM_ManagedSystemElement and each array element is always set to "OK".

TimeBeforeRemoval

Data type: datetime

Access type: Read/write

Qualifiers: Required, SubType ("Interval")

The amount of time that the job is retained after it has finished executing, either succeeding or failing in that execution. The job must remain in existence for some period of time regardless of the value of the DeleteOnCompletion property. The default is five minutes. This property is inherited from CIM_ConcreteJob and is always set to "00000000000500.000000:000".

TimeOfLastStateChange

Data type: datetime

Access type: Read-only

Qualifiers:

The date or time when the state of the job last changed. If the state of the job has not changed and this property is populated, then it must be set to a 0 interval value. If a state change was requested, but rejected or not yet processed, the property must not be updated. This property is inherited from CIM_ConcreteJob.

TimeSubmitted

Data type: datetime

Access type: Read-only

The time that the job was submitted. This property is inherited from CIM_Job.

UntilTime

Data type: datetime

Access type: Read/write

Qualifiers: ModelCorrespondence ("CIM_Job.LocalOrUtcTime")

The time at which the job is invalid or should be stopped. This property is inherited from CIM_Job.

Remarks

Access to the Msvm_ConcreteJob class might be restricted by UAC Filtering. For more information, see User Account Control and WMI.

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2008
End of client support
None supported
End of server support
Windows Server 2012 R2
Namespace
Root\Virtualization
MOF
WindowsVirtualization.mof

See also

CIM_ConcreteJob

CIM_ConcreteJob

Virtual System Management Classes