Skip to main content

HostProfile

Struct HostProfile 

Source
pub struct HostProfile { /* private fields */ }
Expand description

A host profile describes ESX Server configuration.

The HostProfile managed object provides access to profile data and it defines methods to manipulate the profile. A host profile is a combination of subprofiles, each of which contains configuration data for a specific capability. Some examples of host capabilities are authentication, memory, networking, and security. For access to individual subprofiles, see the HostApplyProfile data object (HostProfile.Profile.config.HostProfileConfigInfo.applyProfile).

Host profiles are part of the stateless configuration architecture. In the stateless environment, a Profile Engine runs on each ESX host, but an ESX host does not store its own configuration state. Instead, host configuration data is stored on vCenter Servers. Every time a host boots or reboots, it obtains its profile from the vCenter Server.

  • To create a base host profile use the HostProfileManager.ProfileManager.CreateProfile method. To create a profile from an ESX host, specify a HostProfileHostBasedConfigSpec. To create a profile from a file, specify a HostProfileSerializedHostProfileSpec.
  • To create a subprofile for a particular host capability, use the HostProfileManager.HostProfileManager.CreateDefaultProfile method. After you create the default profile you can modify it and save it in the base profile.
  • To update an existing profile, use the HostProfile.HostProfile.UpdateHostProfile method.
  • To apply a host profile to an ESX host, use the HostProfile.ExecuteHostProfile method to generate configuration changes, then call the HostProfileManager.HostProfileManager.ApplyHostConfig_Task method to apply them.

Host-Specific Configuration

An individual host or a set of hosts may have some configuration settings that are different from the settings specified in the host profile. For example, the IP configuration for the host’s virtual network adapters must be unique.

  • To verify host-specific data, use the deferredParam parameter to the HostProfile.ExecuteHostProfile method. The Profile Engine will determine if you have specified all of the required parameters for the host configuration. If additional data is required, call the HostProfile.ExecuteHostProfile method again as many times as necessary to verify a complete set of parameters.
  • To apply host-specific data, use the userInput parameter to the HostProfileManager.HostProfileManager.ApplyHostConfig_Task method.

The Profile Engine saves host-specific data in an AnswerFile that is stored on the vCenter Server. The HostProfileManager provides several methods to manipulate answer files.

Profile Compliance

You can create associations between hosts and profiles to support compliance checking. When you perform compliance checking, you can determine if a host configuration conforms to a host profile.

  • To create an association between a host and a profile, use the Profile.AssociateProfile method. The method adds the host to the HostProfile.Profile.entity[] list.
  • To retrieve the list of profiles associated with a host, use the HostProfileManager.ProfileManager.FindAssociatedProfile method.
  • To check host compliance, use the Profile.CheckProfileCompliance_Task method. If you do not specify any hosts, the method will check the compliance of all hosts that are associated with the profile.

You can also use the Profile Compliance Manager to check compliance by specifying profiles, entities (hosts), or both. See ProfileComplianceManager.ProfileComplianceManager.CheckCompliance_Task.

Profile Plug-Ins

The vSphere architecture uses VMware profile plug-ins to define profile extensions. For information about using a plug-in to extend a host profile, see the VMware Technical Note Developing a Host Profile Extension Plug-in.

For access to host configuration data that is defined by plug-ins, use the ApplyProfile.ApplyProfile.policy[] and ApplyProfile.ApplyProfile.property[] lists. The HostApplyProfile and its subprofiles, which collectively define host configuration data, are derived from the ApplyProfile.

  • Policies store ESX configuration data in PolicyOption objects.
  • Profile property lists contain subprofiles defined by plug-ins. Subprofiles can be nested.
    • Subprofile lists are available as an extension to the base host profile (HostProfile.Profile.config.HostProfileConfigInfo.applyProfile.ApplyProfile.property[]).
    • Subprofile lists are available as extensions to the host subprofiles - for example, the network subprofile (HostApplyProfile.HostApplyProfile.network.ApplyProfile.property[]).

If you make changes to host profile data, later versions of profile plug-ins may not support the host configuration implied by the changes that you make. When a subsequent vSphere version becomes available, you must verify that the new version supports any previous configuration changes that you have made.

