<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>&gt; Date: Fri, 4 Jul 2014 23:17:07 +0900<br><div>&gt; From: lists@alteeve.ca<br>&gt; To: pacemaker@oss.clusterlabs.org<br>&gt; Subject: Re: [Pacemaker] Creating a safe cluster-node shutdown script (for when UPS goes OnBattery+LowBattery)<br>&gt; <br>&gt; On 04/07/14 02:16 PM, Giuseppe Ragusa wrote:<br>&gt; &gt; Hi all,<br>&gt; &gt; I'm trying to create a script as per subject (on CentOS 6.5,<br>&gt; &gt; CMAN+Pacemaker, only DRBD+KVM active/passive resources; SNMP-UPS<br>&gt; &gt; monitored by NUT).<br>&gt; &gt;<br>&gt; &gt; Ideally I think that each node should stop (disable) all locally-running<br>&gt; &gt; VirtualDomain resources (doing so cleanly demotes than downs the DRBD<br>&gt; &gt; resources underneath), then put itself in standby and finally shutdown.<br>&gt; &gt;<br>&gt; &gt; On further startup, manual intervention would be required to unstandby<br>&gt; &gt; all nodes and enable resources (nodes already in standby and resources<br>&gt; &gt; already disabled before blackout should be manually distinguished).<br>&gt; &gt;<br>&gt; &gt; Is this strategy conceptually safe?<br>&gt; &gt;<br>&gt; &gt; Unfortunately, various searches have turned out no "prior art" :)<br>&gt; <br>&gt; I started work on something similar with apcupsd (first I had to make it <br>&gt; work with multiple UPSes, which I did). Then I decided not to actually <br>&gt; implement, and decided instead to leave it up to an admin to decide <br>&gt; how/when/if to initiate a graceful shutdown.<br>&gt; <br>&gt; My rationale was that this placed way too much potential damage in the <br>&gt; hands of, effectively, a single trigger. One bad bug and you could bring <br>&gt; down a perfectly fine cluster.<br><br>Perfectly reasonable, in fact I was limiting my effort to a single, narrowly defined case.<br><br>&gt; Instead, what I did was ensure that any power event triggered an alert <br>&gt; email (x2, as both nodes ran the monitoring app). This way, I (and the <br>&gt; client's admins) would be notified immediately if anything happened. <br>&gt; Then it was up to us to decide how/if to initiate a graceful shutdown.<br><br>My clients business setup is peculiar too: too big to disregard HA 
solutions, but<br>too small to have staff/consultants on call for "secondary" 
emergencies (like<br>power going extendedly down during summer storms 
etc.).<br><br>&gt; One real-world example;<br>&gt; <br>&gt; A couple months ago, a client's neighborhood was hit with a prolonged <br>&gt; power outage. Eventually, we decided to gracefully shut down. However, <br>&gt; one of the windows VMs had downloaded and prepped to install about 30 <br>&gt; updates (no idea how this happened, except windows). Anyway, the VM took <br>&gt; more time to shut down than the batteries could support. So half-way <br>&gt; through, we withdrew one node and powered it off to shed load and gain <br>&gt; battery runtime. This kind of logic can not reasonably be coded into a <br>&gt; script.<br><br>Enlightening tale!<br><br>Thinking of it: I suppose that more VM-intensive needs (VDI etc.) would qualify for VM-specific<br>HA solutions (like oVirt/OpenStack) where VMs could be treated totally as physical<br>machines (install UPS agents on the guest OS and let them go); on a "classic" HA clustering<br>solution instead, I suppose that VMs should be server VMs (or treated like that) and<br>even Windows admins would know multiple ways (interactive, GPO, registry) to ensure<br>controlled behaviour of updates installation (tipically "interactive installation during a maintenance<br>window"). Leaving "install by default on shutdown" on does not speak well for those admins ;&gt;<br><br>&gt; My $0.02.<br>&gt; <br>&gt; -- <br>&gt; Digimer<br><br>Many thanks for your suggestions and shared experiences!<br><br>Regards,<br>Giuseppe<br><br></div>                                               </div></body>
</html>