Update-Entity
This cmdlet remediates an inventory object against the specified baselines. If RunAsync is set, returns a task that can be used to monitor the remediation progress. You can remediate Template, VirtualMachine, VMHost, Cluster, Datacenter, Folder, and VApp objects.
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
Baseline | Baseline[] | named |
|
Specifies the baseline you want to use for the remediation. |
required
|
Entity | InventoryItem | named |
|
Specifies a Template, VirtualMachine, VMHost, Cluster, Datacenter, Folder, or VApp object to remediate. |
optional | ClusterDisableDistributedPowerManagement | Boolean | named |
|
Indicates that you want to temporarily disable Distributed Power Management (DPM) for the specified clusters. After the remediation, DPM is automatically re-enabled. |
optional | ClusterDisableFaultTolerance | Boolean | named |
|
Indicates that you want to temporarily disable Fault Tolerance (FT) for the specified clusters. After the remediation, FT is automatically re-enabled. |
optional | ClusterDisableHighAvailability | Boolean | named |
|
Indicates that you want to temporarily disable High Availability (HA) for the specified clusters. After the remediation, HA is automatically re-enabled. |
optional | ClusterEnableParallelRemediation | Boolean | named |
|
Indicates that you want to enable parallel remediation for the specified clusters. |
optional | ExcludePatch | Patch[] | named |
|
Specifies the patches you want to exclude from the remediation process. |
optional | GuestCreateSnapshot | Boolean | named |
|
Indicates that you want to create a snapshot before initializing remediation. |
optional | GuestKeepSnapshotHours | Int32 | named |
|
Specifies how long (in hours) you want to keep the snapshot. If not set, the snapshots are never deleted. |
optional | GuestSnapshotDescription | String | named |
|
Specifies a description for the snapshot you want to create before initializing remediation. This parameter is valid only if the GuestCreateSnapshot parameter is set. |
optional | GuestSnapshotName | String | named |
|
Specifies a name for the snapshot you want to create before initializing remediation. This parameter is valid only if the GuestCreateSnapshot parameter is set. |
optional | GuestTakeMemoryDump | Boolean | named |
|
Indicates that you want the guest to take a memory dump while creating a snapshot. |
optional | HostDisableMediaDevices | Boolean | named |
|
Indicates that you want to temporarily disable any media devices that might prevent the specified hosts from entering maintenance mode. |
optional | HostEnablePXEbootHostPatching | Boolean | named |
|
Indicates that you want to enable PXE booted ESXi hosts patching. |
optional | HostFailureAction | HostRemediationFailureAction | named |
|
Specifies an action in case the host cannot be placed in a maintenance mode. This might happen due to running virtual machines that cannot be automatically migrated to another host. The valid values are FailTask, Retry, PowerOffVMsAndRetry, and SuspendVMsAndRetry. |
optional | HostIgnoreThirdPartyDrivers | Boolean | named |
|
Indicates that you want to ignore installed third-party software that is incompatible with the upgrade. |
optional | HostNumberOfRetries | Int32 | named |
|
Specifies how many times to retry to set the host into a maintenance mode. |
optional | HostPreRemediationPowerAction | HostPreRemediationPowerAction | named |
|
Specifies an action before trying to enter the host into a maintenance mode. The valid values are PowerOffVMs, SuspendVMs, and DoNotChangeVMsPowerState. |
optional | HostRetryDelaySeconds | Int32 | named |
|
Specifies how long (in seconds) to wait for the host to enter a maintenance mode. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | RunAsync | SwitchParameter | named |
|
Indicates that the command returns immediately without waiting for the task to complete. In this mode, the output of the cmdlet is a Task object. For more information about the -RunAsync parameter run "help About_RunAsync" in the vSphere PowerCLI console. |
optional | Server | VIServer[] | named |
|
Specifies the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. |
Output
Examples
Example 1
Update-Entity -Baseline $baseline -Entity $vmhost -RunAsync -Confirm $false
Remediates a host in asynchronous mode.
Example 2
Update-Entity -Baseline $vmHardwareUpgradeBaseline -Entity $vm -GuestCreateSnapshot:$true
Upgrades a virtual machine with the latest virtual hardware. If the upgrade fails, the command creates a snapshot of the target virtual machine.
Example 3
Update-Entity -Baseline $baseline -Entity $cluster -ClusterDisableDistributedPowerManagement:$true -ClusterDisableFaultTolerance:$true -ClusterDisableHighAvailability:$true
Remediates a cluster with DPM, HA, and FT that are enabled and need to be disabled during the remediation process.
Example 4
Update-Entity -Baseline $baseline -Entity $cluster -ClusterEnableParallelRemediation:$true
Remediates a cluster in parallel mode. All hosts in the cluster are remediated simultaneously and that saves time.
Example 5
Update-Entity -Baseline $baseline -Entity $vmhost -HostIgnoreThirdPartyDrivers:$true
Remediates a host with preinstalled third-party drivers, which prevent host from upgrade.
Related Commands
Entity
This cmdlet remediates an inventory object against the specified baselines.
EntityBaseline
This cmdlet attaches baselines to the specified inventory object.
This cmdlet detaches baselines from the specified inventory objects.
EntityDefaultKeyProvider
This cmdlet adds a key provider to entities as default key provider.
This cmdlet removes the default key provider from the specified entities.