summaryrefslogtreecommitdiffstats
path: root/doc/admin/software/dmtf.rst
blob: 9aa460c271b618b6b9fa1288015f4e0fa3b9929f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
.. _dmtf_profiles:

DMTF profiles
=============
OpenLMI Software providers implement two *DMTF* profiles:

    * `Software Inventory Profile`_
    * `Software Update Profile`_

.. _software_inventory_profile:

Software Inventory Profile
--------------------------
Implemented *DMTF* version: ``1.0.1``

Described by `DSP1023`_

The Software Inventory Profile describes the CIM schema elements required to
provide an inventory of installed BIOS, firmware, drivers, and related
software in a managed system. This profile also describes the CIM schema
elements required to represent the software that can be installed on a
managed system.


Not implemented optional features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This implementation does not support:
 
    Representing a Software Bundle
        Software bundle is represented by LMI_SoftwareIndentity instance
        having ``"Software Bundle"`` value present in its ``Classifications``
        property. It shall prepresent software groups. It extends the profile
        for subclasses of ``CIM_OrderedComponent``. 

    Representing Installation Dependencies
        Dependencies between software packages are also unimplemented. This
        also extends the profile for subclasses of ``CIM_OrderedDependency``
        referencing :ref:`CIM-SoftwareIdentity` instances.

Deviations
~~~~~~~~~~
Version Comparison
^^^^^^^^^^^^^^^^^^
Version comparison is based on different approach than in *Software Inventory
Profile* where the following properties are present to uniquely specify
package version:

    * ``uint16`` :ref:`MajorVersion<CIM-SoftwareIdentity-MajorVersion>`
    * ``uint16`` :ref:`MinorVersion<CIM-SoftwareIdentity-MinorVersion>`
    * ``uint16`` :ref:`RevisionNumber<CIM-SoftwareIdentity-RevisionNumber>`
    * ``uint16`` :ref:`BuildNumber<CIM-SoftwareIdentity-BuildNumber>`

And also a :ref:`VersionString<LMI-SoftwareIdentity-VersionString>` property
which is a composition of previous ones separed with dots.

Unfortunately versioning of RPM packages is incompatible with this scheme.
Version of RPM package is composed of following properties:

.. _version_properties:

    * ``uint32`` :ref:`Epoch<LMI-SoftwareIdentity-Epoch>`
    * ``string`` :ref:`Version<LMI-SoftwareIdentity-Version>`
    * ``string`` :ref:`Release<LMI-SoftwareIdentity-Release>`

Where ``Version`` and ``Release`` can contain arbitrary set of characters [1]_.
These attributes were added to ``LMI_SoftwareIdentity`` class and will be
filled for every RPM package. On the other hand ``MajorVersion``,
``MinorVersion``, ``RevisionNumber`` and ``BuildNumber`` will not be filled.

This implementetion composes ``VersionString`` in following way: ::

    <Epoch>:<Version>-<Release>.<Architecture>

The algorithm for comparing two RPM packages version is following:
    
    1. Compare the ``Epoch`` (which is a number) of both packages. The one
       with higher epoch is newer. If they match, continue to point 2.
    2. Compare their ``Version`` attributes with `rpmvercmp`_ algorithm.
       Package with larger ``Version`` (according to `rpmvercmp`_) is newer.
       If they match, continue to point 3.
    3. Compare their ``Release`` attributes with `rpmvercmp`_ algorithm.
       Package with larger ``Release`` string is newer. Otherwise packages
       have the same version.

Relationships between *Software Identity* and *Managed Element*
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
are not modeled. RPM package database does not provide such informations
that would allow to associate particular package with a piece of hardware
it relates to.

Querying for packages
^^^^^^^^^^^^^^^^^^^^^
Since enumeration of *Software Identities* is disabled due to a huge
amount of data generated by large package database, the query
execution on them is also disallowed [2]_. The only way how to search
for packages is using the method
:ref:`LMI_SoftwareInstallationService.FindIdentity<LMI-SoftwareInstallationService-FindIdentity>`.

.. _identifying_software_identity:

Identifying software identity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:ref:`InstanceID<LMI-SoftwareIdentity-InstanceID>` key property is the one
and only identification string of :ref:`LMI-SoftwareIdentity` instances
representing RPM packages. It's composed of following strings: ::

    LMI:LMI_SoftwareIdentity:<Name>-<Epoch>:<Version>-<Release>.<Architecture>

Where the prefix ``"LMI:LMI_SoftwareIdentity:"`` is compared case-insensitively.
The rest is also known as a *NEVRA*. When calling ``GetInstance()`` on this
class, the ``"<Epoch>:"`` part can be omitted in the ``InstanceID`` key property
of passed ``InstanceName``.

