`<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks for the scripts, but I would like to avoid hardcoding pool names anywhere. Due to specific roles of my ZFS servers it is possible to export all zpools at iSCSI stop and import all visible pools at iSCSI start. So, I end up with following modifications:</div><div class=""><br class=""></div><div class="">/lib/svc/method/iscsi-initiator:</div><div class="">at start:</div><div class=""> sleep 5<br class=""> zpool import -a</div><div class=""><div class="">at stop:</div></div><div class=""> zpools=$(zpool list | awk '!/^rpool / && !/^NAME / {print $1}')</div><div class=""> if [ -z $zpools ]; then<br class=""> echo "No ZFS pools to export"<br class=""> return $rc<br class=""> fi<br class=""> for pool in $zpools; do<br class=""> echo "Exporting pool $pool"<br class=""> zpool export $pool<br class=""> echo "Done, rc=$?"<br class=""> done</div><div class=""><br class=""></div><div class="">For zpool command to work from SMF service I've also removed privilege restrictions:</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>svccfg -s iscsi/initiator delprop start/privileges</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>svccfg -s iscsi/initiator delprop stop/privileges<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>svcadm refresh iscsi/initiator:default<br class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">30 нояб. 2016 г., в 22:47, Jim Klimov <<a href="mailto:jimklimov@cos.ru" class="">jimklimov@cos.ru</a>> написал(а):</div><br class="Apple-interchange-newline"><div class="">30 ноября 2016 г. 17:45:53 CET, "Дмитрий Глушенок" <<a href="mailto:glush@jet.msk.su" class="">glush@jet.msk.su</a>> пишет:<br class=""><blockquote type="cite" class="">The 'reboot' works, but it kills all processes at once (including<br class="">iscsid), leaving no chances for ZFS to flush write cache. And I suspect<br class="">that with current iscsi/initiator SMF service implementation the same<br class="">happens (but for some reason sync(), which is being called by 'reboot'<br class="">after killing all processes, is not hangs).<br class=""><br class=""><blockquote type="cite" class="">30 нояб. 2016 г., в 18:05, Chris Siebenmann <<a href="mailto:cks@cs.toronto.edu" class="">cks@cs.toronto.edu</a>><br class=""></blockquote>написал(а):<br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">Does anybody uses ZFS over iSCSI?<br class=""><br class="">There is problem with reboots as iscsi-initiator service does not<br class="">taking care of ZFS while shutting down. It leads to zpool goes into<br class="">UNAVAIL state and then first sync() issued gets blocked with<br class=""></blockquote></blockquote>following<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">stack:<br class=""></blockquote><br class="">We have a significant ZFS-over-iSCSI fileserver environment and<br class="">haven't seen this, but we may be shutting our systems down in a<br class="">different way than you are.<br class=""><br class="">We're on OmniOS r151014 and we haven't seen this behavior when we<br class="">reboot or shut down our systems via 'reboot' or 'poweroff'. For us it<br class="">seems to go the other way around; running 'reboot' won't completely<br class=""></blockquote>shut<br class=""><blockquote type="cite" class="">down the iSCSI initiator before the machine reboots, apparently<br class=""></blockquote>because<br class=""><blockquote type="cite" class="">it's being held busy by our active ZFS pools.<br class=""><br class="">It may be relevant that we're using OmniOS multipathing across two<br class="">IPs for each target (configured statically); this might change the<br class="">device stack inside the kernel.<br class=""><br class="">I don't think we've ever tried 'shutdown' itself on a live production<br class="">system, so I don't know how that would work.<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>- cks<br class=""></blockquote><br class="">--<br class="">Dmitry Glushenok<br class="">Jet Infosystems<br class=""><br class=""><br class=""><br class="">------------------------------------------------------------------------<br class=""><br class="">_______________________________________________<br class="">OmniOS-discuss mailing list<br class=""><a href="mailto:OmniOS-discuss@lists.omniti.com" class="">OmniOS-discuss@lists.omniti.com</a><br class="">http://lists.omniti.com/mailman/listinfo/omnios-discuss<br class=""></blockquote><br class="">Shameless plug: did you try an approach like <a href="https://github.com/jimklimov/illumos-smf-zfspools" class="">https://github.com/jimklimov/illumos-smf-zfspools</a> to define an SMF dependency between a pool whose vdevs reside on an iscsi initiator, or an iscsi target residing on a pool, and perhaps other services like zones to depend on the non-rpool zfs pool (SMFized)?<br class=""><br class="">At least for the case of well ordered and synced graceful shutdowns and startups, this should help you.<br class=""><br class="">HTH, Jim Klimov<br class="">--<br class="">Typos courtesy of K-9 Mail on my Samsung Android<br class=""></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">Dmitry Glushenok</div><div class="">Jet Infosystems</div></div></div></div></div></div></div></div></div></div></div></div>
</div>
<br class=""></body></html>`