ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Automatic shutdown

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automatic shutdown

    We recently install an iSeries 520.

    We also recently experienced a power failure lasting longer than our ups could sustain.

    I've searched the IBM knowledgebase in vain. Does anyone know how and where to set the values to automatically shut down the partitions during a power failure?

  • #2
    Re: Automatic shutdown

    system value QUPSDLYTIM

    Code:
    QUPSDLYTIM                                                               
                                                                             
        Uninterruptible power supply (UPS) delay time.  
        Specifies the amount of time that elapses before 
        the system automatically powers down following 
        a power failure.  When a change in power activates 
        the UPS, messages are sent to the UPS message 
        queue (the system value QUPSMSGQ).  This system 
        value is only meaningful if your system has a battery 
        power unit or has an uninterruptible power supply          
        attached.
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Automatic shutdown

      Thanks for the info. It is connected to a ups. Is there a way to tell or test this without yanking a plug?

      Comment


      • #4
        Re: Automatic shutdown

        Not that I know of.......My guess this would be a weekend project..You and a stop watch.
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Automatic shutdown

          So you actually have to write a program to tell it what to shut down? Nothing that you can just set to say.. if the power is out for 10 minutes Shut 'R Down!!!

          Comment


          • #6
            Re: Automatic shutdown

            You can write your own program. You have to place this program name into a system value...I cant recall which one..then yes you could then in theory unplug the ups and have your home grown shutdown program send messages every 5 minutes or so............

            Code:
            The following is an example of implementing a power-handling 
            program on an iSeries server when a full uninterruptible 
            power supply is attached. This example assumes that QCTL 
            is the controlling subsystem.
            
            For a sample program with a full uninterruptible power supply, 
            go to “Example: Power-handling CL program” on page 11.
            
            1. Because of the critical nature of a power-handling program, 
               you should isolate the objects used by the power-handling 
               program in their own library and secure them from other 
               users, as follows:
             
               CRTLIB LIB(UPSLIB) AUT(*EXCLUDE) CRTAUT(*EXCLUDE)
            
            
            2. A power-handling program requires exclusive use of a message 
               queue. For this reason, you should create a unique message 
               queue and exclude its use from all other users and general 
               system use, as follows:
            
               CRTMSGQ MSGQ(UPSLIB/UPSMSGQ) AUT(*EXCLUDE)
            
            3. Create the CL power-handling program and exclude its use from 
               all other users, as follows:
            
            CRTCLPGM PGM(UPSLIB/UPSPGM) AUT(*EXCLUDE)
            
            4. Create the job description for the power-handling program you 
               want started automatically whenever the controlling subsystem 
               is started.
            
            CRTJOBD JOBD(UPSLIB/UPSJOBD) JOBQ(QSYS/QCTL2)
            JOBPTY(1) RQSDTA(’CALL UPSLIB/UPSPGM’)
            AUT(*EXCLUDE) USER(xxxxx)
            
            Note: You must provide a user profile to use the job description as 
                  an auto-start job.
            
            5. Create an alternative controlling subsystem description by making 
               a copy of the current controlling subsystem description, as 
               follows: 
            
            CRTDUPOBJ OBJ(QCTL) FROMLIB(QSYS)
            OBJTYPE(*SBSD) TOLIB(QSYS) NEWOBJ(QCTL2)
            
            6. Modify your startup program to start all subsystems. You will 
               need to include a check to see if system value QCTLSBSD is 
               equal to QCTL2. See system value QSTRUPPGM for the name and 
               library. If you do not modify the startup program it will 
               not check for QCTL2 in QSYS or QGPL and the startup program 
               will end without starting the rest of your subsystems.
            
            7. Add the autostart job entry to the alternative controlling 
               subsystem description, as follows:
            
            ADDAJE SBSD(QSYS/QCTL2) JOB(QSYS/QCTL2)
            JOBD(UPSLIB/UPSJOBD)
            
            8. Change the controlling subsystem system value to use the alternative 
               controlling subsystem description, as follows:
            
            CHGSYSVAL SYSVAL(QCTLSBSD) VALUE(’QCTL2’)
            
            9. Change the system values to allow the program to handle a power 
               outage, as follows:
            
            CHGSYSVAL SYSVAL(QUPSMSGQ) VALUE(’UPSMSGQ UPSLIB’)
            CHGSYSVAL SYSVAL(QUPSDLYTIM) VALUE(*NOMAX)
            
            10. Perform an IPL of the system to have the new controlling 
                subsystem description take effect, as follows:
            
            PWRDWNSYS OPTION(*IMMED) RESTART(*YES)
            I am not your best resource for detailed information on this subject.
            please take a look @ this .pdf from IBM,

            IBM MANUAL

            This link also has an example CL program and instructions on setting up system further for user controlled system shutdown
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #7
              Re: Automatic shutdown

              No, you don't HAVE to write a pgm, but you could. The system value
              QUPSDLYTIM tells the system to shutdown x minutes after UPS kicks in. For example, if you have 30 minutes of UPS power, you would probably set this at about 20, giving the system 10 minutes to power down before the UPS is exhausted.

              Comment


              • #8
                Re: Automatic shutdown

                If there was a power failure and using your time frames of 30/20/10. If the power comes back on does it reset or does the system proceed with the shutdown no matter what?

                Comment


                • #9
                  Re: Automatic shutdown

                  If I remember correctly, if power is restored before the 20 minute mark, it does not shutdown. If shutdown starts, it needs to complete.

                  I would need to recheck to make sure.

                  Comment


                  • #10
                    Re: Automatic shutdown

                    Please read my last post there is a message queue that is recieving the ups messages and if power is restore a message is sent to this queue to say power restored. If this message is not received before the shut down begans then the shut down will continue.... Thats why I like to write my own program then you can send and recieve from this message queue every couple of seconds and "feel" like you have more control.

                    It has been a bit of time since I "played" with an iseries as far as power down process....I think you may have to experiment a bit or contact a company the specializes in disaster recovery.

                    Something this important should really be researched a bunch.
                    All my answers were extracted from the "Big Dummy's Guide to the As400"
                    and I take no responsibility for any of them.

                    www.code400.com

                    Comment


                    • #11
                      Re: Automatic shutdown

                      I will research it but in the interum I need to be sure that the system is going thru a shutdown process of somekind even if it is the default... which I think it did.

                      The default message queue is set to QSYSOPR with a time interval of 300 seconds.

                      Comment


                      • #12
                        Re: Automatic shutdown

                        Well... here I am revisiting this problem. The second power failure this year. I did see in the log that the system waited the 5 minutes set in the system value but after that there were abnormal end messages and when we ipl'd it said "Unattended IPL in progressafter abnormal system end".

                        Is there anything out there that can explain the process, on where to look for indicators as to how it shutdown. Etc. There was nothing in the message queue.

                        Comment


                        • #13
                          Re: Automatic shutdown

                          See if you can determine if the system shutdown completely or not. It may have waited the 5 minutes, but did the UPS supply power long enough for a complete shutdown ?

                          Comment


                          • #14
                            Re: Automatic shutdown

                            It is better to write a minitoring program. This program receives the ups msgq messages and response appropiately to them.

                            Example: CPF1816 power failue. I wait for x minutes and if I get a CPF1817 power retored then do nothing.

                            If x miniutes has elapsed then I send e-mails to cell phones then end subsystems. then wait again. If still no restore of power I end pwrdwnsys *immed. If power is restored then I bring the subsystems up and continue on our marrry way.

                            The system value QPWRRSTIPL will power the system up when power is restored.

                            The problem with NOT minotoring is that it will power down the system before the UPS empties BUT it will not bring the system down in an orderly fashion. You may have open data paths...etc.

                            This cl program is running in QCTL forever and is part of the startup group.

                            Good Luck
                            Bill
                            Bill
                            "A good friend will bail you out of jail,
                            A true friend would be sitting beside you saying,
                            'Wow, that was fun.'"

                            Comment


                            • #15
                              Re: Automatic shutdown

                              Bill - I agree I wrote one some time back... do you have an example you can post to help out?


                              thanks
                              jamie
                              All my answers were extracted from the "Big Dummy's Guide to the As400"
                              and I take no responsibility for any of them.

                              www.code400.com

                              Comment

                              Working...
                              X