I finally bit the bullet and migrated my lab from a vCenter virtual appliance to a vCenter Windows server. This is what I did to maintain all my settings and not disrupt any currently running VMs.
Download InventorySnapshot to a workstation or your new VCenter server (as long as the vmware powerCLI and Java 1.5 is installed).
- Run the run.bat file to start InventorySnapshot
- Put in the IP or hostname of your old VMware appliance as well as the credentials and a good place to drop the resulting snapshot, select to “Take Snapshot”
- A new window will come up with a few tabs that looks like this:
- Don’t worry about the host passwords, just make sure everything is selected in the Inventory Tree tab and then select the Generate PowerCLI code in the last tab.
- Copy all the output from the folder you specified earlier to the new vCenter server.
- Open a VMware vSphere PowerCLI window and run the following to connect locally:
- Open the createInventory.ps1 file then copy and paste everything above the line that states, “# ### START ADDHOSTS CLUSTER”
- At this point you have the basic cluster setup but not much else. I was unable to get the hosts to automatically add. To get around this I just manually added them (kinda stole them from the vCenter virtual appliance). So open up a vSphere client and connect to your new vCenter server, right0click on your cluster and select to add a host. Proceed to add all the hosts in your cluster. (Note: You will get warnings about duplicating configurations and causing issues with the old vCenter server, that is ok, just select Yes and move on as all host configuration for networking and storage will be maintained and no outage for currently running VMs will occur).
- By the time you have gotten to this point your old VMware appliance will show all hosts and VMs as disconnected and your new vCenter server will have all the goods.
- But what about everything else? Luckily enough, most networking and other host settings carry over so your VMs should have stayed live this entire time. But if you had DRS or host affinities setup there is more you can do to automate the flip to your new server. Go back into that createInventory.ps1 file and comment out (with #) the first several lines of the script which creates the cluster and adds the hosts. It will look something like this when you are done (minus the rest of the script, just leave all that other stuff alone).
# ### START RESTORE DC: Datacenter
# ### START CREATE DC: Datacenter
# Create DC: Datacenter in folder: null
$parentFolder = Get-Folder -NoRecursion
#New-Datacenter -Location $parentFolder -name "Datacenter"
# ### END CREATE DC: Datacenter
# ### START RESTORE CLUSTER: Cluster1
# ### START CREATE_CLUSTER_IN FOLDER: host
# ### START CREATE CLUSTER: Cluster1
# Create cluster: Cluster1 in datacenter Datacenter
# parent folder of cluster Cluster1 host
# Finding Parent Folder. Path: //Datacenter/host
$si = Get-View -id "SearchIndex-SearchIndex"
$parentChain = "//Datacenter/host"
$parentFolderId = $si.FindByInventoryPath($parentChain)
$parentFolder = Get-Folder -id $parentFolderId
#New-Cluster -Location $parentFolder -Name "Cluster1"
# ### END CREATE CLUSTER: Cluster1
# ### END CREATE_CLUSTER_IN FOLDER: host
# ### START ADDHOSTS CLUSTER: Cluster1
$cluster = Get-Cluster -location (get-datacenter -name "Datacenter") -name "Cluster1"
# Adding host 192.168.1.250 to cluster "Cluster1"
#Add-VMHost 192.168.1.250 -Location $cluster -user root -password 'PASSWORD' -Force
# Adding host 192.168.1.251 to cluster "Cluster1"
#Add-VMHost 192.168.1.251 -Location $cluster -user root -password 'PASSWORD' –Force
- Then save and run the script in the already open VMware PowerCLI window. You may get a few errors or warnings but it should complete. When this is done all of your old settings should have migrated over without much fanfare.