Install-VMHostPatch Command | Vmware PowerCLI Reference

Install-VMHostPatch

This cmdlet updates the specified hosts. The cmdlet installs patches on the host. The patches that can be located locally, on a Web location, or in a host file system. When using the LocalPath or WebPath parameters, the ESX/ESXi host attempts to store the patch contents in its local temporary directory. Because ESXi hosts might not have enough free space on their local drives, this cannot apply to large size patches. The best practice for upgrading an ESXi host is to upload the patch contents on the host's datastore and to run Install-VMHostPatch with the HostPath parameter. If you want to install patches packaged in a ZIP archive, you must extract them and use one of the HostPatch, LocalPath, or WebPath parameters. If you use the HostPath parameter, you must extract each patch to a temporary folder that is named after the patch ID (for example, c:emp\ESX400-200906001\), and copy the folder in the root folder of a datastore. Note that the datastore path is case-sensitive. If you use the LocalPath parameter, you must extract each patch to a folder. The name of the folder must contain the patch ID (for example, "ESX400-200906001"). If you use the WebPath parameter, you must extract each patch to a folder that is published on a Web server. The patch URL address must contain the patch ID (for example, http://myInternalWebServer/esx40/ESX400-200906001/). Depending on the component to be upgraded, you might have to set the host into a maintenance mode and to restart the host or the hostd management service after applying the patch.

Syntax

Install-VMHostPatch
-HostPath < String[] >
-VMHost < VMHost[] >
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
HostPath String[] named
Specifies a file path on the ESX/ESXi host to the patches you want to install.
required
VMHost VMHost[] named
  • pipeline
  • wildcards
Specifies the hosts you want to update.
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 VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Install-VMHostPatch
-LocalPath < String[] >
-VMHost < VMHost[] >
[-HostCredential < PSCredential > ]
[-HostPassword < SecureString > ]
[-HostUsername < String > ]
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
LocalPath String[] named
Specifies the local file system path to the patches you want to install. Providing credentials when installing a patch from a local path is mandatory.
required
VMHost VMHost[] named
  • pipeline
  • wildcards
