Question

I am using the Common Information Model (CIM) to model an infrastructure. The model describes a number of classes for different IT systems. It is comprehensive, so that it consists of a series hierarchies rather than one. For example, to represent a physical server chassis, you define an instance of CIM_Chassis. Then to represent the logical server that would run on that hardware, you define an instance of CIM_ComputerSystem. You should then associate the two with an instance of CIM_SystemPackaging, to note that one is provided by the other. There's no property in either class where you can set one as property of another. They are two separate classes, associated by the third. The model will be described in XML, validated by the current XML Schema for CIM. I don't understand from the XSD for CIM_SystemPackaging, what content it is supposed to contain.

This XML demonstrates the problem (chassis is the alias for CIM_Chassis.xsd, etc.):

<chassis:CIM_Chassis>
  <chassis:CreationClassName>CIM_Chassis</chassis:CreationClassName>    
  <chassis:Manufacturer>Cisco</chassis:Manufacturer>
  <chassis:Model>Catalyst 6000</chassis:Model>
  <chassis:Tag>6548431</chassis:Tag>
</chassis:CIM_Chassis>

<computer:CIM_ComputerSystem>
  <computer:CreationClassName>CIM_ComputerSystem</computer:CreationClassName>
  <computer:Name>Switch1</computer:Name>
</computer:CIM_ComputerSystem>

<sp:CIM_SystemPackaging>
  <sp:Antecedent>?</sp:Antecedent>
  <sp:Dependent>?</sp:Dependent>
</sp:CIM_SystemPackaging>

What should I put where the ? are? The schema documentation is silent on the matter, and there seem to be no XML examples on the web. This does not validate:

E [Xerces] cvc-complex-type.2.4.b: The content of element 'sp:Antecedent' is not complete. One of '{WC[##other:"http://schemas.dmtf.org/wbem/wscim/1/common",""]}' is expected.

In the Schema, Dependent and Antecedent are of type cimReference, which is:

<xs:complexType name="cimReference">
  <xs:sequence>
    <xs:any namespace="##other" maxOccurs="unbounded" processContents="lax"/>
  </xs:sequence>
  <xs:anyAttribute namespace="##any" processContents="lax"/>
</xs:complexType>

So that doesn't help me much. I wondered if I am meant to do embed the instance inside the antecedent:

<sp:CIM_SystemPackaging>
  <sp:Antecedent>
    <chassis:CIM_Chassis>
      ...etc...
    </chassis:CIM_Chassis>
  </sp:Antecedent>
  <sp:Dependent>
    <computer:CIM_ComputerSystem>
      ...etc...
    </computer:CIM_ComputerSystem>
  </sp:Dependent>
</sp:CIM_SystemPackaging>

This validates OK, but wouldn't seem to scale. Since there could be an object for each piece of hardware inside the chassis, and they all need to be associated with the chassis with similar association classes, it would quickly become impossible. It also seems to go against the whole association model. Is anyone familiar enough with CIM to explain how it is supposed to work?

Was it helpful?

Solution

I eventually found the below in DSP0230:

"The xs:any element in this definition [cim:cimReference] represents a structure of a single transport reference that uniquely identifies a location to which messages may be directed for the referenced entity. This structure may be either a single element that expresses the complete transport reference or a sequence of elements, if the transport reference requires multiple elements to uniquely identify a location."

Given example:

<AssociatedComponent xmlns:wsa="http://www.w3.org/2005/08/addressing">
  <wsa:Address>. . .</wsa:Address>
</AssociatedComponent>

Given that CIM was intended for over-the-network management rather than static representation, it sort of makes sense that it would be a reference to somewhere else rather than something else. I conclude that I can put anything I like in, and will need in my application logic to handle the references. Since most objects have an InstanceID element, I will use that as the reference target:

<chassis:CIM_Chassis>
  <chassis:CreationClassName>CIM_Chassis</chassis:CreationClassName>    
  <chassis:InstanceID>uniqueid1</chassis:InstanceID>
  <chassis:Manufacturer>Cisco</chassis:Manufacturer>
  <chassis:Model>Catalyst 6000</chassis:Model>
  <chassis:Tag>6548431</chassis:Tag>
</chassis:CIM_Chassis>

<computer:CIM_ComputerSystem>
  <computer:CreationClassName>CIM_ComputerSystem</computer:CreationClassName>
  <computer:InstanceID>uniqueid2</computer:InstanceID>
  <computer:Name>Switch1</computer:Name>
</computer:CIM_ComputerSystem>

<sp:CIM_SystemPackaging>
  <sp:Antecedent>
    <chassis:InstanceID>unqiueid1</chassis:InstanceID>
  </sp:Antecedent>
  <sp:Dependent>
    <computer:InstanceID>unqiueid2</computer:InstanceID>
  </sp:Dependent>
</sp:CIM_SystemPackaging>

OTHER TIPS

Despite your giving up on CIM, I felt I should answer this for the benefit of others.

(1) On your question what value to put into the association: You found the right answer, the value is a reference to a CIM instance, which in case of the XML defined in DSP0230 uses WS-Addressing. The general concepts of CIM, including references, are described in DSP0004.

(2) On using CIM for static representation of IT elements: CIM (the model) is capable of doing that. However, you will need to assign key values to the represented CIM instances (like you did). You would basically simulate what happens at run-time when you retrieve CIM instances from a WBEM server (such as WMI or others).

(3) You have a choice of representation formats. You used WS-CIM described in DSP0230, which has the property that its XSD is model dependent. This may be a good or bad thing for you, dependent on what you want to do. There is also CIM-XML (DSP0201, DSP8044) which has a fixed XML schema (but of course is more bloated than WS-CIM, because of that). The more recent JSON representation described in DSP0211 is only for protocol representation of WBEM operations, it does not support representing the CIM Schema.

(4) On your comment note on your answer where you said that CIM is complex: If you are trying to understand CIM models from just their CIM Schema definition, that may have its own difficulties. There is a concept called "management profiles". They define exactly how the classes in the CIM Schema are used for specific areas of management. See the management profiles published by DMTF.

Andy

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top