ConfigMgr

VMware, Azure and Automation

Upgrading ESXi 6.0 hosts with PowerCLI

3 april 2020 PowerCli Powershell Script VMware

The last step in my migration project was to actually upgrade the hosts to a supported version. This means that all hosts are upgraded to 6.7 except for those hosts that are a bit to old and only support 6.5.

For the upgrade, I used Update Manager to store the ESXi 6.7 ISO file and to attach the upgrade baseline to the clusters that can run 6.7. Unfortunately, the VIB from the Cisco 1000V Distributed Switch was still installed but not compatible with the upgrade image. So I needed to come up with a solution to remove that VIB before upgrading the host. I wrote the following script to perform these steps:

First, the script performs the following steps:

  • Get a reference to the cluster
  • Disable HA
  • Disconnect ISO’s from VMs and set the CD to disconnected
  • Attach the upgrade baseline and the patch baseline to the cluster
  • Test compliance of the upgrade baseline
  • Get a reference to all hosts that are not compliant

Then the script performs the following steps to every host that is not compliant:

  • Enter Maintenance Mode
  • Remove the VIB
  • Upgrade the host
  • Test compliance of the patch baseline
  • Patch the host
  • Exit Maintenance Mode

On average, every host took about 75 minutes to do the upgrade and to install the patches. But because it is automated it took me less than 5 minutes per cluster.

Unfortunately, this script could only perform an upgrade to 6.7 as this is the only version you can import in Update Manager. So I needed another script for upgrading hosts to 6.5.

This script uses a local upgrade method where the upgrade ZIP file is available on a datastore. First, the script performs the following steps:

  • Get a reference to the cluster
  • Select a datastore in each datacenter with the most available free space
  • Copy the offline ZIP file to both datastores
  • Disconnect ISO’s from VMs and set the CD to disconnected

Then the script performs the following steps to every host in the cluster:

  • Enter Maintenance Mode
  • Remove the VIB
  • Upgrade the host
  • Exit Maintenance Mode

When every host is upgraded the offline ZIP files are removed from the datastores. And with that, all hosts in the cluster are upgraded to 6.5. The only remaining task was to patch the hosts, but for this, I could use the Update Manager again.

esxi6esxi6.5esxi6.7powercliupgrade

Migrating ESXi Hosts to Another vCenter Server

Migrating Windows PSC to VCSA - failed to send HTTP data

Recent Posts

  • Using API for Aria OPS Chargeback
  • Unable to set reservation on Org VDC
  • Veeam Tweaks
  • VCF Anyone? Get your license for free…
  • Configure Entra ID as Cloud Director IdP

Recent Comments

Geen reacties om te tonen.

Archives

  • april 2025
  • maart 2025
  • november 2024
  • oktober 2024
  • januari 2024
  • november 2023
  • oktober 2023
  • september 2023
  • juni 2023
  • mei 2023
  • april 2023
  • november 2022
  • maart 2021
  • februari 2021
  • januari 2021
  • november 2020
  • oktober 2020
  • september 2020
  • juli 2020
  • juni 2020
  • april 2020
  • maart 2020
  • februari 2020
  • oktober 2019
  • september 2019
  • juli 2019
  • juni 2019
  • mei 2019
  • maart 2019
  • februari 2019
  • januari 2019
  • december 2018
  • november 2018
  • april 2018
  • januari 2018
  • juli 2017
  • juni 2017
  • mei 2017

Categories

  • AnyLinq
  • Azure
  • Cloud Director
  • ConfigMgr
  • DIY
  • HomeAssistant
  • Microsoft
  • PowerCli
  • Powershell
  • SCCM
  • Script
  • Solutions
  • System Center
  • Veeam
  • VMware
  • vRealize Automation
  • vRealize Orchestrator
Proudly powered by WordPress | Theme: Doo by ThemeVS.