General ramblings on fencing

I have been playing around with pmsapp v0.2 in my new vmware environment and I got to thinking that maybe it was possible to fence through vmware… And it is.

A bit of googling gave me this result it turns out that the fence_vmware agent depends on the VI Perl Toolkit so I googled a bit more to find an installation guide from VMware:

As I am working on CentOS the perl dependencies can be installed through RPMs. The following list of RPMs seems to satisfy the dependencies.

perl-Crypt-SSLeay \
perl-XML-LibXML \
perl-libwww-perl \
perl-Class-MethodMaker \
perl-devel \

I followed VMwares guide to build and install the VI Perl Toolkit, but afterwards it still did not work.

I got an error message saying:

fence_vmware_helper returned Undefined subroutine &Opts::add_options called at /usr/sbin/fence_vmware_helper line 82.

Googling for that error gave me this result:

Basicly, I need to edit /usr/local/share/perl5/VMware/ and add:

use VMware::VILib;

above the line:

use VMware::VIM2Runtime;

Now I am able to check the status of a VM with fence_vmware

fence_vmware -o status -a vcenterserver -l [username] -p [password] -n [vmname]