12 Replies Latest reply on Feb 14, 2020 2:15 AM by Andrew Waters

    How to abort ongoing scan

    Jacek Szlaczka
      Share This:

      Hi,

       

      How do I abort ongoing scan that already got cancelled through the UI?
      We have a DR running for almost 72h that can't seem to finish. I want to "hard" abort it, how do I go about doing that?

       

      Cheers!

        • 1. Re: How to abort ongoing scan
          Alex Genstrom

          There is a console utility 'tw_scan_control'

           

          You can probably use: tw_scan_control --stop

          Further, look at the documentation: tw_scan_control - Documentation for BMC Discovery 11.3 - BMC Documentation

          • 2. Re: How to abort ongoing scan
            Greg Sacrey

            Hey there. I have had this happen a number of times and this is how I sort it out.

             

            When a run has been stuck in cancelling mode for several days, and another instance of that same scan has processed since, it's unlikely at that point that it will clear up on its own. The only solution then is to remove the reasoning transaction (persist) files.

            Here are the steps for doing this on a cluster:

             

            Stop all scans on the scanners and allow as many consolidation runs as possible to complete

            Stop the services across the consolidation cluster:

            Only need to run this on the coordinator.

                tw_cluster_control --cluster-stop-services

            Remove the reasoning persist files on each member:

             

            cd /usr/tideway/var/persist/reasoning/engine/queue

            rm -f *.pq

            rm -f *.rc

            cd remote_copies

            rm -rf *

             

            ********

            If you try to delete and get an error that the argument is too long you can use the following commands.

            find -name "*.pq"  -print -delete
            find -name "*.rc"  -print -delete

            *********

             

            This should clean out all files in these directories, but leave the "remote_copies" subdirectory in place.

            Start the services across the cluster:

            Only need to run this on the coordinator.

                tw_cluster_control --cluster-start-services

            If that fails, reboot all cluster members.

             

            This approach has always worked for me. 

            1 of 3 people found this helpful
            • 3. Re: How to abort ongoing scan
              Jacek Szlaczka

              I don't think so,

               

              -x, --stop

              Stops Reasoning. This is equivalent to clicking STOP ALL SCANS.

               

              I've already rebooted the whole appliance with hopes that the DR would actually cancel itself, but it never did. So just stopping reasoning won't help, since it already gets stopped when you reboot.

              • 4. Re: How to abort ongoing scan
                Jacek Szlaczka

                I thought removing the .pq files was only to clean up "stuck" consolidation. Hmm, ok I will give this a try. Thanks!

                • 5. Re: How to abort ongoing scan
                  Greg Sacrey

                  I have done it for both.  I have a couple scanning clusters that for some reason are more susceptible to this.  When this happens and it remains stuck, I do this across all members and it sorts it out. 

                   

                  Good luck with it.

                  • 6. Re: How to abort ongoing scan
                    Brice-Emmanuel Loiseaux
                    Remove the reasoning persist files on each member:

                     

                    cd /usr/tideway/var/persist/reasoning/engine/queue

                    rm -f *.pq

                    rm -f *.rc

                    cd remote_copies

                    rm -rf *

                    This approach is dangerous because you will delete all the persist files reasoning has created to remember what actions it has to do. Not only these related to your stuck scan but also these related to Model maintenance like node aging and DDD removal, or various other tasks. If these actions are not done by reasoning you will end up with anomalies in DA chains or in other areas of the datastore.

                     

                    What you can afford to do is cleaning a very particular subset of the persist files under /usr/tideway/var/persist/reasoning/engine/queue

                        rm -f _*.pq

                    Note the "_" character that will restrict the deletion to IP named pq files, those related to your scan jobs.

                     

                    So, on a cluster this will be:

                        rm -f _*.pq

                        rm -f _*.rc

                        cd remote_copies

                        rm -rf _*

                    3 of 3 people found this helpful
                    • 7. Re: How to abort ongoing scan
                      Greg Sacrey

                      This approach was provided by BMC support to me.

                      Sounds like it needs to be be tweaked.

                      Thanks.

                      1 of 1 people found this helpful
                      • 8. Re: How to abort ongoing scan
                        Jacek Szlaczka

                        I have stopped the services and to my surprise the reasoning queue was empty (no .pq files), after services were started, the DRs were gone.

                        Oh how I love this software and it's UI bugs... At least the "case" is resolved, thanks again.

                        • 9. Re: How to abort ongoing scan
                          Keith Larkin

                          Hi Greg,

                          <<< This approach was provided by BMC support to me. Sounds like it needs to be be tweaked. >>>

                           

                          You're correct, and it has since been corrected.

                          regards,

                          Keith

                          • 10. Re: How to abort ongoing scan
                            Andrew Waters

                            Stop is equivalent of stop all scans it is nothing to do with cancellation.

                            1 of 1 people found this helpful
                            • 11. Re: How to abort ongoing scan
                              Andrew Waters

                              You really, really should not go around just generally deleting pq files. This can result in inconsistent models and left behind nodes.

                              • 12. Re: How to abort ongoing scan
                                Andrew Waters

                                That is not actually the same.

                                 

                                If you restart reasoning with a cancelled run there are cases when it will tidy up things as part of startup which by the time the services are up means that the run is present. This is nothing to do with a 'buggy' UI.

                                1 of 1 people found this helpful