On Wed, Jul 31, 2013 at 07:40:36AM -0400, Tanstaafl wrote
> On 2013-07-30 8:30 PM, Walter Dnes <waltd...@waltdnes.org> wrote:
> >
> >    Why do you need vmware tools?  From the host, execute...
> >
> > ssh root@<guest> /sbin/poweroff
> 
> Two reasons this isn't sufficient...
> 
> 1. Extended power outage
> 
> If my UPS sends a shutdown command to the host, I (obviously) want it to 
> safely shutdown ALL running VMs.
> 
> 2. Manual host shutdown
> 
> I have my hosts configured so that if I press/release the power button, 
> the host goes through a full power down process. I (obviously) want this 
> process to also initiate safe shutdowns on all running VM's.
> 
> I do not want to have to SSH in and manually run a command to 
> uncooperative VM's first, I want to just be able to press/release the 
> power button, and have the host safely shut down all running VMs, then 
> itself.

  ***IT DOES NOT HAVE TO BE MANUAL*** I have a 1-line script that shuts
down my hot-backup machine, which I bring up once a month for updates.
Here it is...

#!/bin/bash
ssh waltdnes@d531 sudo /sbin/poweroff

...with an appropriate entry in /etc/sudoers.d.  In your case, you can
have your script run like so (assuming the VM's port 22 is redirected to
60022)

#!/bin/bash
ssh -P 60022 root@localhost /sbin/poweroff

  I repeat, this is scriptable, and does not have to be manual.

-- 
Walter Dnes <waltd...@waltdnes.org>
I don't run "desktop environments"; I run useful applications

Reply via email to