Implementations§

Source§

impl HostProfile

Source

pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self

Source

pub async fn host_profile_reset_validation_state(&self) -> Result<()>

This API will update the validationState to Ready from Failed, invalidate the validationFailureInfo and reset the validationStateUpdateTime.

This API will return error if the validationState is Running.

Required privileges: Profile.Edit

Source

pub async fn associate_profile( &self, entity: &[ManagedObjectReference], ) -> Result<()>

Associate a profile with a managed entity.

You can check the compliance of entities associated with a profile by calling the Profile.CheckProfileCompliance_Task method.

Required privileges: Profile.Edit

§Parameters:
§entity

The entity(s) to associate with the profile. If an entity is already associated with the profile, the association is maintained and the vCenter Server does not perform any action.

Refers instances of ManagedEntity.

Source

pub async fn check_profile_compliance_task( &self, entity: Option<&[ManagedObjectReference]>, ) -> Result<ManagedObjectReference>

Check compliance of an entity against a Profile.

Required privileges: System.View

§Parameters:
§entity

If specified, the compliance check is performed on this entity. If the entity is not specified, the vCenter Server runs a compliance check on all the entities associated with the profile. The entity does not have to be associated with the profile.

Refers instances of ManagedEntity.

§Returns:

This method returns a Task object with which to monitor the operation.

Refers instance of Task.

Source

pub async fn destroy_profile(&self) -> Result<()>

Destroy the profile.

Required privileges: Profile.Delete

Source

pub async fn dissociate_profile( &self, entity: Option<&[ManagedObjectReference]>, ) -> Result<()>

Remove the association between a profile and a managed entity.

Required privileges: Profile.Edit

§Parameters:
§entity

List of entities. The vCenter Server will remove the associations that the profile has with the entities in the list. If unset, the Server removes all the associations that the profile has with any managed entities in the inventory. If the specified entity is not associated with the profile, the Server does not perform any action.

Refers instances of ManagedEntity.

Source

pub async fn execute_host_profile( &self, host: &ManagedObjectReference, deferred_param: Option<&[ProfileDeferredPolicyOptionParameter]>, ) -> Result<Box<dyn ProfileExecuteResultTrait>>

Run the Profile Engine to determine the list of configuration changes needed for the specified host.

The method generates configuration changes based on the host profile.

You can also specify deferred parameters to verify additional host-specific data. The Profile Engine uses the policy options (HostProfile.Profile.config.HostProfileConfigInfo.applyProfile.ApplyProfile.policy[]) to determine the required parameters (PolicyOption.PolicyOption.parameter[]) for host configuration. If you do not provide all of the required parameters, you must call the method again to provide the complete list to the Profile Engine. After successful profile execution, when you apply the profile, the Profile Engine will save the host-specific data in an AnswerFile.

Required privileges: System.View

§Parameters:
§host

Host on which to execute the profile. The host does not have to be associated with the profile.

Refers instance of HostSystem.

§deferred_param

Additional configuration data to be applied to the host. This should contain all of the host-specific data, including data from from previous calls to the method.

§Returns:

Result of the execution. If the operation is successful (ProfileExecuteResult.ProfileExecuteResult.status=success), the result object includes a valid host configuration specification that you can pass to the HostProfileManager.HostProfileManager.ApplyHostConfig_Task method.

If the operation is not successful, the object contains error information or information about additional data required for the host configuration. If additional data is required, the required input list (ProfileExecuteResult.ProfileExecuteResult.requireInput[]) contains both the deferredParam data and paths to missing parameters. After you fill in the missing parameters, pass the complete required input list via the deferredParam parameter in another call to the execute method to finish input verification. After successful profile execution, you can pass the verified required input list to the HostProfileManager.ApplyHostConfig_Task method.

Source

pub async fn export_profile(&self) -> Result<String>

Export the profile in a serialized form.

To use the serialized string to create a profile, specify a ProfileSerializedCreateSpec when you call the HostProfileManager.ProfileManager.CreateProfile method.

Required privileges: Profile.Export

§Returns:

