Cross SSO vMotion Between vCenters

This week I am sharing a very helpful PowerCLI script to vMotion a vm from one SSO domain to another SSO domain.  I shamelessly borrowed this script from Romain Decker’s site Cloud Maniac. The original script was very good and functioned well.  I just took it a step further and added some functions to customize it for our environment.  These functions are:  Get-SourcevCenter, Get-DestvCenter, Ask-VMNameForMigration, Ask-DCForMigration, Ask-ClusterForMigration, Choose-StorageForVMMigration.  The names of each function should explain their use.   Essentially you will need to edit the script to customize some of these functions for your environment. 

I have used it dozens of times and it works flawlessly with one exception.  If your EVC modes don’t quite match between vCenters there may be some vms that cannot be vMotioned while powered on.  Just arrange for a downtime and try again with the vm powered off.  It will work well.  This sure beats downloading a vm to your desktop and then uploading it to the new vCenter environment.  If you need any explanation or help with modifying this code to fit your environment please feel free to comment.

( If you like this please check out some of my other PowerCLI posts like PowerCLI Get-vCenter Function )

Caution: Like all code you download from the internet, please understand and modify the code accordingly to prevent unforeseen production problems.  Also known as career-altering events. 

Cross SSO vMotion PowerCLI Code: 

Photo by bruce mars from Pexels
Thinking equals coding

 

 

Using PowerCLI to Patch ESXi Hosts

I have been looking to automate more processes at work and patching ESXi hosts was definitely in my top 5 PowerCLI projects.  I really like the simplicity of Ben Liebowitz’s script over at The Lowercase w.  I will use this as a starting point for my own script. (Not that it needs too much tweaking.  Good job Ben!)

Please follow the link below to see the script.

Source: Patching VMware ESXi Hosts via PowerCLI! « The Lowercase w