Symantec Management Platform (Notification Server)

 View Only

How to Create Dynamic Collections for Smoke Screen Deployments 

Jul 20, 2009 04:39 PM

When deploying software or software bulletins corporate wide, it is best practice to divide the pushes over several days. Creating static collections for every push is time consuming and inefficient. This document walks through the process of creating dynamic collections that can be reused, decreasing the amount of time required to plan and setup a corporate wide push.

1. Assume the following schedule over 10 days:

Phase 1 - 20 machines per NS
Phase 2 - 100 machines per NS
Phase 3 - 300 machines per NS
Phase 4 - 400 machines per NS
Phase 5 - 600 machines per NS
Phase 6 - 800 machines per NS
Phase 7 - 800 machines per NS
Phase 8 - 800 machines per NS
Phase 9 - 1000 machines per NS
Phase 10 - 1000 machines per NS

2. Create a collection called "Phase 1". This is the test collection. This can be static if there are specific test machines that will be used. Otherwise, it can be dynamic using the following query:

select top 20 Guid from vResource where Guid in 
(select [Guid] from [vComputer] vc where vc.[IsManaged] = 1 )

3. Create a collection called "Phase 2". Exclude the collections "All Windows Servers" and "Phase 1". If "Phase 1" is static, use the following query:

select top 100 Guid from vResource where Guid in 
(select [Guid] from [vComputer] vc where vc.[IsManaged] = 1 )

If "Phase 1" is dynamic, change 'top 100' to 'top 120'

imagebrowser image

4. Create a collection called "Phase 3". Exclude the collections "All Windows Servers", "Phase 1" and "Phase 2". Use the following query:

select top 400 Guid from vResource where Guid in 
(select [Guid] from [vComputer] vc where vc.[IsManaged] = 1 )

5. Create a collection called "Phase 4". Exclude the collections "All Windows Servers", "Phase 1","Phase 2" and "Phase 3". Use the following query:

select top 800 Guid from vResource where Guid in 
(select [Guid] from [vComputer] vc where vc.[IsManaged] = 1 )

6. Create a collection called "Phase 5". Exclude the collections "All Windows Servers", "Phase 1","Phase 2","Phase 3" and "Phase 4". Use the following query:

select top 1400 Guid from vResource where Guid in 
(select [Guid] from [vComputer] vc where vc.[IsManaged] = 1 )

7. Repeat this process for the "Phase 6" through "Phase 10" collections. The approach is to take the current phase machine count and add it to the sum of the preceding phases. Use this number in your query after 'Top'. The previous collections are then subtracted from the total count by placing them in the current phase's Exclusions. This returns the correct number of machines for the current phase while always adapting to a changing environment. Example:

If the current phase is 500 machines and the sum of the previous phases is 300, then current phase query would be:

select top 800 Guid from vResource where Guid in 
(select [Guid] from [vComputer] vc where vc.[IsManaged] = 1 )

imagebrowser image

8. If your company sends notifications for deployments, use the phase collections in deployment notifications. Paste each collection in a separate spreadsheet tab, marked by the date when the phase collection will be deployed to.

9. Whenever a phase is scheduled to be deployed to, place the phase collection into the task. Do this each day, for each phase in order, according to the schedule. There is no need to create a separate task for each phase.

10. If there are business units that require special exclusions, create a separate collection and exclude it from all of the phase collections. Adjust the top numbers accordingly if the exclusions subtract from the machine count for the current phase.

Keeping the collections dynamic in this manner, you won't miss machines as you would with static collections. Anytime a new machine comes online it will be pulled into one of the phase collections. In our environment, we have created phased collections for different scenarios. For example, some SWD packages or patch bulletins have different windows depending on priority. Using this method, we have created 7 day and 30 day scenarios.

Hope this helps! Any questions, feel free to send me a message!

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Jul 23, 2009 11:41 PM

gotta love IN...

Oh, and FYI to anyone reading along at home...turns out the Altiris database is case-insensitive by default, so if you ever use IN with a formatted list (like 'USERNAME1', 'USERNAME2') you can use IN or = directly without an UPPER() or LOWER() call first.  It make a query we had that ran for 2 minutes finish in about 10 seconds by taking out the UPPER().  Apparently when you use UPPER() it isn't possible to also use a table index, so it is very slow.

Jul 23, 2009 06:05 PM

Why not use IN, instead of OR or AND? All the guids are in the same section, and IN statements seem to run process faster then multiple OR's or AND's.

select Guid from vResource 
where Guid in 
(select top 400 [Guid] from [vComputer] vc 
where vc.[IsManaged] = 1 and vc.guid not in 
(select resourceguid from collectionmembership cm 
where cm.collectionguid IN ('d92bb6ff-cd09-4464-b909-1abea6c2266f','9e88b1bd-d53e-41db-95e2-baf19e783185','ae7f597b-e376-4f75-9eb7-1a417c0cc5e9','4c1fa4fe-108e-4919-b1ba-b82dfa6375b5','4cdeb294-a662-4c0e-8752-ceaa3b14b99c','f455a019-8277-4c7c-99fc-d9ce7d6e3979','9016aad5-5c0d-49d6-a9f9-187095d1e4b1','8bd1d4fb-b3c8-4883-bc68-54b7e3e52268','eb2f3c8e-060d-4008-824c-273c161be131')))

