Workflow Soluiton

 View Only
Expand all | Collapse all

Scheduling tasks error post imaging via Workflow

masonje

masonjeJun 13, 2012 02:06 PM

  • 1.  Scheduling tasks error post imaging via Workflow

    Posted May 30, 2012 06:28 PM

    I beleve the issue I'm having is related to this post: https://www-secure.symantec.com/connect/forums/running-tests-and-get-scoping-error

    Post imaging we have scripts that

    1. redirect the ITMS agent
    2. wait for a GUID (update config, no guid then send basic inventory, wait, update config, rince and repeat till you have a GUID)
    3. then to a web call to our ITMS Workflow server to schegule jobs.

    In the WF, it walks a folder tree and schegules post imaging jobs.  Thing I'm having issues with is if ITMS has never seen this PC before, it bombs out on scheguleing the task.  Error:

    • ClassName: TaskManagementServiceDynamicService.ExecuteTaskComponent
    • ComponentName: Schegule Task
    • ExceptionClassName: System.Web.Services.Protocols.SoapException
    • Trigger Message:Server was unable to process request. 
    • After scoping and filtering no computers are left assigned to this task.
    • Stack Trace: System.Web.Services.Protocols.SoapException: Server was unable to process request. 
    • > After scoping and filtering no computers are left assigned to this task. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at TaskManagementServiceDynamicService.TaskManagementService.ExecuteTask(Guid taskGuid, String executionName, String inputParameters) at TaskManagementServiceDynamicService.ExecuteTaskComponent.Run(IData data) at LogicBase.Core.ExecutionEngine.SinglePathProcessComponentExecutionDelegate.Execute(IData data, IOrchestrationComponent comp, String& outputPath, IExecutionEngine engine, TLExecutionContext context) at LogicBase.Core.ExecutionEngine.AbstractExecutionEngine.RunComponent(TLExecutionContext context, IData data, IOrchestrationComponent comp)

    It's the "scoping and filtering" part that stuck out and lead me to the post above. Right after imaging is done, and I go to the web console and I do a Delta update (maybe even a policy update as well), then re-run the redirect scirpt, all works fine.  Tasks are run, software is delivered, so on...  I even tried error trapping in the WF,  with loops and retries in the client script, but nothing works till the manual Delta update from the console.

    So Here is the question, what can I do in WF to get this this to work?  There are a bunch of "update" style objects in WF that have 0 documentation on what they do and how to use them.

     



  • 2.  RE: Scheduling tasks error post imaging via Workflow

    Posted May 31, 2012 04:12 PM

    So do you just need to update the resource target or a filter? Either way it should be do-able you would just need to pass in the guid. 

     

    If you need to update the Filter then you can use the UpdateCollectionsComponent under Symantec > SMP 7 > Web Services > Collections which is pretty straight forward as long as you pass in the right guid. 

     

    As for the target update, which I think may be the same as the Delta Update you'd need to use a stored procedure to get it to update. Which can be done from an integration library via the stored procedure caller generator. The specific stored procedure you're looking for is spResourceTargetDeltaUpdate from the Symantec_CMDB under Programmability > Stored Procedures. It has a few different inputs to it but the only one that's required is the GUID. I grabbed the GUID from my managed delivery policy and used a GetResourceTargetsComponent to get the GUID for the Resource target that would need to be updated. Hopefully that makes sense.

     

    Below is a screenshot of a workflow I created to add computers to a filter then update resource target which may give you a visual idea.

     



  • 3.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 01, 2012 03:18 PM

    I beleve what I need to do is more than just updateing a collection.  Sounds like running spResourceTargetDeltaUpdate may do what I need.  I'm in the process of working with our DBA team to get access to run stored procedures.  I'll let you know. Thanks!



  • 4.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 01, 2012 05:21 PM

    I played with running that process right after the PC gets a GUID, and it didn't help.  I may need to add that post my "update collection", but things still blow on the "Schedule Task" object.  I have attached my screen shot.

    (open the pic in a new window to see the whole thing)

    So lets line up where things are going wrong.  

    1. Script runs and redirects to its ITMS server
    2. Waits for guid
    3. gets guid
    4. call web service depicted above (less than 30 seconds later)
    5. walk a tree and finds object to work with (folders, tasks, symbloc links)
    6. When it finds a task to assign the PC to, the WF fails, the error is caught, and send back in the retuned XML to log on the PC

    I thin its because it hasn't been around long enough for it to figure out

    • Is the product for the task (any of the tasks) licensed for the computers on which you've requested it to run?
    • Is the sub-agent for the product for the task you've requested available on the target computer?
    • Is the target system a managed system?

    That's what (I beleve) running the Delta Update helps fix.  Is there a way to do a delta update of sorts on just one computer GUID?



  • 5.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 01, 2012 08:14 PM
    Hmmmm that's very strange. So if it's narrowed down to those 3 options maybe it's not showing up immediately as a managed client. How about putting a pause component before the scheduled task for about a minute to see if that helps. Taking a few steps back.. how are the agents being installed post imaging or are they apart of the image? And it's calling the web service just as soon as it picks up the GUID? I'm thinking some time between the components should help. I won't get back to my server to test it out myself until Monday but I can try to recreate this on my end.


  • 6.  RE: Scheduling tasks error post imaging via Workflow

    Broadcom Employee
    Posted Jun 04, 2012 12:31 PM

    The issue is with the delay in the SMP. By default the SMP updates its collections every 5 minutes. When a new machine gets its GUID the Delta Collection Update task must run before the machine will be found in any filters or be available to be assigned any tasks or policies. So you will have to wait at least 5 minutes from the end point machine gettings its guid  before you can do anything with it. Thats with the assumption that the schedule for the Delta Update hasn't been changed. This is why running the Delta schedule manually fixes the problem.

    Possible solutions:

    1. Add a pause that allows for the Delta Update to run on SMP.

    2. Add component / script to force Delta Update to run on SMP.

     



  • 7.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 04, 2012 05:04 PM

    I talked this over with our Symanted Server admin and he stopped short of laughing at me. We have 4 child SMP server that are scaled for 25,000 each, but average is about 21k.  Our Delta updates are set for 1 hour and when I told him I need to kick off an update for every PC that is imaged... well I'll save you the explitives. surprise

    We will be putting out clients over to the new SMP servers when we migrate to Windows 7.  So at first we will be imaging a lot of clients.  Wouldn't be cool to kick off 100s of updates at a time.

    The Delta update would be the simplest way, but as noted, not possible at our scale.  What I REALLLLLY need is the bear minimum.  What one or two filters/targets do I need to update to achieve the ability to run a task without making my server admin want to pull out his WWF DDT moves on me!



  • 8.  RE: Scheduling tasks error post imaging via Workflow
    Best Answer

    Posted Jun 07, 2012 04:57 PM

    Now, I may have updated more than I needed, but it got the job done.  I just looked at a brand new PC and saw all the collections it was a part of post pushing the Delta Updates button.  I added all those into an array... but it didn't work.  So I moved a few of them around and added the names into the array so I could tell what I was moving around.  This is the array and the order they are updated.

     

    aCollectionsToUpdate = array
    [0] All Computers,eb3a1a12-e1c7-4431-b060-f0333e4e488c
    [1] Computers with 64-bit Symantec Management Agent,737d21a7-e8d5-413c-8f0e-2d18977dd9ba
    [2] Windows Computers,e3a71b08-1612-44a6-9f71-7d359d5475b4
    [3] Windows 7,dd7c79d8-4afc-4ecd-9088-6517d1e9f00e
    [4] Windows 2000/XP/2003/Vista/2008/7 Computers,8afb27a2-5dc7-43ca-a88c-8391252f5b7b
    [5] Computers with Client Task Agent Installed,d996bbf2-8495-4e68-a5df-896f1e8f78fb
    [6] Computers without Task Services Installed,3952117b-b3b9-4d52-afcb-08b9752b1f02
    [7] All Task Devices,9b73f78b-4c75-45f4-a7e5-f01cba6c09f7
    [8] All Computers without Inventory Plug-in,e8cf27c1-46bf-45d5-8b48-ba983bebb5ae
    [9] All Office Computers Managed,4f9a5743-1d59-43c6-a71e-7e4541b91730
    [10] All Windows Computers with Inventory Rule Agent All Windows Computers with Inventory Rule Agent Installed,97453ec6-c722-4c29-ab18-6848feb9165b
    [11] Windows Desktop Computers (excluding 'Site Servers'),ca694c17-ac59-459b-8c41-a7285a8cef9b
    [12] Windows Desktops,66167acf-2484-4244-92fb-a2ffaa5aebd2
    [13] Windows Workstations,cbe9791c-7ed3-4b05-9129-c04d61cc8a23
    [14] Windows Computers without Inventory Plug-in,e7d1d5ef-8798-4af3-b62b-dacc1368c42f
    [15] Windows Computers with NS 7 Symantec Management Agent,ec529bb7-eba9-4f75-b672-34363198d00c
    [16] Windows x64,37594ee7-4f9e-4c19-9c7d-9c7ecc449ce6
    [17] Windows x64 Computers with Native 64-bit NS 7 Symantec Management Agent,00ee3f01-42a0-47de-b0ab-dab2d1450cc4
     
    Update Loop
     
    So, I may still be using a sledge hammer to get working... just a smaller one. ;-)

     



  • 9.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 13, 2012 01:56 PM

    What data type did you use for the array of collections, Altiris7.WebServices.Collections.ItemDetails?



  • 10.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 13, 2012 02:00 PM

    NM... I see what you did here... text datatype and then split out the guid based on the comma. Testing it on my side now... I hope it does the trick!



  • 11.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 13, 2012 02:06 PM



  • 12.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 13, 2012 02:09 PM

    you posted faster than I could hit enter! wink



  • 13.  RE: Scheduling tasks error post imaging via Workflow

    Posted Jun 13, 2012 03:01 PM

    This solved my problem too! Amazing that we are all trying to solve the same problem with our own Workflows at the same time!

     

    Thanks for the post!