• About me…
  • VMware
  • Powershell
  • DIY

ConfigMgr.nl

VMware, PowerShell, Automation, and more…

  • About me…
  • VMware
  • Powershell
  • DIY

Migrating ESXi Hosts to Another vCenter Server

6 maart 2020 PowerCli Script VMware No Comments

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

Geef een antwoord Reactie annuleren

Deze site gebruikt Akismet om spam te verminderen. Bekijk hoe je reactie-gegevens worden verwerkt.

Recente berichten
  • Copying Home Assistant configuration to GitHub
  • Handy one-liners
  • The system has insufficient locker space for the image profile
  • Testing Script Runtime Service for vSphere – part 2
  • Reporting on your Windows Server backup
Categorieën
Proudly powered by WordPress | Theme: Doo by ThemeVS.