Jul 21, 2009 12:39 PM

I think the query was failing as you have "cm.CollectionGuid = '....' AND cm.CollectionGuid = '....'.  If you put them together with OR statements then it will work, as a single row can't have 8 different collectionGuids.

Jul 21, 2009 11:58 AM

 Ahh... that's why you were calling me Ion -I was very confused. It all becomes clear now!
Damn that must have been annoying....

But no need to send in your 'associates' -I'll mend my ways lest my fingers get broken.... ;-)


 

Jul 21, 2009 11:20 AM

Thanks for the comments guys!

TOP is working, but it did seem to be buggy if I put it in the subquery. Using it in the main query seemed to fix it.

Ian, thanks for the datediff tip! I was talking to our deployment team about this the other day. They want a "set it, forget it" collection for different scenarios. Using your method would do the trick.
You could still see what you were pushing to by filtering in a report or notification policy.

It's worth noting, my first attempt had some issues. I was using the following query:
select Guid from vResource where Guid in (select top 400 [Guid] from [vComputer] vc where vc.[IsManaged] = 1 and vc.guid not in (select resourceguid from collectionmembership cm where cm.collectionguid= 'd92bb6ff-cd09-4464-b909-1abea6c2266f'
AND cm.collectionguid= '9e88b1bd-d53e-41db-95e2-baf19e783185'
AND cm.collectionguid= 'ae7f597b-e376-4f75-9eb7-1a417c0cc5e9'
AND cm.collectionguid= '4c1fa4fe-108e-4919-b1ba-b82dfa6375b5'
AND cm.collectionguid= '4cdeb294-a662-4c0e-8752-ceaa3b14b99c'
AND cm.collectionguid= 'f455a019-8277-4c7c-99fc-d9ce7d6e3979'
AND cm.collectionguid= '9016aad5-5c0d-49d6-a9f9-187095d1e4b1'
AND cm.collectionguid= '8bd1d4fb-b3c8-4883-bc68-54b7e3e52268'
AND cm.collectionguid= 'eb2f3c8e-060d-4008-824c-273c161be131'))
I was trying to filter out the other phases in the query and it bombed out at the 3rd or 4th collection. It started to pull all machines. Moving the TOP and changing them to exclusions did the trick.

Jul 21, 2009 10:45 AM

Somehow, I will get you to call me Kyle, not Karl... :)

Maybe I will send my associate EdT to have a visit with you...he's in country there!

Jul 21, 2009 04:50 AM

Karl, TOP does work for collections (or did on a staggered rollout we did last summer). I've never used PERCENT though, so perhaps this is the issue.

Kinetic - Nice write up -I can see a fair bit of thought has gone into this. Something which might help -if you use TOP in conjunction with the datediff command you can create collections which increase their deployment scope by 100 computers each day (or whatever increment suits you best). That way you just have one collection which increases in size daily.

The upside is that it's a bit tidier, and allows you a bit more flexibility without overwhelming the console with objects. It does come with the downside -you don't know what's going to be deployed to next, until it starts deploying to it...

As you're a software deployment guy, you might also find the following article series useful:
https://www-secure.symantec.com/connect/articles/building-better-collections-software-delivery

Kind Regards,
Ian./


Jul 21, 2009 01:41 AM

Very nice.  I recall reading somewhere that TOP statements in a collection don't work...guess they either fixed it, or the article I read was wrong...or the exclusions are the key!

We used a similar version of this, but based on machine GUID:

SELECT Guid FROM vComputerResource vr
WHERE CAST(LEFT(Guid, 1) AS nvarchar(38))  LIKE '[0-F]'  --adjust the range, you can use [0-6], [8-B], or [0-F]

This lets you cut your collection up into 1/16ths if you only add one letter at a time. 

Did you try using TOP x PERCENT?  Maybe that's the one I'm thinking of that doesn't work....?

Also...you probably don't have to use the "IN" operator; can you just JOIN vComputer, or just do it like so:

SELECT TOP 100 Guid FROM vComputerResource WHERE IsManaged = 1

OR

SELECT TOP 100 vr.Guid
FROM vResource vr
JOIN Inv_AeX_AC_Identification acid
ON vr.Guid = acid._ResourceGuid
WHERE IsManaged = 1
AND acid.[OS Type] = 'Professional'  -- Eliminates the need to exclude "All Windows Servers"
AND acid.[System Type]  = 'Win32'

Jul 20, 2009 04:40 PM

This approach could be useful in the future. Thanks. :) 

Related Entries and Links

No Related Resource entered.