This example describes a way to discover the path to a PCI device in the managed server by using the portgroup connections. This information is useful to system administrators who want to troubleshoot device problems or upgrade the hardware in a managed server.
The PCI Device profile specification allows flexibility in how the profile is implemented. Designers can apply one of three approaches to modeling PCI device connections, or they can combine these approaches for a more complete implementation. Device connections can be modeled with a combination of the following approaches.
- DeviceConnection associations
- PCIPortGroup instances that express relationships between PCI ports
- Primary and secondary bus numbers that relate PCI devices to bridges and switches
The VMware implementation supports the first two modeling approaches.
For convenience, the VMware implementation also provides a fourth way to model device connections: ParentDeviceID. For an example that uses the ParentDeviceID property, see Tracing the Path to a PCI Device By Using PortGroups. The ParentDeviceID property is specific to VMware classes, so it cannot be used in vendor-independent object traversal algorithms.
This example shows how you can trace the path to a PCI device by using the PCIPortGroup associations. This way of relating PCI devices depends only on the properties defined in the CIM schema, so it is vendor-independent. Tracing the Path to a PCI Device By Using PortGroups shows the relationships of the CIM objects involved.
Given a PCI device identified by bus, device, and function numbers (<bus>:<device>:<function>), this example identifies and displays all ports, bridges, and switches between the chosen device and the CPU. The PCI Device profile specifies how to model associations between devices and their ports, and between ports and the logical port groups that represent all ports on the same PCI bus.
In Tracing the Path to a PCI Device By Using PortGroups, the SystemDevice association to the managed server is included for reference, but is not used in this example.
This pseudocode depends on the pseudocode in Make a Connection to the CIMOM.
To trace the path to a PCI device