From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-149202-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 64C681381F3
	for <garchives@archives.gentoo.org>; Thu,  1 Aug 2013 01:40:19 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 25936E0AE5;
	Thu,  1 Aug 2013 01:40:14 +0000 (UTC)
Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182])
	by pigeon.gentoo.org (Postfix) with ESMTP id 19C2FE0A6B
	for <gentoo-user@lists.gentoo.org>; Thu,  1 Aug 2013 01:40:12 +0000 (UTC)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rxNq/2dsb2JhbABEvw4Xc4IeAQEFOhwzCxgJExIPBSU3iBHBLY0GGkGCSGEDjX6IDoV+iHCBXoMT
X-IPAS-Result: Av4EABK/CFG4rxNq/2dsb2JhbABEvw4Xc4IeAQEFOhwzCxgJExIPBSU3iBHBLY0GGkGCSGEDjX6IDoV+iHCBXoMT
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; 
   d="scan'208";a="20311217"
Received: from 184-175-19-106.dsl.teksavvy.com (HELO waltdnes.org) ([184.175.19.106])
  by ironport2-out.teksavvy.com with SMTP; 31 Jul 2013 21:40:05 -0400
Received: by waltdnes.org (sSMTP sendmail emulation); Wed, 31 Jul 2013 21:40:04 -0400
From: "Walter Dnes" <waltdnes@waltdnes.org>
Date: Wed, 31 Jul 2013 21:40:04 -0400
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] which VM do you recommend?
Message-ID: <20130801014004.GA27622@waltdnes.org>
References: <1375166739.14240.0@numa-i.igpm.rwth-aachen.de>
 <CAOEsN6ZJWXopa6Jw3Gkh+8wcKrqt=dP2WfeukK7wQZTDMw_qUw@mail.gmail.com>
 <51F79749.6030201@libertytrek.org>
 <20130731003041.GB25154@waltdnes.org>
 <51F8F7B4.7000805@libertytrek.org>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <51F8F7B4.7000805@libertytrek.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Archives-Salt: fc0be9e6-b224-4286-b9f8-2e9e44b1be43
X-Archives-Hash: 09e63021d70ba6b34ad38ee6143a0466

On Wed, Jul 31, 2013 at 07:40:36AM -0400, Tanstaafl wrote
> On 2013-07-30 8:30 PM, Walter Dnes <waltdnes@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 <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications