<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">All,<div class=""><br class=""></div><div class="">I'm answering my own question here, but, a few other users reached out to me about it so I'm posting my own crafted solution below which I've found to work very well with my particular setup.</div><div class=""><br class=""></div><div class="">The key of making an HA zone (assuming RSF-1 is already working properly) is to configure both/all nodes with the zone making sure they point to the shared storage and making sure all vnic or other networking is already in place (and make sure theres no naming conflicts). If you update the zone configuration on one node you need to do it to all of them so when a failover occurs you don't end up with a different config. I didn't bother automating that part since that can be a tricky issue that adds complexity that I don't need in my case. </div><div class=""><br class=""></div><div class="">Here's the core of the failover logic needed:</div><div class=""><br class=""></div><div class="">In /opt/HAC/RSF-1/etc/rc.appliance.c/ add these scripts:</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">First, a kill script for ONLY the related zones on the shared storage going down. RSF-1 is kind enough to give us an exported variable RSF_SERVICE we can extract some important info from :D</div><div class=""><br class=""></div><div class="">K70_zones</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class="">#!/bin/bash</div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">SERVICE=${RSF_SERVICE:-"servicename"}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># halt related non-global zones referencing failing service</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">ZONES=$(zoneadm list | egrep -v '^global$')</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">while read ZONE; do</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    zonecfg -z $ZONE export | grep "$SERVICE"</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    [[ "$?" == "0" ]] && zoneadm -z $ZONE halt</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">done <<< "$ZONES"</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">And a start script to attach and bring up any/all accessible/attached/installed zones:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">S70_zones</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#!/bin/bash</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># attach configured zones</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">CZONES=$(zoneadm list -c | egrep -v '^global$')</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">while read ZONE; do</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    zoneadm -z $ZONE attach -F</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">done <<< "$CZONES"</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""># boot installed zones</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">IZONES=$(zoneadm list -c | egrep -v '^global$')</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">while read ZONE; do</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">    zoneadm -z $ZONE boot</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(244, 244, 244); background-color: rgb(0, 0, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">done <<< "$IZONES"</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">There's obviously room for improvement, but, this is all I need in order to make my LX zones (hosting beegfs storage servers) highly available for our HPC cluster :)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">If anyone has any suggestions to make this better, I'm all ears.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div><div class="">Michael</div><div class=""><br class="">
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 18, 2017, at 1:35 PM, Michael Talbott <<a href="mailto:mtalbott@lji.org" class="">mtalbott@lji.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Anyone out there use RSF-1 ( <a href="http://www.high-availability.com/" class="">http://www.high-availability.com</a> ) for ZFS HA and have some good scripts (or best practices) for handling failing over the zones along with the storage pools?<div class=""><br class=""></div><div class="">Since I started using some zones on my storage nodes, it occured to me that if a failover were to happen it'll probably hang since the zones would be in-use and there's no scripts currently in place to stop them, export the config, import the config, and start them up on the other node.</div><div class=""><br class=""></div><div class="">Before I go and write my own implementation I figured I'd see if anyone else has a good solution already written.</div><div class=""><br class=""></div><div class=""><div class="">Thanks,</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Michael</div><div class="">

<br class=""></div></div></div></div></blockquote></div><br class=""></div></body></html>