Specifies the hosts you want to update.
optional HostCredential PSCredential named
Specifies a PSCredential object that contains credentials for authenticating with the host.
optional HostPassword SecureString named
Specifies the password you want to use to authenticate with the host.
optional HostUsername String named
Specifies the username you want to use to authenticate with the host.
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 VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
Install-VMHostPatch
-VMHost < VMHost[] >
-WebPath < String[] >
[-RunAsync ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
VMHost VMHost[] named
  • pipeline
  • wildcards
Specifies the hosts you want to update.
required
WebPath String[] named
Specifies the Web location of the patches you want to install.
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 VMware PowerCLI console.
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.

Output

VMware.VimAutomation.ViCore.Types.V1.Host.VMHostPatchResult

Examples

Example 1

Install-VMHostPatch -VMHost $vmhost1,$vmhost2 -LocalPath c:\esx40\patches\ESX400-200906001\metadata.zip -HostUsername admin -HostPassword pass

Updates ESX servers using a local file. Before running the cmdlet, you must download the patch file locally and extract to a folder. The name of the folder must contain the patch ID (for example, "ESX400-200906001"). Providing credentials when installing a patch from a local path is mandatory.

Example 2

$vmhost | Install-VMHostPatch -WebPath http://myInternalWebServer/esx40/ESX400-200906001/metadata.zip

Upgrades an ESX server using a Web location. Before running the cmdlet, you must download the patch file and extract it to a folder that is published on a Web server. The patch URL address must contain the patch ID (for example, http://myInternalWebServer/esx40/ESX400-200906001/).

Example 3

$datastore = Get-Datastore -Name Datastore

Copy-DatastoreItem c:\temp\ESX400-200906001\

$datastore.DatastoreBrowserPath -Recurse

$vmhost1,$vmhost2 | Install-VMHostPatch -HostPath
/vmfs/volumes/datastore/ESX400-200906001/metadata.zip

Upgrades ESX servers using the -HostPath parameter. First, you must download the patch file and extract its contents to a temporary folder that is named after the patch ID (for example, c:\temp\ESX400-200906001\). Copy the folder in the root folder of the Datastore datastore and run Install-VMHostPatch providing the datastore path to the patch. Note that the datastore path is case-sensitive.

Related Commands

VMHost

This cmdlet adds a host to be managed by a vCenter Server system.

This cmdlet retrieves the hosts on a vCenter Server system.

This cmdlet moves hosts to another location.

This cmdlet removes the specified hosts from the inventory.

This cmdlet restarts the specified hosts.

This cmdlet modifies the configuration of the host.

This cmdlet starts the specified hosts.

This cmdlet powers off the specified hosts.

This cmdlet suspends hosts.

VMHostAccount

This cmdlet retrieves the host accounts available on a vCenter Server system.

This cmdlet creates a new host user or group account.

This cmdlet removes the specified host accounts.

This cmdlet configures a host account.

VMHostAdvancedConfiguration

This cmdlet retrieves the advanced configuration of the hosts.

This cmdlet modifies the advanced configuration settings of a host.

VMHostAttributes

Gets the identifying attributes of a host.

VMHostAuthentication

This cmdlet retrieves authentication information for the specified hosts.

This cmdlet modifies the host authentication information.

VMHostAvailableTimeZone

This cmdlet retrieves the time zones available on the specified host.

VMHostDiagnosticPartition

This cmdlet retrieves a list of the diagnostic partitions on the specified hosts.

This cmdlet activates or deactivates the diagnostic partitions of hosts.

VMHostDisk

This cmdlet retrieves information about the specified SCSI LUN disk.

VMHostDiskPartition

This cmdlet formats a new VMFS (Virtual Machine File System) on each of the specified host disk partitions.

This cmdlet retrieves the partitions of a host disk (LUN).

VMHostFirewallDefaultPolicy

This cmdlet retrieves the firewall default policy of the specified hosts.

This cmdlet sets the default policy for the specified host firewall.

VMHostFirewallException

This cmdlet retrieves the exceptions from the firewall policy on the specified hosts.

This cmdlet activates or deactivates host firewall exceptions.

VMHostFirmware

This cmdlet retrieves hosts firmware information.

This cmdlet configures hosts firmware settings.

VMHostHardware

This cmdlet retrieves ESXi host hardware and firmware information.

VMHostHba

This cmdlet retrieves information about the available HBAs (Host Bus Adapter).

This cmdlet configures the CHAP properties of the specified iSCSI HBAs.

VMHostImageDb

This cmdlet exports the specified host's base image database to a file that is in a .tgz format.

VMHostImageProfile

Gets the image profile associated with the specified ESXi host.

VMHostMatchingRules

Retrieves the list of rules in the rule set that match a specified host.

VMHostModule

This cmdlet retrieves the option strings of the specified host modules.

This cmdlet overrides the host module options with the given ones.

VMHostNetwork

THis cmdlet retrieves the host networks on a vCenter Server system.

This cmdlet updates the specified virtual network.

VMHostNetworkAdapter

This cmdlet retrieves the host network adapters on a vCenter Server system.

This cmdlet creates a new HostVirtualNIC (Service Console or VMKernel) on the specified host.

This cmdlet removes the specified host network adapters.

This cmdlet configures the specified host network adapter.

VMHostNetworkStack

This cmdlet retrieves the host network stacks on a vCenter Server system.

This cmdlet modifies the specified host network stack.

VMHostNtpServer

This cmdlet adds the specified NTP servers to the NTP server list of the specified hosts.

This cmdlet retrieves the NTP servers on the specified hosts.

This cmdlet removes the specified NTP servers from the NTP server list of the specified hosts.

VMHostPatch

This cmdlet retrieves information about the host patches installed on the specified hosts. This cmdlet is deprecated and will not return any results for ESX hosts version 5.0 and later. Use (Get-ESXCli).software.vib.list() as an alternative.

This cmdlet updates the specified hosts.

VMHostPciDevice

This cmdlet retrieves the PCI devices on the specified hosts.

VMHostProfile

This cmdlet exports the specified host profile to a file.

This cmdlet retrieves the available host profiles.

This cmdlet imports a host profile from a file. The file path must be accessible from the VMware PowerCLI client side.

This cmdlet applies a host profile to the specified host or cluster.

This cmdlet creates a new host profile based on a reference host.

This cmdlet removes the specified host profiles.

This cmdlet modifies the specified host profile.

VMHostProfileCompliance

This cmdlet tests hosts for profile compliance.

VMHostProfileImageCacheConfiguration

Retrieves an image cache configuration for the given host profile.

This cmdlet modifies image cache configuration for given host profile.

VMHostProfileRequiredInput

This cmdlet performs a check whether the available information is sufficient to apply a host profile.

VMHostProfileStorageDeviceConfiguration

Retrieves the storage device configuration for the given host profile.

This cmdlet modifies the storage device configuration for the given host profile.

VMHostProfileUserConfiguration

This cmdlet retrieves the user password configuration for the given host profile.

This cmdlet modifies the user password configuration for the specified account within a host profile.

VMHostProfileVmPortGroupConfiguration

Retrieves the virtual machine port group configuration for the given host profile.

This cmdlet creates a new virtual machine port group configuration.

Removes the given virtual machine port group configuration from the host profile.

This cmdlet modifies the virtual machine port group configuration for the given host profile.

VMHostRoute

This cmdlet retrieves the routes from the routing table of the specified hosts.

This cmdlet creates a new route in the routing table of a host.

This cmdlet removes host routes.

This cmdlet modifies a route in the host routing table.

VMHostService

This cmdlet retrieves information about a host service.

This cmdlet restarts the specified host services.

This cmdlet modifies a host service.

This cmdlet starts the specified host services.

This cmdlet stops the specified host services.

VMHostSnmp

This cmdlet retrieves hosts SNMP configuration.

This cmdlet modifies the host SNMP configuration.

This cmdlet tests the host SNMP.

VMHostStartPolicy

This cmdlet retrieves the start policy of hosts.

This cmdlet modifies the host default start policy.

VMHostStorage

This cmdlet retrieves the host storages on a vCenter Server system.

This cmdlet configures a host storage.

VMHostSysLogServer

This cmdlet displays the remote syslog servers of the specified hosts.

This cmdlet configures the remote syslog server of the specified hosts.

VMHostTPM

This cmdlet retrieves the TPM 2.0 devices from the specified host.