locked
how to start up from script RRS feed

  • Question

  • I have the server connected to a very good UPS with a communication port. When the power goes out I have it set up to run the server off the battery for a few minutes, and it will shut down the server if power isn't restored in that time.

    There is also an option in the software to execute a script when the power is restored. Presumably this would be a start up script to turn the server on again. I've done some searching and can't locate anything useful.

    Has anyone done this or know of a script I can use?

    Thanks!

    Wednesday, July 18, 2012 4:24 PM

Answers

  • Typically there is a setting in the BIOS to handle that-it would be set to always turn on the computer when power is re-applied.

    Steve

    • Marked as answer by Ken Warren Wednesday, July 18, 2012 8:15 PM
    Wednesday, July 18, 2012 6:08 PM

All replies

  • Typically there is a setting in the BIOS to handle that-it would be set to always turn on the computer when power is re-applied.

    Steve

    • Marked as answer by Ken Warren Wednesday, July 18, 2012 8:15 PM
    Wednesday, July 18, 2012 6:08 PM
  • The scripting option is to allow re-establishing a connection of some sort, or to sent out alerts about the power being restored, or similar functionality. No script will run when the server is shut down...

    I'm not on the WHS team, I just post a lot. :)

    Wednesday, July 18, 2012 8:16 PM
  • Here is what the manual says about my APC UPS.
     
    Begin quote
     

    What happens during a prolonged power problem?

    We recommend that you have hibernation enabled to ensure protection for your data during an extended power problem (see Using hibernation and sleep).
    1. When your AC utility power source fails (a blackout) or falls outside the normal voltage range, your battery backup immediately begins supplying power to your computer system using its internal battery.
    2. As the problem continues, the battery starts losing its charge.
    3. The power protection solution monitors the situation with reference to the options specified on the Runtime page under Configuration.
    4. After the specified number of minutes have elapsed OR until the runtime drops to the specified time to shutdown, hibernation begins. (If hibernation is disabled, shutdown begins.)
    5. Your computer shuts down.
    6. Note that if hibernation is disabled, your computer will stop at the message �??It is now safe to turn off your computer�?�. At step 6 below, the battery backup withdraws power and the computer shuts down properly then.

    7. Your battery backup goes into battery sleep mode after a delay. The delay is two minutes for those battery backup units that support advanced shutdown options, and one minute for those battery backup units that don�??t support advanced shutdown options. (Don�??t confuse battery sleep mode with Windows sleep mode).
    8. In battery sleep mode, the battery backup is not in operation but it is ready to start operating automatically when AC utility power returns. Going into battery sleep mode conserves battery power for future power problems and also prolongs the working life of the battery.

    Caution: During a shutdown (step 4 above) clicking the Cancel Shutdown button temporarily aborts the shutdown. This gives you extra time for some finishing-up work, but you should manually save all open files if you choose it.
     
    --
    ______________
     
    BullDawg
    In God We Trust
    ______________

    Typically there is a setting in the BIOS to handle that-it would be set to always turn on the computer when power is re-applied.

    Steve


    BullDawg
    Thursday, July 19, 2012 6:54 AM
  • Typically there is a setting in the BIOS to handle that-it would be set to always turn on the computer when power is re-applied.

    Will this always work as expected? I would assume that if power is restored between a server shutdown and a fully drained UPS, the server BIOS would not even know that there was a power outage.

    For example, consider the following scenario, in which the UPS has ability to keep server running for 30 minutes, but is configured to shutdown / hibernate the server after 15 minutes:

    • Time 0:00 - Power goes down, server keeps running
    • Time 0:15 - Server shutdown is initiated.
    • Time 0:16 - Server shutdown complete. UPS continues to provide power to the server for at least 15 minutes (probably a lot more due to limited load).
    • Time 0:20 - Power is restored before battery is full drained.

    Will the server (BIOS) even be aware that there was a power outage?

    Regards,

    Sven


    Thursday, July 19, 2012 10:33 AM
  • Will this always work as expected?

    An interesting question. If the software that comes with the UPS works properly and it's a reasonably functional UPS (i.e. don't go down to Best Buy and purchase the cheapest thing they have), it's likely that the server will wake after power is restored. If you just plug in the data cable and assume there's something in Windows that will magically make everything work right, then probably not.

    An option (IMO a better one) with a cheap UPS is to not use the data cable and supplied software at all. Let the UPS shut itself down when the battery is drained; this will remove power from connected equipment, and that equipment will then behave as it would in any other power failure. As long as the UPS restores power to connected equipment you're still fine. What you sacrifice here is overall UPS battery life; even though a UPS should have deep cycle batteries, they're still not designed to be drained completely on a regular basis. This is how the (cheap) UPS in my basement, that powers my network, works. I think it's only drained the battery once, when we lost power for 5 days.


    I'm not on the WHS team, I just post a lot. :)

    Thursday, July 19, 2012 2:08 PM