Find Virtual Machine

by Chris Kranz on Jan.20, 2009, under Command Line

Can’t remember which datastore a certain virtual machine is on and you’re on the command line only? Can happen, honest! In conjunction with other scripts, this can be quite helpful though. Just call the script and pass it the server name you are looking for.

[root@esx007 root]# cat find_server.sh
#!/bin/sh

echo Locating server $1
ls -1F /vmfs/volumes/ | grep @ | cut -d @ -f 1 | while read dir; do
 find /vmfs/volumes/${dir}/ -iname ${1}*
done

VN:F [1.9.11_1134]
Rate this post:
Rating: 0.0/10 (0 votes cast)

:

Leave a Reply

Bad Behavior has blocked 1177 access attempts in the last 7 days.

© 2009-2012 Chris Kranz All Rights Reserved
This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.