Quantcast
Channel: VMware Communities : Popular Discussions - VMware ESX 4
Viewing all articles
Browse latest Browse all 36074

Scripting an ESX host shutdown

$
0
0

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.


Viewing all articles
Browse latest Browse all 36074

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>