Example
^^^^^^^
Take for example package ``vim-enhanced`` installed on Fedora 18: ::

    $ yum info vim-enhanced
    Installed Packages
    Name        : vim-enhanced
    Arch        : x86_64
    Epoch       : 2
    Version     : 7.4.027
    Release     : 2.fc18
    Size        : 2.1 M
    Repo        : installed
    From repo   : updates-testing

The output has been shortened. This package is represented by
an instance of ``LMI_SoftwareIdentity`` with ``InstanceID`` equal to: ::

    LMI:LMI_SoftwareIdentity:vim-enhanced-2:7.4.027-2.fc18.x86_64

Profile extensions
~~~~~~~~~~~~~~~~~~
List of additional attributes of ``LMI_SoftwareIdentity``:

    * version properties mentioned above (`version_properties`_)
    * ``string Architecture`` - Target machine architecture. Packages
      with architecture independent content will have ``"noarch"`` value
      set.

List of additional attributes of ``LMI_SoftwareIdentityResource``:

    ``Cost`` : sint32 
        Relative cost of accessing this repository.
    ``GPGCheck`` : boolean
        Whether the GPG signature check should be performed.
    ``TimeOfLastUpdate`` : datetime
        Time of repository's last update on server.

Class overview
~~~~~~~~~~~~~~

    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | Class-name                                                                    | Parent_class                                                        | Type             | 
    +===============================================================================+=====================================================================+==================+ 
    | :ref:`LMI_SoftwareIdentity<LMI-SoftwareIdentity>`                             | :ref:`CIM_SoftwareIdentity<CIM-SoftwareIdentity>`                   | Plain            | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_SystemSoftwareCollection<LMI-SystemSoftwareCollection>`             | :ref:`CIM_SystemSpecificCollection<CIM-SystemSpecificCollection>`   | Plain            | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_SoftwareIdentityResource<LMI-SoftwareIdentityResource>`             | :ref:`CIM_SoftwareIdentityResource<CIM-SoftwareIdentityResource>`   | Plain            | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_HostedSoftwareCollection<LMI-HostedSoftwareCollection>`             | :ref:`CIM_HostedCollection<CIM-HostedCollection>`                   | Association      | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_InstalledSoftwareIdentity<LMI-InstalledSoftwareIdentity>`           | :ref:`CIM_InstalledSoftwareIdentity<CIM-InstalledSoftwareIdentity>` | Association      | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_HostedSoftwareIdentityResource<LMI-HostedSoftwareIdentityResource>` | :ref:`CIM_HostedAccessPoint<CIM-HostedAccessPoint>`                 | Association      | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_ResourceForSoftwareIdentity<LMI-ResourceForSoftwareIdentity>`       | :ref:`CIM_SAPAvailableForElement<CIM-SAPAvailableForElement>`       | Association      | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 
    | :ref:`LMI_MemberOfSoftwareCollection<LMI-MemberOfSoftwareCollection>`         | :ref:`CIM_MemberOfCollection<CIM-MemberOfCollection>`               | Aggregation      | 
    +-------------------------------------------------------------------------------+---------------------------------------------------------------------+------------------+ 

    .. seealso::
	Class model in :ref:`introduction` where above classes are coloured blue.

.. _software_update_profile:

Software Update Profile
-----------------------
Implemented *DMTF* version: ``1.0.0``

Described by `DSP1025`_.

The Software Update Profile describes the classes, associations, properties,
and methods used to support the installation and update of BIOS, firmware,
drivers and related software on a managed element within a managed system.


Implemented optional features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This implementation supports:

    Advertising the Location Information of a Software Identity
        This optional feature provides association of *Software Identity* to
        its resource. In other words each available package is associated to
        a corresponding repository defined in configuration files of *YUM*.
        Repositories are represented with
        :ref:`LMI_SoftwareIdentityResource<LMI-SoftwareIdentityResource>` and
        are associated to :ref:`LMI_SoftwareIdentity<LMI-SoftwareIdentity>`
        via
        :ref:`LMI_ResourceForSoftwareIdentity<LMI-ResourceForSoftwareIdentity>`.

Not implemented features
~~~~~~~~~~~~~~~~~~~~~~~~
Following methods are not implemented:

    * :ref:`CIM_SoftwareInstallationService.InstallFromByteStream<CIM-SoftwareInstallationService-InstallFromByteStream>`
    * :ref:`LMI_SoftwareInstallationService.CheckSoftwareIdentity<LMI-SoftwareInstallationService-CheckSoftwareIdentity>`

Profile extensions
~~~~~~~~~~~~~~~~~~

