A Practical Approach to WBEM[s]CIM Management

The following list summarises the types of provider normally supported by a WBEM server; each is described in more detail below.

Although their functions differ , a single piece of code may implement more than one type of provider: a module may be an instance provider, a property provider and an association provider. Furthermore, many functions can be carried out by different types of provider ”modifying a property on an instance might be carried out at different times by a Property Provider, an instance provider or a method provider. The choice of provider type is a design decision.

In general, providers are associated with dynamic entities: counters that are updated by external events, associations that are formed when services are created, etc. Static entities (classes and static instances) generally do not need providers ”they can be defined in the mof code and loaded once into the WBEM server. The WBEM server will then effectively act as a provider to respond to queries about these classes and instances.

In the C++ world, providers are typically compiled to dynamically linked libraries (.so or .dll) loaded by the WBEM server as required. The WBEM server will then automatically unlink a provider that has not been used for some time (and has not been locked in memory).

Method Providers

A "method" is an extrinsic function defined for a particular class. Such a function may perform any operation on a managed object: a call to a method provider from a WBEM client is effectively a two-way Remote Procedure Call (RPC). The WBEM client specifies the instance on which the procedure is to be invoked, the name of the method and its parameters. The WBEM server invokes the method provider defined for that method for that class and returns the values generated.

If you have CORBA experience, you may interpret this process as a Remote Procedure Call (which it is) and expect the WBEM server to check the type correctness of the parameters and refuse to invoke a method provider if the parameter types are wrong. Generally, WBEM servers do not do this (although the specification is silent on the subject and it is left to the developers of the WBEM server), relying instead on the method provider to do the parameter checking. See FAQ 20 on page 84.

An example might be a method provider for a high-level service, providing a means of shutting the service down:

void shutdown(boolean immediately);

The same result could be obtained by using a Property Provider and by relying on the side effect of changing a Property's value, as is required in SNMP. For example, you could define a Property called something like RequiredState and then allow an operator to set this to a value of ShuttingDownNow . A Property Provider could then note this change and, as a side effect of the change, carry out the required function. This is less natural than simply calling a shutdown(true) method and much harder to use if complex parameters are involved or if several parameters need to be modified simultaneously (atomically).

The types of parameters which can be passed to a method provider are the normal CIM types: signed and unsigned integers of 8, 16, 32, and 64 bits; strings and characters ; Booleans; 4- and 8-octet floating point numbers and dates/times.

A method provider is required to provide a single function: invoke-Method .

Instance Providers

An instance provider manages the dynamic instances of a class. In some applications, instances of a class may be created and deleted by an operator. In this case the instance provider may maintain a list of instances (possibly stored in nonvolatile memory). In other applications it may be inappropriate for the operator to be able to create and delete instances (for example, in many applications it makes no sense for an operator to create a new instance of the operating system).

Typically, the instance provider maintains a list of instances either by responding to operator requests or by scanning the real equipment to see what has been fitted. Of course, in the latter case, the list can be "virtual," being recreated from the hardware each time it is required.

For example, when a router is first installed, there is no way for the WBEM server to know a priori how many ports of particular types have been installed. An instance provider would communicate directly with the low-level drivers to determine the number of ports. If this information were requested by a WBEM client, then the WBEM server would invoke the instance provider to retrieve it. When instances of a class can be defined statically in advance ("there are always exactly two instances of the power supply: called PS2 and PS2"), they can be configured in a mof specification and no instance provider is required, although one could be provided ”it would be invoked as the instances defined in the mof are compiled and loaded into the repository. Even in this case, an explicit provider might be useful since it could prevent a malicious or faulty WBEM client from creating another instance ”the creation request would be routed to the provider which could reject it.

An Instance Provider typically implements the following functions:

Property Providers

Properties associated with a managed object can be either static or dynamic. A name, for example, might be permanently and statically associated with a device, whereas a field containing a count of the number of packets which have passed through a particular port would be dynamic. This counter changes rapidly and needs to be read from the physical device when requested by an operator. The WBEM server uses a property provider to extract the actual value of the counter only when it receives a request for it.

A Property Provider will typically provide the following methods:

As we saw on page 128, the client-side interface does not need to support getProperty() and setProperty() and some of the implementations of the WBEM servers do not actually support the concept of property providers ”relying instead on instance providers to return an instance, including the required properties.

Association Providers

An Association Provider, sometimes called an "Associator Provider," is able to build, destroy, list, and generally manipulate associations between components dynamically.

For example, imagine that an OSPF Service [1] has been dynamically created on a particular device and that the operator now adds an OSPF Area. This OSPF Area must be linked to the OSPF Protocol Endpoints which it contains. An association is defined in the standard DMTF models for this: EndPointInArea .

Because this association is created dynamically, it will be supported by an association provider to keep track of the instances of the association.

This type of provider is an extremely powerful tool for connecting loosely coupled instances as it can answer questions of the type: "With which OSPF Areas is this particular OSPF Protocol Endpoint associated?" or "Through which associations is instance X of class Y associated with instance Q of class R?"

An association provider will typically implement the following functions:

Note that, as described on page 139, a WBEM client may invoke an intrinsic method to manipulate associations for either classes or instances. Those invoked on classes ("With which classes is class X associated?") are handled by the WBEM server itself and do not find their way to a provider. The provider described here will only handle requests for instances.

Indication Providers

This provider differs from the others in that it does not simply respond to requests from the WBEM server ”it is activated by an external event of some type and initiates communication with the WBEM server. Of all of the provider types this is the one with the least standardisation across WBEM server implementations, although a standardisation process is in progress, driven by the openPegasus, SBLIM, and other teams .

Before reading this section, you may wish to review the whole indication process which I described in Chapter 8, particularly the section on subscriptions starting on page 160. Armed with that information, it is worthwhile considering in a general way the interfaces which an indication provider will require:

The last two of these mechanisms are provided by a small number of functions which the indication provider must support:

The first mechanism on my list above, that of actually informing the WBEM server that an indication has been raised, is covered by allowing the indication provider to create an instance of the appropriate indication class ”effectively to act as a WBEM client and create an instance. At present this is achieved in different ways in different WBEM server implementations.

Query Providers

This type of provider handles the ExecQuery() intrinsic method which can be invoked by a WBEM client (see page 139). It typically provides only one interface: ExecQuery().

[1] OSPF ( Open Shortest Path First) is an IP routing protocol used within a network to distribute routing tables amongst all routers ”see Glossary.

Категории