Home > Command Line > Find Virtual Machine

Find Virtual Machine

January 20th, 2009 Leave a comment Go to comments

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.3_1094]
Rate this post:
Rating: 0.0/10 (0 votes cast)

  1. No comments yet.
  1. No trackbacks yet.

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

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