RPM package verification
^^^^^^^^^^^^^^^^^^^^^^^^
*Software Inventory* and *Softare Update* profiles don't allow for software
verification. That is quite useful and desired operation done on RPM packages.
Following additions has been added to provide such a functionality.

Following classes have been added:

    :ref:`LMI_SoftwareIdentityFileCheck<LMI-SoftwareIdentityFileCheck>`
        Represents single file contained and installed by *RPM* package.
        It contains properties allowing for comparison of installed file
        attributes with those stored in a package database. In case those
        attributes do not match, file fails the verification test.

    :ref:`LMI_SoftwareIdentityChecks<LMI-SoftwareIdentityChecks>`
        Associates *Software Identity File Check* to corresponding
        *Software Identity*.

Following methods have been added:

    :ref:`LMI_SoftwareInstallationService.VerifyInstalledIdentity<LMI-SoftwareInstallationService-VerifyInstalledIdentity>`
        This allows to run verification test on particular *Software Identity*
        and returns a list of files that failed.

.. _package_searching:

Package searching
^^^^^^^^^^^^^^^^^
On modern Linux distributions we have thousands of software packages
available for installation making it nearly impossible for *CIMOM* to
enumerate them all because it consumes a lot of resources. That's why
the ``EnumerateInstances()`` and ``EnumerateInstanceNames()`` calls have been
disabled *Software Identities*. As a consequence the ``ExecQuery()`` call is prohibited also.

But the ability to search for packages is so important that a fallback
solution has been provided. Method
:ref:`FindIdentity()<LMI-SoftwareInstallationService-FindIdentity>` has been
added to
:ref:`LMI_SoftwareInstallationService<LMI-SoftwareInstallationService>`
allowing to create complex queries on package database.

Class overview
~~~~~~~~~~~~~~

    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | Class-name                                                                                          | Parent_class                                                            | Type               | 
    +=====================================================================================================+=========================================================================+====================+ 
    | :ref:`LMI_SoftwareInstallationService<LMI-SoftwareInstallationService>`                             | :ref:`CIM_SoftwareInstallationService<CIM-SoftwareInstallationService>` | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareJob<LMI-SoftwareJob>`                                                             | :ref:`LMI_ConcreteJob<LMI-ConcreteJob>`                                 | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareInstallationJob<LMI-SoftwareInstallationJob>`                                     | :ref:`LMI_SoftwareJob<LMI-SoftwareJob>`                                 | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareVerificationJob<LMI-SoftwareVerificationJob>`                                     | :ref:`LMI_SoftwareJob<LMI-SoftwareJob>`                                 | Association        | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareMethodResult<LMI-SoftwareMethodResult>`                                           | :ref:`LMI_MethodResult<LMI-MethodResult>`                               | Association        | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareIdentityFileCheck<LMI-SoftwareIdentityFileCheck>`                                 | :ref:`CIM_FileSpecification<CIM-FileSpecification>`                     | Association        | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareInstallationServiceAffectsElement<LMI-SoftwareInstallationServiceAffectsElement>` | :ref:`CIM_ServiceAffectsElement<CIM-ServiceAffectsElement>`             | Association        | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_SoftwareIdentityChecks<LMI-SoftwareIdentityChecks>`                                       |                                                                         | Aggregation        | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_HostedSoftwareInstallationService<LMI-HostedSoftwareInstallationService>`                 | :ref:`CIM_HostedService<CIM-HostedService>`                             | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_AffectedSoftwareJobElement<LMI-AffectedSoftwareJobElement>`                               | :ref:`CIM_AffectedJobElement<CIM-AffectedJobElement>`                   | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_OwningSoftwareJobElement<LMI-OwningSoftwareJobElement>`                                   | :ref:`LMI_OwningJobElement<LMI-OwningJobElement>`                       | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 
    | :ref:`LMI_AssociatedSoftwareJobMethodResult<LMI-AssociatedSoftwareJobMethodResult>`                 | :ref:`LMI_AssociatedJobMethodResult<LMI-AssociatedJobMethodResult>`     | Plain              | 
    +-----------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------+--------------------+ 

    .. seealso::
	Class model in :ref:`introduction` where above classes are coloured blue.

..
    ***************************************************************************
.. _DSP1023: http://www.dmtf.org/sites/default/files/standards/documents/DSP1023_1.0.1.pdf
.. _DSP1025: http://www.dmtf.org/sites/default/files/standards/documents/DSP1025_1.0.0.pdf
.. _rpmvercmp: http://fedoraproject.org/wiki/Tools/RPM/VersionComparison

------------------------------------------------------------------------------

.. [1] Precisely they must match following regular expression `r"[\w.+{}]+"`.
.. [2] Because internally the query is executed upon the list obtained by
       enumeration of instances.