1 2 Previous Next 17 Replies Latest reply on Feb 15, 2013 6:40 PM by Bill Robinson

    Help with snapshot and Audit BLCLI

    Santosh Pande



      I need some help with blcli for Snapshot and Audit.


      Use Case

      I am automating deployment of packages and have nsh script for the same.


      But before I deploy the packages I want to check the configuration i.e. what services are running, take a snapshot of the services on the target, deploy the package.. restart the target.


      When the target is restarted I want to run an audit between the snapshot taken before deploy and live target after restart.


      I have quite a few servers with different applications running.


      Please can some one help here and guide what will be the best approach to do this ?


      And as I mentioned earlier i.e "take a snapshot of services before package deploy, deploy the package and restart, and then audit the snapshot with live server after restart" is the correct approach, then how to get this working with blcli..


      Help will be most appreciated.





        • 1. Re: Help with snapshot and Audit BLCLI

          Hi Santosh,


          There are number of BLCLI availale for Snapshot and audit job.


          e.g. Use case Windows service snapshot use case


          Create Template :




          Add Service Part in template :



          Add Hardwareinfo Part in Template:




          Create Snapshot JoB :





          Like above you can use different BLCLI's and complete Audit and Snapshot Use cases.


          More BLCLI you can find at e.g  RCP Installed Location:(C:\RCP_Loc) -- C:\RCP_LOC\OM\NSH\br\xml\cli




          • 2. Re: Help with snapshot and Audit BLCLI
            Santosh Pande

            Hi Ashitosh,


            Thank you for the reply.


            I will be creating these Snapshot jobs on the fly i.e. every time I am deploying\Patching I will need to create a snapshot job automatically for each target and after deploying\Patching a audit job for that target.


            So if I have 1000 servers with various application, then I will need a snapshot job for each server and then a audit job.


            What I am bit confused and not getting is, whether I have to create a component template for each server every time for a snapshot job ? If this is the case then I will be creating large number of templates.


            Sorry not used much of blcli for snapshot or Audit namespace.. needed some help with this.





            • 3. Re: Help with snapshot and Audit BLCLI

              Hi Santosh,


              you don't need to create 1000 templates for each server.

              If you are comparing same service for all servers, single template with the required service added in template

              will work.(just you need to select template in audit and snapshot job).


              I want to know more about your use case is :  Because what I understand from use case is you need to compare

              only between snapshots for that you don't require audit job. Just execute same snapshot job again after change

              and get change tracking information which will give you difference.




              • 4. Re: Help with snapshot and Audit BLCLI
                Santosh Pande

                Hi Ashutosh,


                Thank you for the reply


                Yes I understand that 1000 templates are not needed for one server.


                But if I have 1000 servers with  various applications installed on them (different services) then as per my understanding I will require one component template for each server (Because services are different) to create a snapshot job, in the template I will be adding the services that I have to snapshot (Correct me if I am wrong)


                My Use case is


                1. I have 1000 servers and say I want to patch them
                2. I have automated this patching process i.e I will run patch analysis, if patches are missing I wiull schedule a remediation job.
                3. but before the remediation happens I want to take snapshot of the server for services
                4. Once patch remediation is completed and server rebooted I want to check wether all services have started. For this I have to run again the snapshot job\Audit the snapshot result with the live server.
                5. So I have to do this for 1000 servers.
                6. Again during next patch cycle I will delete the snapshot job for this server, create new one and follow step 3 - 4


                So now my question is to create a snapshot job for each server, do I need a component template for each server (As services may vary on each server)?


                Can I create a snapshot job without component template ?


                What is the best method to do this ?


                Appreciate if you or someone in this forum who has implemented something like this guides\directs me, this will be most appreciated.






                • 5. Re: Help with snapshot and Audit BLCLI

                  Hi Santosh,


                  you need separate template if you are having different services.




                  • 6. Re: Help with snapshot and Audit BLCLI

                    Hi Santosh,


                    you can create snapshot job without template, right click on server and select snapshot Job.


                    In Server object select services by narrow down server tree from servers section to services. (Here you can

                    select different services depending on server).





                    • 7. Re: Help with snapshot and Audit BLCLI
                      Santosh Pande

                      Hi Ashitosh,


                      Thankyou for the reply.


                      I was looking for some blcli (Not GUI) to create snapshot without template.


                      I think I have to think of some other way to get this working.





                      • 8. Re: Help with snapshot and Audit BLCLI

                        Hi Santosh,


                        There is one no released BLCLI createAssetBasedSnapshotJob you can find more about it in xml


                        If your RCP installed in C:\nsh\OM then



                        I am not sure it will work or not.




                        1 of 1 people found this helpful
                        • 9. Re: Help with snapshot and Audit BLCLI
                          NU Mohammed

                          Hi Santosh,


                          If the master server is keep changing snapshot wouldn't be helpful. However,  Have you thought of doing live audit for each server?




                          • 10. Re: Help with snapshot and Audit BLCLI
                            Bill Robinson

                            what's the real purpose here ?  this sounds like you are trying to make up for lack of testing your applications.  you should know what your installs are going to do to your systems before you go pushing them out, so there should not be a need to do this kind of shotgun approach of a snapshot. 


                            if you are really trying to prevent an application install from breaking your systems then you should:

                            - test the install to make sure it won't break your existing applications

                            - if the target is a VM, take a VM snapshot in vcenter of the system before you run the install

                            - have a full backup of the system that you can restore if there is a problem.


                            if the install really breaks your target i don't see how having snapshots of service states and other random stuff is going to do you any good.

                            • 11. Re: Help with snapshot and Audit BLCLI
                              Santosh Pande

                              Hi Bill,


                              I am not mentioning that Bladelogic snapshots will fix anything if application install breaks the target.


                              Yes i should know what my install will do to my server, but during patching one bad patch can cause a lot of damage in DC


                              I am looking from end to end automation point of view.. i.e want to do some post check automatically


                              • before Patching I want to know what are the services running ? For this I was planning to take snapshot of the services on the server


                              • Install the patches


                              • reboot the server


                              • then again compare the services after reboot only to check if something has gone wrong after the patching is completed.
                              • If there is no change shoot a mail notification that server with all services after Patching


                              I never mentioned that I will use bladelogic snapshot to fix the server if it is broken after Patching. I can only fix it with the backup taken for that server or via Vm snapshots


                              All I was looking for was is a way to get a snapshot of the services of a server through blcli and then run that snapshot again after Patching is done for the server.


                              But If I have large number of servers with multiple different services then it will be difficult to take bladelogic snapshot on the fly with blcli as I will need a Component template for each type of server.


                              I hope this clarifies what I am trying to achieve.





                              • 12. Re: Help with snapshot and Audit BLCLI
                                Bill Robinson

                                why do you think that installing a patch is going to prevent a service from running - that again goes to proper testing - by the time something goes into production there should be no worry that a patch would cause a problem..  is that the only possible thing that installing a patching might break?  it sounds like you are trying to use a service not starting as indication that a patch install broke something - that's maybe a good start but it's not a substitute for performing actual application tests to ensure your app is functioning after a change was made on the server.


                                what you want to do is certainly possible - create a snapshot job that snaps the 'services' object.  create a patching job that analyzes for the patches you want and setup auto-remediation.


                                create a batch job and have it run the following:

                                nsh job that deletes any exiting snapshot for the server/job


                                PatchingJob (w/ auto-remediate)



                                on the snapShotJob you can setup the notifications to email if there are no changes.  the 1st nsh job would just clear out the snapshot data so you don't get a notify the first time it runs.


                                there's probably a few other ways to do this.

                                • 13. Re: Help with snapshot and Audit BLCLI
                                  Santosh Pande

                                  Hi Bill,


                                  Right now in my automation scripts I have a batch job under which I have following jobs


                                  1) Reboot the server before Patch

                                  2) Patch remediation Deploy job


                                  I want to get the snapshot job in the beginning and in the nd of this batch job


                                  So how can I create a snapshot job that snaps the services via blcli without using Components templates, is this possible ? I was looking at blcli help but could not get much info on this


                                  Also can you give me a hint on any other way to achieve this automation


                                  Thanks and Regards



                                  • 14. Re: Help with snapshot and Audit BLCLI
                                    Bill Robinson

                                    why do you need to use the blcli for this ?  you can make it right in the gui..


                                    look at the SnapshotJob.createAssetBasedSnapshotJob command.  it does want you to create an anonymous template, though i'm wondering if you can pass in blank input for the template key and if it would work.  otherwise you need to create the anonymous template, but not the component i think.

                                    1 of 1 people found this helpful
                                    1 2 Previous Next