I have a Datastore which is really full, and I need to clean it, I am looking for a powercli script that will clean the datastore and only keep the
VMs that are registered
哪问题?
What's the problem?
I need to delete the unregistered Vms from the datastore ? I don't know how to do it in powercli ? How to list all the vms that are not registered
Sorry, you have a search engine search.
it looks like you are new to the fourms
Yes, novice
Have a look at my Orphaned Files Revisited post
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Great link but these I need to delete other VMs not only Orphaned Vms
I only want to keep the registered VMs
What other VMs, besides registered and unregistered (orphaned), do you have then?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
what understand from VMware states that there is a registered VM and there is an Orphaned VM but if you remove a VM from the inventory it will not be Orphaned
That is correct if you use for example the Remove-VM cmdlet with the DeletePermanently switch.
If you don't use that switch, the VM will be unregistered and the files on the datastore for that VM, which will not be removed, will represent an orphaned VM.
The script I pointed to earlier finds such orphaned VMs, in other words it finds VMs sitting on the datastore, but not in the inventory.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference