Home > Cloud Cruiser 3 > Batch XML Reference > Transform processors > ConvertEventsToAllocations

ConvertEventsToAllocations

Fills in missing usage start or usage end depending on configuration. This is similar to ConvertSnapshotToPeriod, but this transform only supports the useBeginState behavior. Additional functionality includes writing start records for "next day," terminating allocations on contained resources, and synchronizing derived state with feeds representing current state.

An example of terminating a contained resource is a VM allocation end record that terminates a VM start record for the same vmName and also terminates any storage allocations for the same VM without an explicit end record for the storage resource. The option to write a next day file will create 00:00:00 start records for any resources still allocated as of midnight on the selectDate.

Processing rules assume the following:

  • all records have the same set of key identifiers.
  • sub identifiers are optional and not expected on all records.
  • records with start time and no end time indicate create/modify transactions.
  • records with end time and no start time indicate delete transactions.
  • create/modify transactions include resource values representing future state.
  • resources are assumed to exist until end of period unless there is a delete transaction.
  • records include a complete inventory snapshot on or before begin-of-day (00:00:00) on select date (if no inventory snapshot available, then all historical data must be processed).

Sorting Input

Input must be sorted by key identifiers (and time) prior to processing. This is done by using the CCRecordSortTasklet in a previous job step.

Next Day Feed Option

This transform can roll forward allocations such that a create event on day 1 will create a start event on day 2 at 00:00:00 time. To activate this feature, specify a name for nextDayStartFeed. Resource allocations will roll forward indefinitely until an end event is encountered. The start records generated for selectDate+1 are written to a feed file as though they were collected. The feed file is named as yyyyMMdd _bod.ccr .

Cascading Termination

If resources have a natural containment, such as VMs and snapshots, it is possible to have this transform terminate contained resource allocations (e.g., snapshots) when the outer resource allocation ends. To do this, set one or more identifiers that uniquely identify the contained resources as sub identifiers. For example, vmName as a key identifier and snapshotName as a sub identifier.

Control Feeds

It is possible to indicate one or more feeds that contain all active allocations. Most systems that produce events also have a way to list current services. Allocations assumed from event data can be verified against data collected for current services. By identifying which data feeds represent current services (inventory), this processor will terminate allocations that are not found in a control feed. Allocations that are supported by a control feed will be updated to reflect the identifiers and resources found in the control data. This can correct an allocation where a modification event was lost.

It is important to ensure control data exists when one or more control feed names are set or else all allocations will be dropped. This can be done by using the FileExistsCondition for occasional collection of control data. Otherwise, the assembly tasklet can be configured to check for required feeds when daily control data is expected.

Class

<bean class=”com.cloudcruiser.batch.transform.ConvertEventsToAllocations”>

Properties

<property name="keyIdentifiers" value="keyIdentifiers" />

Sets one or more identifier names used to correlate records. Ideally, this would only be @acctid . Otherwise, sufficient identifiers should exist to provide correlation at the lowest account level. This defaults to @acctid .

<property name="subIdentifiers" value="subIdentifiers" />

If resources have a natural containment, such as VMs and snapshots, this terminates contained resource allocations (e.g., snapshots) when the outer resource allocation ends. set one or more identifiers that uniquely identify the contained resources as sub identifiers. For example, vmName as a key identifier and snapshotName as a sub identifier.

<property name="nextDayStartFeed" value="nextDayStartFeed" />

Rolls forward allocations such that a create event on day 1 will create a start event on day 2 at 00:00:00 time. Resource allocations will roll forward indefinitely until an end event is encountered. The start records generated for selectDate+1 are written to a feed file as though they were collected. The feed file is named as yyyyMMdd _bod.ccr .

<property name="controlFeedNames" value="controlFeedNames" />

Sets optional feed names that represent collection of current state. Any allocations for keys not found in a control feed are terminated assuming an end event was missed. Start records from current state will dictate state going forward and should contain the same identifiers and resources as event feeds.

Spring Batch XML Example

<bean class="com.cloudcruiser.batch.transform.ConvertEventsToAllocations">
   <property name="active" value="true" />
   <property name="keyIdentifiers" value="CustomerID,VMName" />
   <property name="subIdentifiers" value="SnapshotName" />
   <property name="nextDayStartFeed" value="state" />
   <property name="controlFeedNames" value="snapshot" />
</bean>
Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP