To model the relationship between a containing domain and the host that it contains we need to use consolidation rules to tie the two together.
The consolidation rules require that we have identified both the host that is being contained and the containing domain, once both have been identified a HostContainment relationship is created between the two nodes.
Currently consolidation from host is working only on Linux platform.
This pattern when triggering on "xenbus" process running on Oracle VM Virtual Machine populates "serial" attribute in the (virtual) Host node and creates relationship between the virtual host and SoftwareInstance of Oracle VM Virtual Machine.
Due to the bug in RedHat Enteprise Linux (basis for Xen Source Linux / Oracle VM Server Linux running in Domain 0) the pattern needs to ensure that this Host is not running XenServer or Oracle VM Server. Furthermore this pattern shouldn't process Xen domains. For those reasons it employs two checks:
The pattern then tries to obtain UUID attribute from file '/sys/hypervisor/uuid' using the following regular expression:
If pattern obtained UUID that contains only 0's (that's possible only for Oracle VM Server on 'dom0') then it stops. In other case - this pattern populates the 'serial' attribute of the virtual Host node with UUID value of the virtual machine.
If the pattern is then able to identify corresponding Oracle VM Virtual Machine Software Instance (via an UUID match) then it will creates the HostContainment relationship between these two nodes.
This pattern triggers on 'Oracle VM Virtual Machine' SoftwareInstance that is being created, confirmed or modified and the SI node has the 'uuid' attribute set. The pattern then searches for a (virtual) Host with 'serial' attribute equal to 'uuid' of the Software Instance. If this search was successfull it creates HostContainment relationship between these nodes.