Serialized form of the profile.

Source

pub async fn retrieve_description(&self) -> Result<Option<ProfileDescription>>

Returns the localizable description for the profile.

Required privileges: System.View

§Returns:

Profile divided into sections containing element descriptions and messages.

Source

pub async fn update_host_profile( &self, config: &dyn HostProfileConfigSpecTrait, ) -> Result<()>

Update the HostProfile with the specified configuration data.

Required privileges: Profile.Edit

§Parameters:
§config

Specification containing the new data.

§Errors:

DuplicateName: If the profile with the new name already exists.

ProfileUpdateFailed: if errors were encountered when updating the profile.

Source

pub async fn update_reference_host( &self, host: Option<&ManagedObjectReference>, ) -> Result<()>

Sets the HostProfile.HostProfile.referenceHost property.

Required privileges: Profile.Edit

§Parameters:
§host

Reference host to use. If unset, the HostProfile.referenceHost property is cleared.

Refers instance of HostSystem.

Source

pub async fn compliance_check_time(&self) -> Result<Option<String>>

The latest compliance check time.

Since: vSphere API Release 8.0.1.0

Source

pub async fn compliance_status(&self) -> Result<String>

Overall compliance of entities associated with this profile.

If one of the entities is out of compliance, the profile is nonCompliant. If all entities are in compliance, the profile is compliant. If the compliance status of one of the entities is not known, compliance status of the profile is unknown. See ComplianceResultStatus_enum.

Source

pub async fn config(&self) -> Result<Box<dyn ProfileConfigInfoTrait>>

Configuration data for the profile.

Required privileges: Profile.Edit

Source

pub async fn created_time(&self) -> Result<String>

Time at which the profile was created.

Source

pub async fn description(&self) -> Result<Option<ProfileDescription>>

Deprecated as of vSphere API 5.0. use Profile.RetrieveDescription instead.

Localizable description of the profile

Source

pub async fn entity(&self) -> Result<Option<Vec<ManagedObjectReference>>>

List of managed entities associated with the profile.

§Returns:

Refers instances of ManagedEntity.

Source

pub async fn modified_time(&self) -> Result<String>

Time at which the profile was last modified.

Source

pub async fn name(&self) -> Result<String>

Name of the profile.

Source

pub async fn reference_host(&self) -> Result<Option<ManagedObjectReference>>

Reference host in use for this host profile.

To set this property, use the HostProfile.UpdateReferenceHost method. If you do not specify a host for validation (HostProfileCompleteConfigSpec.HostProfileCompleteConfigSpec.validatorHost), the Profile Engine uses the reference host to validate the profile.

§Returns:

Refers instance of HostSystem.

Source

pub async fn validation_failure_info( &self, ) -> Result<Option<HostProfileValidationFailureInfo>>

This object is created or updated if the HostProfileValidationState_enum is Failed.

This object captures the most recent validation result for the host profile object in case of failure.

Source

pub async fn validation_state(&self) -> Result<Option<String>>

State of the host profile validation operation.

The values of the state will be one of HostProfileValidationState_enum enumerations.

Source

pub async fn validation_state_update_time(&self) -> Result<Option<String>>

Update time of the validation operation.

Trait Implementations§

Source§

impl Clone for HostProfile

Source§

fn clone(&self) -> HostProfile

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any_ref<'a>(&'a self) -> &'a (dyn Any + 'static)

Cast a reference to Any trait.

Source§

fn as_any_box(self: Box<T>) -> Box<dyn Any>

Cast to a boxed reference to Any trait.

Source§

fn type_id(&self) -> TypeId

Get the underlying type identifier.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<To, T> CastInto<To> for T
where To: CastFrom<T> + ?Sized, T: 'static + ?Sized,

Source§

fn into_ref<'a>(&'a self) -> Option<&'a To>

Casts a reference to a trait object. If the cast fails, std::option::Option::None is returned.
Source§

fn into_box(self: Box<T>) -> Result<Box<To>, Box<dyn Any>>

Casts a boxed trait object to another trait object. If the cast fails, the original boxed trait object is returned in std::result::Result::Err.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,