cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Collection Cleanup on Failed Deployment

dbeckner
By Level 10 Champion
Level 10 Champion

Im wondering how the "enable collection cleanup on failure" is related to the timer for "Automatically fail software requests with no change in status after xx hours".

If i have the timer set to 72 hours does App portal wait for 72 hours to confirm the failed deployment status before removing the device from a collection or is it possible that these settings conflict with each other?

(2) Solutions

I thought that it was a great question as well, and I had to dig around a bit to remember the actual behavior,  as collection cleans are not cut and dried. 

For packages and task sequences, the cleanup will occur the first time that we get a status which matches those defined under settings->deployment->ConfigMgr for the setting "Program Collection Cleanup Status ID's" or  Settings->deployment->OS Deployment for the setting "Task sequence collection cleanup status ID's". This, of course, assumes that you have the "remove from collection when complete" setting selected for your catalog item... Note that the monitor flag in the WD_PackageRequests is not taken into consideration for packages and Task Sequences. 

Applications are a bit different in that they only get cleaned on a success, or *optionally, a failure.. 

First, you need to have the "remove from collection when complete" setting selected for your catalog item. If you have only this selected, then a cleanup will occur only on a successfully install.. Second, if you have the "Enable collection cleanup on failure" setting under settings->deployment->ConfigMgr selected, then the device will be removed from the collection on a failure. It is important to note that for applications, the "monitor" flag in WD_PackageRequests must be set to "0" (false), meaning that the application is no longer being monitored..  

Long story short, It appears that App Broker is handling the cleanup correctly even when we receive an initial failure, and App Broker is waiting for a success ( See the setting "Monitor Threshold for failed deployments to prevent false flags" under settings->timers)

As an added bonus, if you have verbose logging enabled, you can look at the CollectionClean_<server>.log file, and see the actual query being used to get the list of requests which need to be cleaned.. The query will probably explain it better than I can 🙂

View solution in original post

To actually answer your question: The setting "Automatically fail software requests with no change in status after xx hours" is indirectly tied to collection cleanup... Once this timer elapses, App Broker will fail the request by setting the monitor flag = 0, and by writing a failure status into the LastStateID and LastStatusID columns in WD_PackageRequests.. The collection clean routine will pick up on the fact that the request is no longer being monitored, and has failed, so it should clean up the device from the collection at this point.

View solution in original post

(4) Replies

That's a great question.  I've actually wondered that myself before but never had time to look into it.  My assumption is that the target stays in the collection until the timer expires, as if it doesn't, then the timer is kind of useless.  Perhaps @CharlesW  can provide some insight?

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

I thought that it was a great question as well, and I had to dig around a bit to remember the actual behavior,  as collection cleans are not cut and dried. 

For packages and task sequences, the cleanup will occur the first time that we get a status which matches those defined under settings->deployment->ConfigMgr for the setting "Program Collection Cleanup Status ID's" or  Settings->deployment->OS Deployment for the setting "Task sequence collection cleanup status ID's". This, of course, assumes that you have the "remove from collection when complete" setting selected for your catalog item... Note that the monitor flag in the WD_PackageRequests is not taken into consideration for packages and Task Sequences. 

Applications are a bit different in that they only get cleaned on a success, or *optionally, a failure.. 

First, you need to have the "remove from collection when complete" setting selected for your catalog item. If you have only this selected, then a cleanup will occur only on a successfully install.. Second, if you have the "Enable collection cleanup on failure" setting under settings->deployment->ConfigMgr selected, then the device will be removed from the collection on a failure. It is important to note that for applications, the "monitor" flag in WD_PackageRequests must be set to "0" (false), meaning that the application is no longer being monitored..  

Long story short, It appears that App Broker is handling the cleanup correctly even when we receive an initial failure, and App Broker is waiting for a success ( See the setting "Monitor Threshold for failed deployments to prevent false flags" under settings->timers)

As an added bonus, if you have verbose logging enabled, you can look at the CollectionClean_<server>.log file, and see the actual query being used to get the list of requests which need to be cleaned.. The query will probably explain it better than I can 🙂

To actually answer your question: The setting "Automatically fail software requests with no change in status after xx hours" is indirectly tied to collection cleanup... Once this timer elapses, App Broker will fail the request by setting the monitor flag = 0, and by writing a failure status into the LastStateID and LastStatusID columns in WD_PackageRequests.. The collection clean routine will pick up on the fact that the request is no longer being monitored, and has failed, so it should clean up the device from the collection at this point.

Thanks @jdempsey and @CharlesW . Appreciate the feedback and detailed response. As always you guys provide outstanding support for the App Broker community.