What does the “Delete Package files if unused for" on the Package Server setting do?

book

Article ID: 181052

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

Question

What does the “Delete Package files if they are unused for" on the Package Server setting do?
(under Settings>Notification Server>Site Server Settings>Site Management>Site Server Settings>Package Service>Package Service Settings)

Environment

ITMS 6.x, 7.x, 8.x

Resolution

Answer

This setting is designed to be used when Package Servers should delete unused packages. It exists on the Settings tab of the Package Server page. Once checked, an order of events must occur for packages to be deleted.

From KB 150861 "FAQ on Package Servers"

2.3 - Deletion of Unused Packages
The setting for when Package Servers should delete unused physical package files exists on the Settings tab of the Package Server page.
The count down to remove the physical package files on a Package Server will only begin when either; the package is unassigned from the Package Server, or the package is deleted from the NS database. Both of these situations result in the package no longer being sent down to the Altiris Agent in the Package Server node of the configuration XML file.
Once this occurs the Package Server updates the PackageStatus.xml file that it stores for each individual package and sets the ‘Status’ flag to ‘Deleted’ and the ‘Time’ flag to that of when it was removed from the configuration file.
The package status files are located (on a default install) at the following location on the Package Server machine -
C:\Program Files\Altiris\Altiris Agent\Package Server Agent\Package Status
At each Package Server refresh the Package Server will check for a Deleted flag inside all the Package Status files and if the corresponding Time flag has passed the duration configured for deletion of unused packages, then the package files will be removed.


Site/Package Server Clean-up: Allow for the NS.Package Refresh and NS.Package Distribution Point Update Schedule tasks to run on the SMP Server (generally scheduled through the night), for those processes will clear the Software Delivery Package codebases from the SMP in the SQL database and the Site/Package Servers will clean-up any packages when synchronized with the SMP Server.
Note: The NS.Package Refresh, NS.Package Distribution Point Update Schedule scheduled tasks can be manually executed from the SMP Server:
For Server 2012 and later: Server Manager > Tools > Task Scheduler > Task Scheduler Library.

Process:

1. After "NS.Package Refresh" scheduled task runs on the SMP server, the package server should get the update about its packages.  You should see the following agent log entries saying that the package is marked as deleted:
 
Entry 1:
Found 1 packages that require deletion.
-----------------------------------------------------------------------------------------------------
Date: 21/09/2021 01:23:58 p.m., Tick Count: 1918530093 (22.04:55:30.0930000), Size: 286 B
Process: AeXNSAgent.exe (2684), Thread ID: 2288, Module: AeXNSCPackageServer.dll
Priority: 4, Source: Package Server Agent


Entry 2:
Marking package id: {1EC214B8-E862-44A9-B3A6-27D918D136A2} as deleted.
-----------------------------------------------------------------------------------------------------
Date: 21/09/2021 01:23:58 p.m., Tick Count: 1918530156 (22.04:55:30.1560000), Size: 317 B
Process: AeXNSAgent.exe (2684), Thread ID: 2288, Module: AeXNSCPackageServer.dll
Priority: 4, Source: Package Server Agent

2. A countdown to remove package files on a Package Server will only begin when either of the following occurs:

  1. The package is unassigned from the Package Server.
  2. The package is deleted from the Notification Server database.

Both of these situations result in the package no longer being sent down to the Altiris Agent in the Package Server node of the configuration XML file.

3. Once this occurs, the Package Server updates the PackageStatus.xml file that it stores for each individual package and sets the Status flag to "Deleted", and the Time flag to that time, when it was removed from the configuration file.

By default, the package status files are located at the following location on the Package Server computer under the specific package GUID:

<installeddrive>:\Program Files\Altiris\Altiris Agent\Package Server Agent\Package Status

At each Package Server configuration refresh, the Package Server will check for a Deleted flag inside all the Package Status files and if the corresponding Time flag value has exceeded or “gone past” the duration configured for the deletion of unused packages, then the package files will be removed.

Here is an example of how this PackageStatus.xml looks like:

<?xml version="1.0"?>

-<PackageStatus>

<Package IsExternalPSOwner="false" PreviousVirtualDirPath="pkggroup_{d9e2c024-f8c8-463e-a9bd-eea4e838223f}/{1EC214B8-E862-44A9-B3A6-27D918D136A2}/cache" VirtualDirPath="pkggroup_{d9e2c024-f8c8-463e-a9bd-eea4e838223f}/{1EC214B8-E862-44A9-B3A6-27D918D136A2}/cache" LocalManagedLocation="" IsLocalManaged="false" CustomPath="" IsCustomLocation="false" SharePath="" ShareName="PkgSvrHostE$" Size="1727056" Version="1.0" Originator="NS" Time="2021-09-21 13:23:58" PreviousStatus="Ready" Status="Deleted" Policy="{F85FE5D9-005A-40AC-B213-944B496405FE}" NfySvr="arba-131m.pan-energy.com" Name="PAE - Consola simple help" Id="{1EC214B8-E862-44A9-B3A6-27D918D136A2}"/>

</PackageStatus>

 

4. For SMP Server Internal packages, such as the Altiris Agent (Symantec Management Agent), and others, there are no different or unique parameters that cause the countdown or deletion to change in anyway. SMP Server internal packages are getting deleted the same as other packages.

One point to note is that, for example, if packages are configured to delete immediately, the deletion does not happen at the exact time the package is removed from the config file. The removal occurs at the next interval of the package refresh schedule on the Package Server. To quicken this process, click the Refresh Packages button inside the Package Server UI.

Attachments