From nobody Fri Feb 17 17:03:49 2023 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PJJ7S2LJhz3r9Yx for ; Fri, 17 Feb 2023 17:04:04 +0000 (UTC) (envelope-from f0andrey@gmail.com) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PJJ7R575dz3kZf; Fri, 17 Feb 2023 17:04:03 +0000 (UTC) (envelope-from f0andrey@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=MFReEnDO; spf=pass (mx1.freebsd.org: domain of f0andrey@gmail.com designates 2001:4860:4864:20::29 as permitted sender) smtp.mailfrom=f0andrey@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-171894cdf02so1621372fac.11; Fri, 17 Feb 2023 09:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=N3KqzEFCIIfQZduF6kVhk+Bm2gwP4vVz1PE6PWxqluE=; b=MFReEnDOKPfyZP+HplU8r55UEdkwTDz06nKQJOb9DQ9D50KeulMtf5A2/GStJrfgAd /AepcuSFkIo8UPwqYyeDAstp/a6By7bctwGSFslZG0PXbWPpmLeJSUYv2bkJ8h62ociF rKW+D7+lIosEJh1fix3BfLHZO5gxyuqtq2GwyQdUcmDa5oC0fOB0H5QgjbRdsk+0plhd 5qsd9nnMWzYffitH72PIpinvmaSIN4cWCM0s6zGdwW7JOAHrLAA9m7j6YpjRD5PfULQW HnRPGxADe9HvEJ4NOmkTMYCUEppGdsYy+AuKPMEQ5LCj/Lb0POlSjHdDXS93ZXFNFZYP Wcaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N3KqzEFCIIfQZduF6kVhk+Bm2gwP4vVz1PE6PWxqluE=; b=UUDPoLV0TJH6A3G9QR8M6eyfLOBCZSb18v1yYKpdpJVrtO8vuGipbn4N9XQ9c+DWPY PB3jiy5sktx8Ud+S53TLA1Zwn+oMAlCUhfMu1F4CFF2QEBMyJ82IuYo+Puek3diFgfLr 7mHEM4TwN/z631kuDjzgrpm5WqJOx2IuAoiP5Nhb7pCHvYRx3VPa6V0Pmi0N7M7RBglF CSs0aSLUSPJu/MPcdmEPL6FN6SHYiqQDbtD4c2EHn7da0kfjPHVjzqX6x1M28uIfY017 33Fux9RxjH8rrLQ6g6lXoB5WqD+gd1XEU2eTT0vQ3OnafIV5pQF6xjxA7U0xzseDGqX8 oWLw== X-Gm-Message-State: AO0yUKVZdNo2TUh8yrz1d80s1QSOC68/SM9SudirPyQKbz5nB1oRJ7br cCzYarbrm/3EDHSh7IDNOPuzSZRFJh/tNlN47GSSWh/aHk8= X-Google-Smtp-Source: AK7set+rFdLY32waVaIqrR2i0M7Kn6ahGBPrnKgH6sgRLHEcIYORf6Yac8Y0fN8SGdXccdMh+7et4mWrmxU4NsH6yjk= X-Received: by 2002:a05:6870:b909:b0:16a:6ef8:bbef with SMTP id gx9-20020a056870b90900b0016a6ef8bbefmr648213oab.264.1676653441767; Fri, 17 Feb 2023 09:04:01 -0800 (PST) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Andrey Fesenko Date: Fri, 17 Feb 2023 20:03:49 +0300 Message-ID: Subject: Re: RFC: GEOM and hard disk LEDs To: Alan Somers Cc: FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.975]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2001:4860:4000::/36]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2001:4860:4864:20::29:from]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4PJJ7R575dz3kZf X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Wed, Feb 8, 2023 at 2:31 AM Alan Somers wrote: > > Most modern SES backplanes have two LEDs per hard disk. There's a > "fault" LED and a "locate" LED. You can control either one with > sesutil(8) or, with a little more work, sg_ses from > sysutils/sg3_utils. They're very handy for tasks like replacing a > failed disk, especially in large enclosures. However, there isn't any > way to automatically control them. It would be very convenient if, > for example, zfsd(8) could do it. Basically, it would just set the > fault LED for any disk that has been kicked out of a ZFS pool, and > clear it for any disk that is healthy or is being resilvered. But > zfsd does not do that. Instead, users' only options are to write a > custom daemon or to use sesutil by hand. Instead of forcing all of us > to write our own custom daemons, why not train zfsd to do it? > > My proposal is to add boolean GEOM attributes for "fault" and > "locate". A userspace program would be able to look up their values > for any geom with DIOCGATTR. Setting them would require a new ioctl > (DIOCSATTR?). The disk class would issue a ENCIOC_SETELMSTAT to > actually change the LEDs whenever this attribute changes. GEOM > transforms such as geli would simply pass the attribute through to > lower layers. Many-to-one transforms like gmultipath would pass the > attribute through to all lower layers. zfsd could then set all vdevs' > fault attributes when it starts up, and adjust individual disk's as > appropriate on an event-driven basis. > > Questions: > > * Are there any obvious flaws in this plan, any reasons why GEOM > attributes can't be used this way? > > * For one-to-many transforms like gpart the correct behavior is less > clear: what if a disk has two partitions in two different pools, and > one of them is healthy but the other isn't? > > * Besides ZFS, are there any other systems that could take advantage? > > * SATA enclosures uses SGPIO instead of SES. SGPIO is too limited, > IMHO, to be of almost any use at all. I suggest not even trying to > make it work with this scheme. > > > old dreams https://people.freebsd.org/~mav/Enclosure_Management_en.pdf TODO: =E2=80=93 add support for SGPIO/I2C interfaces in more drivers, =E2=80=93 associate devices with enclosure slots for non-SAS enclosures; =E2=80=93 implement in-kernel interface for the =C2=ABenc=C2=BB CAM driver; =E2=80=93 refactor GEOM::setstate API to handle full set of SES Array Device Slot flags; =E2=80=93 explore possibility to make ZFS report disks statuses to GEOM using that API.