Transferring model context instances

When deploying a new monitor model version, you can choose to have active instances from the previous versions be processed by the new model version. Before you install the new model version, you switch the CEI distribution mode of the previous version to Inactive (event queue recoverable). You can then transfer active (or active and completed) instances from the previous version to the new version.

Before you begin

The number of active monitoring context instances for the previous version can be checked on the Version Details page in the WebSphere® Application Server administrative console.

About this task

Transferring instances from previous versions to the current version allows you to retire (remove) the old model versions without losing the instance data associated with them.
Important: This is the only time that it is safe to transfer active instances. At any later time, you can also transfer completed instances.

Transferring instances also allows you to fix any problems with an old model version, using updated logic in the new model version. Note that the updated logic applies only to future events; it is not retroactively applied to events that have already been processed. When you deploy a new version with the same filters and correlation keys, the new version processes the events queued up for the problem version. After the events are processed, the problem version can be removed.

When data is moved from the older version to the new version, the processing of the data depends on several factors:
  • If the monitoring contexts exist in the new version only, there is no data to be moved because these monitoring contexts did not exist in the old version of the model.
  • If the monitoring contexts exist in the old version only, the data from the old version is not transferred. However, the data that is not moved is available for dashboard reporting until the old version is purged from the Monitor server.
  • If metrics exist in the new version only, default values (if available) are inserted in the new version.
  • If metrics exist in the old version only, the metrics that do not exist in the new version are ignored.

Be aware that if the old and new models have different logic for setting a metric, the data that is transferred represents the old logic.

Restriction: When a monitoring context instance is moved to a version that contains a daily time trigger, the daily time trigger does not fire for the moved monitoring context instance.

Procedure

  1. If you are moving active instances or all instances, switch the CEI distribution mode of the previous version to Inactive (event queue recoverable) before deploying the new version, as described in "Changing the CEI Distribution Mode".

    Note that the new version is automatically set to Inactive.

  2. Use one of the following LifecycleServices MBean methods to transfer completed monitoring context instances, active monitoring context instances, or all monitoring context instances to the new version:
    • LifecycleResultsBean moveCompletedMCInstances(String modelID, long moveFromVersion, long moveToVersion)
    • LifecycleResultsBean moveActiveMCInstances(String modelID, long moveFromVersion, long moveToVersion)
    • LifecycleResultsBean moveAllMCInstances(String modelID, long moveFromVersion, long moveToVersion)
    Tip: You can invoke the methods using the wsadmin utility. For example, to move all monitoring context instances from the AutoPartsRevenue model from version 2011021065518L to version 20110402150152L, you would enter the following wsdamin command:
    AdminControl.invoke(AdminControl.completeObjectName('type=LifecycleServices,*'),'moveAllMCInstances',['AutoPartsRevenue',2011021065518L,20110402150152L])
  3. Set the CEI distribution mode of the new version to Active if any previous versions have a CEI distribution mode set to Inactive (event queue recoverable.

Results

The instances are moved from the old version to the new version.
If the moveActiveMCInstances command fails and you are able to manually move the active monitoring context instances by other means, or if you decide to ignore the active monitoring context instances, you can invoke the following LifecycleServices MBean method:
LifecycleResultsBean confirmMoveMCActiveInstances 
(String modelID, long moveFromVersion, long moveToVersion)
You can then change the CEI distribution mode of the new version to Active.
If the moveFromVersion monitor model version (the prior monitor model version that is being retired) is uninstalled after you use the moveAllMCInstances command, manually map JMS resources to the moveToVersion monitor model version to ensure that this version of the monitor model will start. Complete the following steps:
  1. Stop the moveToVersion of the monitor model if it is currently running.
  2. Find the JMS queue names for the moveToVersion of the monitor model by going to Resources > JMS > Queues in the WebSphere Application Server administrative console. The related queues have the monitor model version in the name and end in "Q" and "Q_R".
  3. Find the JMS queue connection factory names for the moveToVersion of the monitor model by going to Resources > JMS > Queue connection factories. The related queue connection factories have the monitor model version in the name and end in "QF" and "QF_R".
  4. Go to Applications > Application Types > WebSphere enterprise applications > application for the moveToVersion of the monitor model > Resource environment references.
  5. Update the Target Resource JNDI Name field for the jms/MonitorQueue, jms/MonitorEventResubmissionQueue, jms/MonitorQueueConnectionFactory, and jms/MonitorEventResubmissionQueueFactory resources using the values noted in the prior steps.
  6. Start the moveToVersion of the monitor model.