Hi ipatelvmware,
Welcome to the communities .
you need to write something like below .
#!/bin/bash
vmware-cmd /vmfs/volumes/datastore/VM1_dir/VM1.vmx stop trysoft
vmware-cmd /vmfs/volumes/datastore/VM2_dir/VM2.vmx stop trysoft
I need to shut down ESX hosts
I have tried to implement ghettoUPSHostShutdown.pl, but I dont think it is compatible with VMA 5.0, as i get an error when i try to run it.
I would like to know how i could call on a master script that would esseintially do this :-
shutdownESXi.pl --server server 1 --username Server_username --password Server_Password
shutdownESXi.pl --server server 2 --username Server_username --password Server_Password
shutdownESXi.pl --server server 3 --username Server_username --password Server_Password
shutdownESXi.pl --server server 4 --username Server_username --password Server_Password
Hi ipatelvmware,
I've the same problem with HP power protection...
have you found a solution?
I've resolved the problem by creating another script that starts the commands like:
perl [path to shutdown-script ]/shutdownESXi.pl --server [server1] --username [username] --password [password]
perl [path to shutdown-script ]/shutdownESXi.pl --server [server2] --username [username] --password [password]
perl [path to shutdown-script ]/shutdownESXi.pl --server [server3] --username [username] --password [password]
is working fine 🙂
greets
Hi flash600,
Since I do not know enough about Perl could you post your custom script?
Thank you very much!
Hi,
it's very simple, because I'm not a perl, bash or linux guru 🙂
here the script:
/usr/local/HP/PowerProtector/bin/virt_tools/shutdown-hosts.sh:
#!/bin/sh
perl /usr/local/HP/PowerProtector/bin/virt_tools/shutdownESXi.pl --server [IP esx1] --username [username] --password [password]
perl /usr/local/HP/PowerProtector/bin/virt_tools/shutdownESXi.pl --server [IP esx2] --username [username] --password [password]
perl /usr/local/HP/PowerProtector/bin/virt_tools/shutdownESXi.pl --server [IP esx3] --username [username] --password [password]
...
you must change IP esx1, username and password with your config, example:
perl /usr/local/HP/PowerProtector/bin/virt_tools/shutdownESXi.pl --server 192.168.0.1 --username upsuser --password password
Hi flash600,
you're right ... it's very simple.
thank you very much. 🙂
no problem 🙂
I'm trying to get this working on esx 5.1 but i am getting errors on
LWP::UserAgent is under 6
Server version unavailable at "https://130.0.100.45:443/sdk.vimService.wsdl" at /usr/lib/perl5/5.10.0/VMware/VICommon.pm line 545.