We need to simulate a power loss at our central office for DR purposes. I would need to run the shutdown scripts from a Windows server (physical server) which is connected via serial cable from our Liebert UPS. I will be using 'plink' and it's switches in order to perform the shutdown of the ESX hosts, as I do not wish to shutdown all of our ESX hosts serviced by VirtualCenter. We are simulating a power loss at our central office. Our VirtualCenter is a vm.
When I run the following script "plink -ssh root@esx_ip_address -pw root_password poweroff -p" I receive an 'access denied' message because I have root ssh access disabled.
plink -ssh esx_ip_address -l local_user_name -pw local_user_password
su -
root_password
poweroff -p
How would I put this all into a script and be able to shutdown the ESX host? When I attempt to run them together in the same script, it does not get past the first line. If I run the following commands one at a time I am able to shut the ESX host off:
Any help would be greatly appreciated.