1. 概要
UPS を導入したので Proxmox VE のホストを UPS に連動させてシャットダウンしたい。
2. 機材
- OMRON UPS BW55T
APC の BR550S-JP と最後まで悩んだが、APC のほうは6ポートではあるが内3ポートはサージ対策のみで UPS 機能なしであったため、4ポートの OMRON のものを選んだ。
3. ソフトウェアについて
OMRON からは Linux 向けの UPS ソフトウェアは提供されていないが、NUT には対応している。
ベンダー提供のよくわからないソフトウェアを使うよりは NUT 使ったほうが安心感もある。
4. 導入
4.1 upsd install
# apt install nut
4.2 nut configuration
/etc/udev/rules.d/50-nut-ups.rules
※ nut group のユーザから ups の device が見える必要がある
ATTR{idVendor}=="0590", ATTR{idProduct}=="00d0", MODE="664", GROUP="nut", SYMLINK+="ups", TAG+="systemd", ENV{SYSTEMD_ALIAS}+="/sys/subsystem/ups/devices/ups"
/etc/nut/nut.conf
MODE=netserver
/etc/nut/ups.conf
[omron_bw55t] driver = blazer_usb port = /dev/ups vendorid = 0590 productid = 00d0 subdriver = ippon default.battery.voltage.high = 13.6 default.battery.voltage.low = 11.6
/etc/nut/upsd.users
[upsmon] password = upspass upsmon master
4.3 nut-server start
# systemctl start nut-server.service
upsc コマンドで ups の情報が見えるようになる
# upsc omron_bw55t@localhost Init SSL without certificate database battery.charge: 90 battery.voltage: 13.40 battery.voltage.high: 13.6 battery.voltage.low: 11.6 device.type: ups driver.name: blazer_usb driver.parameter.pollinterval: 2 driver.parameter.port: /dev/ups driver.parameter.productid: 00d0 driver.parameter.subdriver: ippon driver.parameter.synchronous: auto driver.parameter.vendorid: 0590 driver.version: 2.8.0 driver.version.internal: 0.14 driver.version.usb: libusb-1.0.26 (API: 0x1000109) input.frequency: 50.0 input.voltage: 102.8 input.voltage.fault: 0.0 output.voltage: 103.2 ups.beeper.status: disabled ups.delay.shutdown: 30 ups.delay.start: 180 ups.load: 10 ups.productid: 00d0 ups.status: OL BYPASS ups.temperature: 41.5 ups.type: offline / line interactive ups.vendorid: 0590
5. 自動シャットダウン設定
下記の conf に shutdown コマンドの記載があれば OK
/etc/nut/upsmon.conf
SHUTDOWNCMD "/sbin/shutdown -h +0"