9 Replies Latest reply on Feb 23, 2010 3:03 PM by Drew Gainor

    Run package in server sequence

      I have a particular BLPackage that I need to execute against multiple servers, but only one at a time with a delay in between the executions. I have tried to use a batch job set in sequential mode, but the packages still seem to run all at the same time. Anyone have any other thoughts on how to do this?

        • 1. Re: Run package in true sequence
          Bill Robinson

          When you setup the batch job, are you using the targets from the deploy job or targets specified in the batch job?

           

          Which specific option in the batch job did you select?

           

          • Execute jobs sequentially—Each individual job in the Batch Job runs against all

            specified targets before moving on to the next individual job listed in the jobs list.

          • Execute jobs in parallel—All the individual jobs in the Batch Job run against all

            targets simultaneously.

          • Execute by server—All the individual jobs in the Batch Job run against each target

            sequentially but the Batch Job processes all targets in parallel. This option is

            identical to running multiple Batch Jobs simultaneously, with each Batch Job

            configured to have only one target and to execute individual jobs seq

          • 2. Re: Run package in true sequence

            I have used the targets in the batch job. There is only one job within the batch job. I have tried all three options and the start and finish times are always the same on each job.

            • 3. Re: Run package in true sequence
              Bill Robinson

              Based on the description of the options, I think you will need to create 1 job for each server.

              • 4. Re: Run package in true sequence

                I was trying to avoid creating 60 jobs.

                 

                I had thought of creating an NSH script that would loop through the servers with a sleep inbetween each one, but that is limited to the server running the script.

                 

                I thought about having an NSH script fire off a scheduled task on each of the servers, but BL runs on Windows 2003 and my servers are 2008 and the you can not do that.

                 

                I could write an external script that loops through the servers and fires off a BL job, but I have not done that before and I am not sure if I can pass a server variable to the job that way or not.

                • 5. Re: Run package in true sequence
                  Bill Robinson

                  When you say " I thought about having an NSH script fire off a scheduled task on each of the servers, but BL runs on Windows 2003 and my servers are 2008 and the you can not do that."  what do you mean?  Why can't nsh fire off a scheduled task?  It shouldn't matter what OS your servers are...

                   

                   

                  I'd look at creating an nsh script that loops though the list of target servers, sets the current server as the job target, runs the job, waits for it to finish successfully, then sets the target to the next server, executes, etc... - #3 of your options.

                   

                  You can do this w/ the blcli inside an nsh script.  It should be pretty easy.  There might be some examples of something like that on here or we can walk you through it..

                  • 6. Re: Run package in true sequence
                    Wenchi Liao

                    How much of a delay does it need? How about the blpackage with it's content, then an external command to sleep X seconds for the delay, and a regular deploy job with parallel target set to 1?

                    • 7. Re: Run package in true sequence

                      Scheduled tasks in Windows 2003 are not compatible with Scheduled tasks on a 2008 server.

                       

                      I wrote a DOS batch file and placed it on each of the servers(windows 2008). I then created a scheduled task on the servers(windows 2008). I then tried to use an NSH script on the App server(windows 2003) to run the scheduled task on the servers(windows 2008) and perform a sleep command between them. Unfortunatly, it fails because the App server is 2003. It is not possible to run a scheduled task remotely from a 2003 server. It works fine when run remotely from a 2008 or Windows 7 computer.

                       

                      cmd /c schtasks /run /tn <task_name> /s <remote_server>

                       

                      ERROR: The network path was not found.

                       

                       

                      schtasks /query /s <remote_server>

                       

                      ERROR: The network path was not found

                       

                       

                      I am not that familiar with BLCLI commands and I am unable to find much documentation as to the command reference or how to use it so if anyone thinks they have a solution and can give me a hand trying it out I would appreciate it.

                      1 of 1 people found this helpful
                      • 8. Re: Run package in server sequence

                        A bit late to the thread, but if you're still having a problem I figured I'd toss out a guess at how I would solve.

                         

                        Instead of a Batch Job, just set up a normal Deploy Job for your package and set "Number of Targets to Process in Parallel" equal to 1:

                         

                        targets_1.JPG

                         

                        This will execute the deploy on the servers one at a time in turn. For the delay in between, you could simply add one final item to your BLpackage with the delay. (On XP / 2003 server, "sleep 30" would give a 30-second delay, for example.)

                        • 9. Re: Run package in server sequence

                          You would think that would work, wouldn't you? But no it does not. I tried this on two servers and they both started and ended within seconds of each other.

                           

                          Job Name,"AppPool Reset one at a time test Run at Feb 23, 2010 11:27:37 AM"
                          Start Time,Feb 23, 2010 11:27:37 AM
                          End Time,Feb 23, 2010 11:34:05 AM
                          Status,Completed Successfully

                          Participant,Step,Attempt,Date,Type,Message

                          run level log,,,Feb 23, 2010 11:27:37 AM,Info,Started running the job 'AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2)

                          run level log,,,Feb 23, 2010 11:34:05 AM,Info,The job 'AppPool Reset one at a time test' has succeeded

                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:27:44 AM,Info,Started running the deploy step job 'AppPool Reset one at a time test->AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2) against target server 'irv-gdc-bl1'

                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:27:50 AM,Info,Package APPPool-Reset-1686.1-3742.2 started
                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:27:59 AM,Info,"Package APPPool-Reset-1686.1-3742.2 initialized, entering wait queue for processing"
                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:27:59 AM,Info,Package APPPool-Reset-1686.1-3742.2 processing instructions
                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:27:59 AM,Info,Package APPPool-Reset-1686.1-3742.2 completed. exitCode = 0 (DryRun successful)
                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:28:00 AM,Info,The job 'AppPool Reset one at a time test->AppPool Reset one at a time test' has succeeded on server irv-gdc-bl1
                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:29:28 AM,Info,Deployment job not in single-job mode. Reboot is not allowed. Any reboot requests by certain file operations will be ignored.

                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:29:36 AM,Info,Metabase initialization failed: 0x80040154

                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:29:36 AM,Info,Bldeploy APPPool-Reset-1686.1-3742.2 started using file C:\tmp\stage\APPPool-Reset-1686.1-3742.2\bldeploy.xml with rollback directory C:\Program Files\BMC BladeLogic\RSC\Transactions\APPPool-Reset-1686.1-3742.2

                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:29:36 AM,Info,Starting dryRun

                          irv-gdc-bl1,Simulate,1,Feb 23, 2010 11:29:36 AM,Info,Dryrun succeeded

                          irv-gdc-bl1,Stage,1,Feb 23, 2010 11:28:03 AM,Info,Started running the deploy step job 'AppPool Reset one at a time test->AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2) against target server 'irv-gdc-bl1'
                          irv-gdc-bl1,Stage,1,Feb 23, 2010 11:28:03 AM,Info,Checking size of '//irv-gdc-ms22/e/bladelogic/storage/blpackages/APPPool-Reset-1686.1'
                          irv-gdc-bl1,Stage,1,Feb 23, 2010 11:28:03 AM,Info,Package on server irv-gdc-ms22 is 5120 bytes in size.
                          irv-gdc-bl1,Stage,1,Feb 23, 2010 11:28:03 AM,Info,Invoking: "C:/Program Files/BMC BladeLogic/OM/bin/ndf" -H -c -h irv-gdc-bl1
                          irv-gdc-bl1,Stage,1,Feb 23, 2010 11:28:05 AM,Info,Staging directory on server irv-gdc-bl1 has 8939696128 bytes available.
                          irv-gdc-bl1,Stage,1,Feb 23, 2010 11:28:05 AM,Info,The job 'AppPool Reset one at a time test->AppPool Reset one at a time test' has succeeded on server irv-gdc-bl1
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:28:10 AM,Info,Started running the deploy step job 'AppPool Reset one at a time test->AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2) against target server 'irv-gdc-bl1'
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:28:15 AM,Info,Package APPPool-Reset-1686.1-3742.2 started
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:28:23 AM,Info,"Package APPPool-Reset-1686.1-3742.2 initialized, entering wait queue for processing"
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:28:23 AM,Info,Package APPPool-Reset-1686.1-3742.2 processing instructions
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:47 AM,Info,Deployment job not in single-job mode. Reboot is not allowed. Any reboot requests by certain file operations will be ignored.

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info,Metabase initialization failed: 0x80040154

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info,Bldeploy APPPool-Reset-1686.1-3742.2 started using file C:\tmp\stage\APPPool-Reset-1686.1-3742.2\bldeploy.xml with rollback directory C:\Program Files\BMC BladeLogic\RSC\Transactions\APPPool-Reset-1686.1-3742.2

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info,Starting apply

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info, Processing asset BLPACKAGE

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info, Processing asset EXTERNALCMD

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info, Executing command: "@echo off echo "---------------------------------------------------------------------" echo "Reset Pool on server irv-gdc-bl1" rem iisapp /a kbb.com /r c:\windows\system32\inetsrv\appcmd recycle apppool "kbb.com" echo "Reset Done" ping 1.1.1.1 -n 1 -w 1500 echo "Open IE" @start "" /b "C:\Program Files\Internet Explorer\iexplore.exe" http://irv-gdc-bl1/ echo "IE Opened" ping 1.1.1.1 -n 1 -w 250000 taskkill /F /t /IM iexplore.exe ping 1.1.1.1 -n 1 -w 30000 echo "End Batch" echo "---------------------------------------------------------------------""

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:55 AM,Info, [stdout: 2]    C:\tmp\stage\APPPool-Reset-1686.1-3742.2>chcp 1252  1>NUL   "---------------------------------------------------------------------"  "Reset Pool on server irv-gdc-bl1"

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:56 AM,Info, [stdout: 2]  ERROR ( message:The WAS service is not available - try starting the service first. )

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:56 AM,Info, [stdout: 2]  "Reset Done"    Pinging 1.1.1.1 with 32 bytes of data:

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:29:58 AM,Info," [stdout: 2]  Request timed out.    Ping statistics for 1.1.1.1:      Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),  "Open IE"  "IE Opened"    Pinging 1.1.1.1 with 32 bytes of data: 
                          "
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:04 AM,Info,Package APPPool-Reset-1686.1-3742.2 completed. exitCode = 0 (Apply successful)
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:05 AM,Info,The job 'AppPool Reset one at a time test->AppPool Reset one at a time test' has succeeded on server irv-gdc-bl1
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:07 AM,Info," [stdout: 2]  Request timed out.    Ping statistics for 1.1.1.1:      Packets: Sent = 1, Received = 0, Lost = 1 (100% loss), 
                          "
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:08 AM,Info, [stdout: 2]  SUCCESS: The process with PID 704 (child process of PID 2940) has been terminated.  SUCCESS: The process with PID 2940 (child process of PID 588) has been terminated.

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:08 AM,Info, [stdout: 2]    Pinging 1.1.1.1 with 32 bytes of data:

                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:37 AM,Info," [stdout: 2]  Request timed out.    Ping statistics for 1.1.1.1:      Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),  "End Batch"  "---------------------------------------------------------------------" 
                          "
                          irv-gdc-bl1,Commit,1,Feb 23, 2010 11:34:37 AM,Info,Apply Succeeded

                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:27:42 AM,Info,Started running the deploy step job 'AppPool Reset one at a time test->AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2) against target server 'irv-gdc-bl2'
                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:27:48 AM,Info,Package APPPool-Reset-1686.1-3742.2 started
                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:27:55 AM,Info,"Package APPPool-Reset-1686.1-3742.2 initialized, entering wait queue for processing"
                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:27:55 AM,Info,Package APPPool-Reset-1686.1-3742.2 processing instructions
                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:27:55 AM,Info,Package APPPool-Reset-1686.1-3742.2 completed. exitCode = 0 (DryRun successful)
                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:27:56 AM,Info,The job 'AppPool Reset one at a time test->AppPool Reset one at a time test' has succeeded on server irv-gdc-bl2
                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:29:26 AM,Info,Deployment job not in single-job mode. Reboot is not allowed. Any reboot requests by certain file operations will be ignored.

                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:29:33 AM,Info,Metabase initialization failed: 0x80040154

                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:29:33 AM,Info,Bldeploy APPPool-Reset-1686.1-3742.2 started using file C:\tmp\stage\APPPool-Reset-1686.1-3742.2\bldeploy.xml with rollback directory C:\Program Files\BMC BladeLogic\RSC\Transactions\APPPool-Reset-1686.1-3742.2

                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:29:33 AM,Info,Starting dryRun

                          irv-gdc-bl2,Simulate,1,Feb 23, 2010 11:29:33 AM,Info,Dryrun succeeded

                          irv-gdc-bl2,Stage,1,Feb 23, 2010 11:27:59 AM,Info,Started running the deploy step job 'AppPool Reset one at a time test->AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2) against target server 'irv-gdc-bl2'
                          irv-gdc-bl2,Stage,1,Feb 23, 2010 11:27:59 AM,Info,Checking size of '//irv-gdc-ms22/e/bladelogic/storage/blpackages/APPPool-Reset-1686.1'
                          irv-gdc-bl2,Stage,1,Feb 23, 2010 11:27:59 AM,Info,Package on server irv-gdc-ms22 is 5120 bytes in size.
                          irv-gdc-bl2,Stage,1,Feb 23, 2010 11:27:59 AM,Info,Invoking: "C:/Program Files/BMC BladeLogic/OM/bin/ndf" -H -c -h irv-gdc-bl2
                          irv-gdc-bl2,Stage,1,Feb 23, 2010 11:28:01 AM,Info,Staging directory on server irv-gdc-bl2 has 3245338624 bytes available.
                          irv-gdc-bl2,Stage,1,Feb 23, 2010 11:28:01 AM,Info,The job 'AppPool Reset one at a time test->AppPool Reset one at a time test' has succeeded on server irv-gdc-bl2
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:28:03 AM,Info,Started running the deploy step job 'AppPool Reset one at a time test->AppPool Reset one at a time test' on application server 'irv-gdc-ms22'(2) against target server 'irv-gdc-bl2'
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:28:09 AM,Info,Package APPPool-Reset-1686.1-3742.2 started
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:28:17 AM,Info,"Package APPPool-Reset-1686.1-3742.2 initialized, entering wait queue for processing"
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:28:17 AM,Info,Package APPPool-Reset-1686.1-3742.2 processing instructions
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:42 AM,Info,Deployment job not in single-job mode. Reboot is not allowed. Any reboot requests by certain file operations will be ignored.

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:50 AM,Info,Metabase initialization failed: 0x80040154

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:50 AM,Info,Bldeploy APPPool-Reset-1686.1-3742.2 started using file C:\tmp\stage\APPPool-Reset-1686.1-3742.2\bldeploy.xml with rollback directory C:\Program Files\BMC BladeLogic\RSC\Transactions\APPPool-Reset-1686.1-3742.2

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:50 AM,Info,Starting apply

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:50 AM,Info, Processing asset BLPACKAGE

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:50 AM,Info, Processing asset EXTERNALCMD

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:50 AM,Info, Executing command: "@echo off echo "---------------------------------------------------------------------" echo "Reset Pool on server irv-gdc-bl2" rem iisapp /a kbb.com /r c:\windows\system32\inetsrv\appcmd recycle apppool "kbb.com" echo "Reset Done" ping 1.1.1.1 -n 1 -w 1500 echo "Open IE" @start "" /b "C:\Program Files\Internet Explorer\iexplore.exe" http://irv-gdc-bl2/ echo "IE Opened" ping 1.1.1.1 -n 1 -w 250000 taskkill /F /t /IM iexplore.exe ping 1.1.1.1 -n 1 -w 30000 echo "End Batch" echo "---------------------------------------------------------------------""

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:51 AM,Info, [stdout: 2]    C:\tmp\stage\APPPool-Reset-1686.1-3742.2>chcp 1252  1>NUL 

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:51 AM,Info, [stdout: 2]  "---------------------------------------------------------------------"  "Reset Pool on server irv-gdc-bl2"

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:51 AM,Info, [stdout: 2]  ERROR ( message:Cannot find APPPOOL object with identifier "kbb.com". )

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:51 AM,Info, [stdout: 2]  "Reset Done"    Pinging 1.1.1.1 with 32 bytes of data:

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:53 AM,Info," [stdout: 2]  Request timed out.    Ping statistics for 1.1.1.1:      Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),  "Open IE"  "IE Opened" 
                          "
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:29:53 AM,Info, [stdout: 2]    Pinging 1.1.1.1 with 32 bytes of data:

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:33:59 AM,Info,Package APPPool-Reset-1686.1-3742.2 completed. exitCode = 0 (Apply successful)
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:34:01 AM,Info,The job 'AppPool Reset one at a time test->AppPool Reset one at a time test' has succeeded on server irv-gdc-bl2
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:34:03 AM,Info," [stdout: 2]  Request timed out.    Ping statistics for 1.1.1.1:      Packets: Sent = 1, Received = 0, Lost = 1 (100% loss), 
                          "
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:34:03 AM,Info, [stdout: 2]  SUCCESS: The process with PID 2992 (child process of PID 1304) has been terminated.  SUCCESS: The process with PID 1304 (child process of PID 2664) has been terminated.

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:34:03 AM,Info, [stdout: 2]    Pinging 1.1.1.1 with 32 bytes of data:

                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:34:33 AM,Info," [stdout: 2]  Request timed out.    Ping statistics for 1.1.1.1:      Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),  "End Batch"  "---------------------------------------------------------------------" 
                          "
                          irv-gdc-bl2,Commit,1,Feb 23, 2010 11:34:33 AM,Info,Apply Succeeded