The VMware implementation of the DMTF Software Update profile allows system administrators to update ESXi software by using CIM client applications. The CIM software installation service applies an offline bundle file to update the software on the managed server. To identify the current software version, see Reporting Installed VIBs.
This example shows how to locate the CIM_SoftwareInstallationService by traversing the CIM_HostedService association from the server Scoping Instance. The InstallFromURI() method starts the update process on the managed server and returns a CIM_ConcreteJob instance that you can use to monitor completion of the installation.
The VMware implementation of the Software Update profile does not include a CIM_ServiceAffectsElement association between the instance of CIM_SoftwareInstallationService and the instance of CIM_SoftwareIdentity that represents a VIB. As a result, you cannot use the InstallFromSoftwareIdentity() method that is described in the Software Update profile specification.
To use the InstallFromURI() method, you must know the location of the offline bundle in a local file system. You supply the path to the offline bundle in the form of a URI when you invoke the method. For example, you might pass "file:///vmfs/Storage1/bundle.zip" as the value of the URI parameter.
You cannot use an online depot in the URI that you pass to the InstallFromURI() method. For instructions to create an offline bundle from a set of VIBs in an online depot, see Creating Offline Bundles.
Starting an Update of ESXi Software shows the relationships of the CIM objects involved in the installation of VIBs by using CIM. The CIM_SoftwareInstallationService instance in Starting an Update of ESXi Software represents the CIM provider that starts the software installation.
The CIM_SoftwareInstallationServiceCapabilities instance advertises the InstallFromURI action and the supported URI schemes that it supports. Starting an Update of ESXi Software includes the instance for completeness. The pseudocode example does not use it.
This pseudocode depends on the pseudocode in Make a Connection to the CIMOM and Identifying 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 | Locate the Base Server Scoping Instance that represents the managed server. use scoping_instance renamed si scoping_instance_name = si.get_scoping_instance_name( connection ) if scoping_instance_name is Null print 'Failed to find server Scoping Instance.' sys.exit(-1) | ||||||
3 | Use the CIM_HostedService association to identify the CIM_SoftwareInstallationService instance that represents the Software Update provider on the managed server. installation_services = connection.AssociatorNames( scoping_instance_name, \ AssocClass = ’CIM_HostedService’, \ ResultClass = 'CIM_SoftwareInstallationService' ) if len( installation_services ) != 1 print 'Failed to find the software installation service for the scoping computer system.' sys.exit(-1) installation_service = installation_services.pop() | ||||||
4 | On the CIM_SoftwareInstallationService instance, invoke the InstallFromURI() method with the following parameters.
|