VMware Cloud Community
cappuccino_cowb
Contributor
Contributor

Recently had an issues with VCD 5.5.2 where a multitude of VMs became deregistered from vCenter and I need to add them back

Users started reporting they could not deploy VMs from templates. Upon inspecting the templates were showing 0MB disk files. When I checked the VM in vCenter I noticed it was not registered. I registered the VM and everything began working without issues. I now need to know the easiest way to search all datastores and folders in a vCenter to find all VMs that are not registered and to register them.

0 Kudos
3 Replies
LucD
Leadership
Leadership

Have a look at VMX Raiders Revisited and Raiders of the Lost VMX


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
cappuccino_cowb
Contributor
Contributor

That script could work, but it asks for too many values to be input. There are 100+ hosts, more than 500 datastores and a magnificent number of folders to transverse. Is there any way to change all of the values to just accept wildcards * ?

0 Kudos
LucD
Leadership
Leadership

You can call the Register-VMX functio in a foreach loop.

Something like this for example

foreach($cluster in Get-Cluster){

    Register-VMX -EntityName $cluster -WhatIf

}

Remove the WhatIf switch after you did a test run and are sure the script is doing what you want it to do.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos