Identifying the Base Server Scoping Instance
The Scoping Instance of CIM_ComputerSystem for the Base Server profile is an object that represents the managed server. Various hardware and software components of the managed server are represented by CIM objects associated with this Scoping Instance.
A client can locate CIM objects by using one of the following ways:
Enumerate instances in the Implementation namespace, and then filter the results by their property values. This approach requires specific knowledge of the Implementation namespace and the subclassing used by the SMASH implementation on the managed server.
Locate the Base Server Scoping Instance that represents the managed server, and then traverse selected association objects to find the desired components. This approach requires less knowledge of the implementation details.
Base Server Scoping Instance Associated with Profile Registration shows the association between the profile registration instance in the Interop namespace and the Base Server Scoping Instance in the Implementation namespace.
Base Server Scoping Instance Associated with Profile Registration
The following pseudocode shows how to traverse the association to arrive at the Base Server Scoping Instance. This pseudocode depends on the pseudocode in Making a Connection to the CIMOM.
To identify the Base Server Scoping Instance
1
Specify the Interop namespace, supplied as a parameter, for the connection.
use wbemlib
use sys
use connection renamed cnx
connection = Null
 
params = cnx.get_params()
if params is Null
sys.exit(-1)
interop_params = params
interop_params['namespace'] = 'root/interop'
connection = cnx.connect_to_host( interop_params )
if connection is Null
print 'Failed to connect to: ' + params['host'] + ' as user: ' + params['user']
sys.exit(-1)
2
Enumerate instances of CIM_RegisteredProfile.
use registered_profiles renamed prof
 
profile_instance_names = prof.get_registered_profile_names( connection )
if profile_instance_names is Null
   print ‘No registered profiles found.’
sys.exit(-1)
3
function isolate_base_server_registration( connection, instance_names )
///Isolate the Base Server registration.///
for instance_name in instance_names
instance = connection.GetInstance( instance_name )
if instance[ 'RegisteredName' ] == 'Base Server'
return instance_name
return Null
 
profile_instance_name = isolate_base_server_registration( connection, \
                                                          profile_instance_names )
if profile_instance_name is Null
print 'Base Server profile is not registered in namespace ' + namespace
   sys.exit(-1)
4
Traverse the CIM_ElementConformsToProfile association to reach the Scoping Instance.
function associate_to_scoping_instance( connection, profile_name )
///Follow ElementConformsToProfile from RegisteredProfile to ComputerSystem.///
instance_names = connection.AssociatorNames( profile_name, \
AssocClass = 'CIM_ElementConformsToProfile', \
ResultRole = 'ManagedElement' )
if len( instance_names ) > 1
print 'Error: %d Scoping Instances found.' % len( instance_names )
sys.exit(-1)
return instance_names.pop()
 
function print_instance( instance )
print '\n' + ' [' + instance.classname + '] ='
for prop in instance.keys()
print ' %30s = %s' % ( prop, instance[prop] )
 
scoping_instance_name = associate_to_scoping_instance( connection, profile_instance_name )
if scoping_instance_name is Null
print 'Failed to find Scoping Instance.'
sys.exit(-1)
else
print_instance( connection.GetInstance( scoping_instance_name )