Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    pfsense + UPS + Synology NAS

    Scheduled Pinned Locked Moved General pfSense Questions
    11 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fjmp24
      last edited by

      Hi,

      I have a pfsense plus 23.05.1-RELEASE, an EATON Ellipse PRO 650 (UPS) and a Synology DS423+.
      My UPS is connected to my pfsense and I can see its status.
      My synology is connected to my pfsense by using a Synology NUT serveur and I can see the status of my UPS.

      All configuration seem ok but not.
      When I turn off the power the nas does not shut down properly and I don't know why. Any idea?

      M dennypageD 2 Replies Last reply Reply Quote 0
      • M
        mcury @fjmp24
        last edited by mcury

        @fjmp24 Synology changed the original behavior of NUT package.
        They are using synoups online, synoups onbatt and synoups waittimeup services, you can check the logs at /var/log/ups.log

        You will see something like this :

        Before test starts:
        
        2023-04-25T14:25:54-03:00 mynas synoups[20016]: synoups online
        2023-04-25T14:25:54-03:00 mynas synoups[20017]: =====log UPS status start=====
        2023-04-25T14:25:54-03:00 mynas synoups[20019]: device.mfr=
        2023-04-25T14:25:54-03:00 mynas synoups[20021]: device.model=
        2023-04-25T14:25:54-03:00 mynas synoups[20023]: battery.charge=100
        2023-04-25T14:25:54-03:00 mynas synoups[20025]: battery.runtime=
        2023-04-25T14:25:54-03:00 mynas synoups[20027]: battery.voltage=13.60
        2023-04-25T14:25:54-03:00 mynas synoups[20029]: input.voltage=123.0
        2023-04-25T14:25:54-03:00 mynas synoups[20031]: output.voltage=123.0
        2023-04-25T14:25:54-03:00 mynas synoups[20033]: ups.load=14
        2023-04-25T14:25:54-03:00 mynas synoups[20035]: ups.status=OL
        2023-04-25T14:25:54-03:00 mynas synoups[20036]: =====log UPS status end=====
        
        Removed the power cable:
        
        2023-04-25T14:29:10-03:00 mynas synoups[20665]: synoups onbatt
        2023-04-25T14:29:10-03:00 mynas synoups[20666]: =====log UPS status start=====
        2023-04-25T14:29:10-03:00 mynas synoups[20668]: device.mfr=
        2023-04-25T14:29:10-03:00 mynas synoups[20670]: device.model=
        2023-04-25T14:29:10-03:00 mynas synoups[20672]: battery.charge=100
        2023-04-25T14:29:10-03:00 mynas synoups[20675]: battery.runtime=
        2023-04-25T14:29:10-03:00 mynas synoups[20678]: battery.voltage=12.80
        2023-04-25T14:29:10-03:00 mynas synoups[20680]: input.voltage=0.0
        2023-04-25T14:29:10-03:00 mynas synoups[20682]: output.voltage=122.9
        2023-04-25T14:29:10-03:00 mynas synoups[20685]: ups.load=11
        2023-04-25T14:29:10-03:00 mynas synoups[20688]: ups.status=OB
        2023-04-25T14:29:10-03:00 mynas synoups[20689]: =====log UPS status end=====
         
        Plugged the power cable back to the UPS:
        
        2023-04-25T14:29:41-03:00 mynas synoups[20839]: synoups waittimeup
        2023-04-25T14:29:41-03:00 mynas synoups[20840]: =====log UPS status start=====
        2023-04-25T14:29:41-03:00 mynas synoups[20842]: device.mfr=
        2023-04-25T14:29:41-03:00 mynas synoups[20844]: device.model=
        2023-04-25T14:29:41-03:00 mynas synoups[20846]: battery.charge=62
        2023-04-25T14:29:41-03:00 mynas synoups[20848]: battery.runtime=
        2023-04-25T14:29:41-03:00 mynas synoups[20850]: battery.voltage=12.00
        2023-04-25T14:29:41-03:00 mynas synoups[20852]: input.voltage=0.0
        2023-04-25T14:29:41-03:00 mynas synoups[20854]: output.voltage=122.9
        2023-04-25T14:29:41-03:00 mynas synoups[20856]: ups.load=15
        2023-04-25T14:29:41-03:00 mynas synoups[20858]: ups.status=OB
        2023-04-25T14:29:41-03:00 mynas synoups[20859]: =====log UPS status end=====
        

        They changed the NUT package in way that a new mode, standby, unmounts the disks to avoid corruptions during disk writes.
        Your NAS will get into this mode before it completes shutdown.

        Note that you won't be able to simulate a power outage by issuing the command upsmon -c fsd.
        It won't work because it doesn't use upsmon to do it (that is why the SHUTDOWN command is empty in upsmon.conf).

        I'm using a EATON UPS here, but it is a old model in which the best driver for it is Blazer USB.

        Extra arguments to the driver:

        offdelay = 60
        default.battery.voltage.nominal = 12.00
        default.battery.voltage.high = 12.00
        default.battery.voltage.low = 10.40
        idleload = 14
        chargetime = 21600
        runtimecal = 120,100,180,50
        

        To test if a shutdown would work for all devices connected to the NUT server in pfsense, I tuned the values above in a way that the shutdown happens after 5 minutes of power outage based on the load.

        Conclusion: Based on my testing and experience, which by the way I could be wrong, is:
        The only way to test is to really plug the cable and watch to see if everything will work as planned.

        dead on arrival, nowhere to be found.

        F 1 Reply Last reply Reply Quote 0
        • F
          fjmp24 @mcury
          last edited by

          @mcury Thanks you for this informations.

          But how i tell my synology to stop before my ups stops. Sorry but i'm a newbee

          M 1 Reply Last reply Reply Quote 0
          • M
            mcury @fjmp24
            last edited by mcury

            @fjmp24 said in pfsense + UPS + Synology NAS:

            But how i tell my synology to stop before my ups stops. Sorry but i'm a newbee

            Through the GUI in the NAS, you will find these options:

            e46e5f75-4e19-4451-9226-90480fd21b7d-image.png

            So, you can tune how long the NAS will wait to get into this "standby" mode, but not when it will shutdown.
            It will shutdown when the battery is low.
            I tuned my UPS server in pfsense, to send the battery low signal when it reaches 10.40
            fb31d9d0-9596-458a-b615-ff0de009f92f-image.png

            I also tuned the runtime and the idleload to get better metrics specific to my Eaton UPS.

            3a810cd2-1b1e-4adb-a6a9-6999a5a5e5cd-image.png

            So, based on what my Pfsense sees, it will send the battery.low signal to my NAS, wait 60s for everything to do a proper shutdown, then shutdown itself.
            Then, once power is back, wait 180s and turn everything ON again.

            aaf914f6-8c55-49d4-9443-664f0be5a14b-image.png

            Edit: One thing that worth pointing out is that you shouldn't tune the standby timer in the NAS.
            Happened once with me that the NAS entered in this standby mode and never came back because my UPS server in pfsense didn't send the battery.low signal.

            This happened because the power came back before it reached the configured threshold for the battery.low signal to happen, but NAS was already in this standby mode.
            So, I strongly suggest you to no set the standby value, leave that setting to Same as server.

            dead on arrival, nowhere to be found.

            1 Reply Last reply Reply Quote 1
            • dennypageD
              dennypage @fjmp24
              last edited by

              @fjmp24 said in pfsense + UPS + Synology NAS:

              When I turn off the power the nas does not shut down properly and I don't know why. Any idea?

              More information is needed to answer your question. You said "does not shut down properly", but you didn't define what you mean by that. Did all the other devices shut down, but the Synology did not?
              Did the Synology not attempt a shutdown at all? Or did it not complete its shutdown before the UPS cut power?

              Also, was this the result of a test or a real-world failure?

              What, if anything, do you have in the Advanced settings section for Services -> UPS -> Settings?

              F 1 Reply Last reply Reply Quote 0
              • F
                fjmp24 @dennypage
                last edited by fjmp24

                @dennypage The Synology attempts a shutdown but it does not shut down before UPS cuts power. This is the result of a real-world failure.

                dennypageD 1 Reply Last reply Reply Quote 0
                • dennypageD
                  dennypage @fjmp24
                  last edited by

                  @fjmp24 said in pfsense + UPS + Synology NAS:

                  The Synology attempts a shutdown but it does not shut down before UPS cuts power. This is the result of a real-world failure.

                  Okay. Have a look at the "ups.delay.shutdown" delay parameter. 20 seconds (the default) is often not enough for a Synology shutdown.

                  F 1 Reply Last reply Reply Quote 0
                  • F
                    fjmp24 @dennypage
                    last edited by

                    @dennypage Okay

                    I uses this driver settings:

                    ignorelb
                    override.battery.runtime.warn = 1800
                    override.battery.runtime.low = 1200
                    override.ups.delay.shutdown = 600

                    The synology stops the services (VM, docker, samba...) but it does not turn off. It stays on standby. It's normal ?
                    When I read Synology logs I don't find error so I would say yes.

                    dennypageD 1 Reply Last reply Reply Quote 0
                    • dennypageD
                      dennypage @fjmp24
                      last edited by

                      @fjmp24 said in pfsense + UPS + Synology NAS:

                      The synology stops the services (VM, docker, samba...) but it does not turn off. It stays on standby. It's normal ?

                      Yes, this is now normal for Synology. In DSM 7, they go into a quiescent mode but do not actually power off. IMHO, this is a bad idea with NUT, but it's what they've chosen to move to.

                      FWIW, unless you have a very good understanding of how NUT and your UPS interact, and are trying to address a very specific issue, I would recommend removing these lines from your configuration:

                      ignorelb
                      override.battery.runtime.warn = 1800
                      override.battery.runtime.low = 1200
                      

                      Most especially, regardless of what you see in various guides, you probably do not want to use ignorelb unless you have a poorly designed UPS (generally old) that declares low battery as soon as mains fail.

                      F 1 Reply Last reply Reply Quote 0
                      • F
                        fjmp24 @dennypage
                        last edited by

                        Thank you all for your help

                        dennypageD 1 Reply Last reply Reply Quote 0
                        • dennypageD
                          dennypage @fjmp24
                          last edited by

                          @fjmp24 Most welcome

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.