
Fixes RST documents to include list mark up when appropriate. closes: https://github.com/vmware/pyvmomi/issues/76
12 KiB
vim.profile.host.ProfileManager
The HostProfileManager provides access to a list of HostProfile s and it defines methods to manipulate profiles and AnswerFile s.
- extends
- since
Attributes
Methods
- ApplyHostConfig(host, configSpec, userInput):
-
Apply the configuration to the host. If you specify any user input, the configuration will be saved in the AnswerFile associated with the host. If there is no answer file, the Profile Engine will create one.
- Privilege:
-
dynamic
- Args:
-
- host (vim.HostSystem):
-
Host to be updated. User must have sufficient credentials and privileges to satisfy the contents of theconfigSpec.
- configSpec (vim.host.ConfigSpec):
-
Set of configuration changes to be applied to the host. The changes are returned by the HostProfile . ExecuteHostProfile method in the ProfileExecuteResult . configSpec property.
- userInput (vim.profile.DeferredPolicyOptionParameter, optional, since vSphere API 5.0 ):
-
Additional host-specific data to be applied to the host. This data is the complete list of deferred parameters verified by the HostProfile . ExecuteHostProfile method, contained in the ProfileExecuteResult object returned by the method.
- Returns:
Raises:
- vim.fault.InvalidState:
-
if the host is not in maintenance mode and the configuration specification requires it.
- vim.fault.HostConfigFailed:
-
if the ESX Server cannot apply the configuration changes.
- GenerateConfigTaskList(configSpec, host):
-
Generate a list of configuration tasks that will be performed on the host during HostProfile application.
- Privilege:
-
System.View
- Args:
-
- configSpec (vim.host.ConfigSpec):
-
ConfigSpec which was proposed by ExecuteHostProfile method.
- host (vim.HostSystem):
-
Host on which the HostProfile application needs to be carried out.
- Returns:
-
- vim.profile.host.ProfileManager.ConfigTaskList:
-
List of Configuration tasks.
- GenerateHostProfileTaskList(configSpec, host):
-
Generate a list of configuration tasks that will be performed on the host during HostProfile application. This differs from the GenerateConfigTaskList method in that it returns a task to monitor the progress of the operation. since: vSphere API 5.5
- Privilege:
-
System.View
- Args:
-
- configSpec (vim.host.ConfigSpec):
-
ConfigSpec which was proposed by ExecuteHostProfile method.
- host (vim.HostSystem):
-
Host on which the HostProfile application needs to be carried out.
- Returns:
-
- vim.Task:
-
List of Configuration tasks.
- QueryHostProfileMetadata(profileName, profile):
-
Retrieve the metadata for a set of profiles.
- Privilege:
-
System.View
- Args:
-
- profileName (str, optional):
-
Names of the profiles for which metadata is requested. If not set, the method returns metadata for all the profiles.
- profile (vim.profile.Profile, optional, since vSphere API 5.0 ):
-
Base profile whose context needs to be used during the operation
- Returns:
-
- [vim.profile.ProfileMetadata]:
-
List of profile metadata objects.
Raises:
- vmodl.fault.InvalidArgument:
-
If profileName parameter is invalid.
- vim.fault.InvalidProfileReferenceHost:
-
if the reference host associated with the profile is incompatible or there is no reference host for the profile.
- QueryProfileStructure(profile):
-
Get information about the structure of the profile. since: vSphere API 5.0
- Privilege:
-
System.View
- Args:
-
- profile (vim.profile.Profile, optional, since vSphere API 5.0 ):
-
Base profile whose context needs to be used during the operation
- Returns:
-
- vim.profile.ProfileStructure:
-
The profile structure.
Raises:
- vim.fault.InvalidProfileReferenceHost:
-
if the reference host associated with the profile is incompatible or there is no reference host for the profile.
- CreateDefaultProfile(profileType, profileTypeName, profile):
-
- Create a default subprofile of a given type (for example, a VirtualSwitchProfile ). After you create the subprofile, you can add it to a configuration specification and update the host profile:
-
- Call the
- CreateDefaultProfile
- method.
- Create a
- HostProfileCompleteConfigSpec
- object.
- Copy the existing profile from the host configuration information (
- HostProfile
- .
- config
- .
- applyProfile
- ) to the configuration specification.
- Add the new subprofile to the configuration specification. For example, if you create a
- VirtualSwitchProfile
- , you would add it to the list of virtual switches in the network profile for the configuration specification (
- NetworkProfile
- .
- vswitch
- []).
- Call
- HostProfile
- .
- UpdateHostProfile
- to save the new subprofile.
- Privilege:
-
System.View
- Args:
-
- profileType (str):
-
Type of profile to create. The profile types are system-defined ( ApplyProfile . profileTypeName ).
- profileTypeName (str, optional, since vSphere API 5.0 ):
-
If specified, the method returns a profile object containing data for the named profile. The type name does not have to be system-defined. A user-defined profile can include various dynamically-defined profiles.
- profile (vim.profile.Profile, optional, since vSphere API 5.0 ):
-
Base profile used during the operation.
- Returns:
-
- vim.profile.ApplyProfile:
-
Derived subprofile of typeprofileType.
Raises:
- vmodl.fault.InvalidArgument:
-
If either the profileType or profileTypeName is incorrect.
- vim.fault.InvalidProfileReferenceHost:
-
if the reference host associated with the profile is incompatible or there is no reference host for the profile.
- UpdateAnswerFile(host, configSpec):
-
Update the AnswerFile for the specified host. If there is no answer file associated with the host, the Profile Engine uses the answer file configuration specification to create a new one. since: vSphere API 5.0
- Privilege:
-
Profile.Edit
- Args:
-
- host (vim.HostSystem):
-
Host with which the answer file is associated.
- configSpec (vim.profile.host.ProfileManager.AnswerFileCreateSpec):
-
Host-specific configuration data. If the configuration specification does not contain any host-specific user input (configSpec. userInput ), the method does not perform any operation on the answer file.
- Returns:
Raises:
- vim.fault.AnswerFileUpdateFailed:
-
If the answer file could not be updated.
- vmodl.fault.InvalidArgument:
-
If the input parameteres are incorrect.
- RetrieveAnswerFile(host):
-
Returns the answer file associated with a particular host. since: vSphere API 5.0
Privilege:
- Args:
-
- host (vim.HostSystem):
-
Host with which the answer file is associated.
- Returns:
-
- vim.profile.host.AnswerFile:
-
Answer file object will be returned if it exists.
- RetrieveAnswerFileForProfile(host, applyProfile):
-
Returns the answer file associated with a particular host, augmented with whatever answer file values are required for the supplied host profile. since: vSphere API 5.1
Privilege:
- Args:
-
- host (vim.HostSystem):
-
Host with which the answer file is associated.
- applyProfile (vim.profile.host.HostApplyProfile):
-
Profile configuration used to generate answer file
- Returns:
-
- vim.profile.host.AnswerFile:
-
Answer file object will be returned.
- ExportAnswerFile(host):
-
Export a host's answer file into a serialized form. The method returns a string that contains only the list of user input options. See AnswerFile . userInput . since: vSphere API 5.0
- Privilege:
-
Profile.Export
- Args:
-
- host (vim.HostSystem):
-
Host with which the answer file is associated.
- Returns:
-
- vim.Task:
-
Serialized form of the answer file.
- CheckAnswerFileStatus(host):
-
Check the validity of the answer files for the specified hosts. The Profile Engine uses the profile associated with a host to check the answer file. since: vSphere API 5.0
- Privilege:
-
System.View
- Args:
-
- host (vim.HostSystem):
-
Set of hosts for which the answer file status will be checked.
- Returns:
-
- vim.Task:
-
Returns the resulting answer file status.
Raises:
- vim.fault.InvalidProfileReferenceHost:
-
if the reference host associated with the profile is incompatible or there is no reference host for the profile.
- QueryAnswerFileStatus(host):
-
Returns the status of the answer files associated with specified hosts. This method returns the most recent status determined by CheckAnswerFileStatus_Task . See HostProfileManagerAnswerFileStatus for valid values. since: vSphere API 5.0
- Privilege:
-
System.View
- Args:
-
- host (vim.HostSystem):
-
The hosts the answer file is associated with.
- Returns:
-
- [vim.profile.host.AnswerFileStatusResult]:
-
List of answer file status objects.