ESXI shell register all the *.vmx files in datastore/s

Using below bash script we can register all the vms in datastores with ESXi host.This has tested in vSphere 6.5 & 6.7 Hol

 

for myvm in $(find / -name *.vmx);

do

vim-cmd solo/registervm $myvm

done

if we want we can find on specific datastore. please refer the below example

find /vmfs/voluems/datastore10R10/ -name *.vmx

(datastore10R10 is my datatore name)

 

 

 

 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.