ConfigMgr

VMware, Azure and Automation

Migrating ESXi Hosts to Another vCenter Server

6 maart 2020 PowerCli Script VMware

As part of a migration project, ESXi hosts needed to be migrated to a new vCenter appliance. The Cisco 1000v distributed virtual switch was stripped out and converted to standard switches. So basically it was a matter of disconnecting, and removing the hosts from the old vCenter and adding them to the new vCenter inventory. But with more than 150 hosts I didn’t want to do it manually. So I put together a script… Please be aware that the script contains some specific code that you will need to customize to get it to work in your environment.

The script uses two parameters: Cluster and Root Folder. Cluster is specifying the cluster. Root Folder is for pointing to the root folder of the VM folders. This was necessary because there were duplicate folder names.

After connecting to both vCenter Servers I save the DRS host rules and VM rules. I also save the DRS VM groups. That was not necessary for the Host groups.

Then it is time to do the actual migration. For every host in the cluster I perform the following steps:

  • Create a file with VMs and folder paths
  • Disconnect the host from the source vCenter Server
  • Remove the host from the source vCenter Server
  • Add the host to the destination vCenter Server
  • Move the host to the cluster on the destination vCenter Server
  • Move the VMs to their own folder

When the previous steps are done, I create the DRS Host groups and VM groups and enable DRS on the cluster on the destination vCenter Server.

Finally, I create the DRS VM rules and disconnect from both vCenter Servers.

esxihostmigratevCenter

Building a lab - recurring issues

Upgrading ESXi 6.0 hosts with PowerCLI

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.