Configuring a chargeback model


This section contains the following use cases:

Use Case 1 - Create a basic cost object

Use Case summary

Request Body

<basicCostObject>
<name>VM Instance</name>
<key>VM_INSTANCE</key>
<fields>
<cofield>
<label>#vCPUs</label>
<subkey>VM_CPU_NUM</subkey>
<calculationMode>UTILIZATION_BASED</calculationMode>
<metricName>CPU_NUM</metricName>
<consumption>vCPUhour</consumption>
<costUnit>vCPUhour</costUnit>
</cofield>
<cofield>
<label>Storage Usage</label>
<subkey>VM_STORAGE_USAGE</subkey>
<calculationMode>UTILIZATION_BASED</calculationMode>
<metricName>TOTAL_DSTORE_USED</metricName>
<consumption>GBHour</consumption>
<costUnit>GBHour</costUnit>
</cofield>
</fields>
<entity>SYSTEM</entity>
<entityType>VM-VMWARE</entityType>
</basicCostObject>

An image showing the cost object you just created

The following image is an example that shows the basic cost object you created using the API calls illustrated in the preceding section.

Basic Cost Object created by the API call
uc1.png

Use Case 2 - Create a Chargeback cost model template

Use Case summary 

 Request Body

<modeltemplate>
<name>Cost Model Template CM1</name>
<costobjects>
<costObject costObjectId="{DB-Instance-id}"/>
<costObject costObjectId="{VM-Instance-id}"/>
</costobjects>
</modeltemplate>

An image showing the Chargeback cost model template you just created

The following image is an example that shows the Chargeback cost model template you created using the API calls illustrated in the preceding section.

Chargeback cost model template created by the API call
uc2.png

Use Case 3 - Create a synchronized Chargeback model

Use Case summary

 

The examples in the preceding section refer to the following BMC Helix Capacity Optimization domain tree and cost model template:

Domain tree and cost model template used in this section
uc3_1.png

Request Body

<model>
<name>Cost Model CM1</name>
<costModelTemplateId>{Cost Model Template CM1-id}</costModelTemplateId>
<type>AUTO</type>
<autoGenerationConf keepSynchronized="true">
<domainRootId>{Organization-id}</domainRoot>
<targetDepthLevel>2</targetDepthLevel>
<ccoCreation>true</ccoCreation>
<ccoAllocationToTarget>true</ccoAllocationToTarget>
<ccoAllocationBasicCo>true</ccoAllocationBasicCo>
<costRatesGeneration>true</costRatesGeneration>
</autoGenerationConf>
</model>

Response Body

<model>
<name>Cost Model CM1</name>
<allocations>
<modelAllocation targetId="{Div - Austin-id}">
<allocPct type="MANUAL_SPECIFIED">100</allocPct>
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-GOLD-id}"/>
</modelAllocation>
<modelAllocation targetId="{Div - Houston-id}">
<allocPct type="MANUAL_SPECIFIED">100</allocPct>
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-SILVER-id}"/>
</modelAllocation>
<modelAllocation targetId="{Div - Pune-id}">
<allocPct type="MANUAL_SPECIFIED">100</allocPct>
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-SILVER-id}"/>
</modelAllocation>
</allocations>
</model>

An image showing the Chargeback cost model template you just created

The following image is an example that shows the Chargeback cost model template you created using the API calls illustrated in the preceding section.

Chargeback cost model template created by API calls
uc3_2.png

Use Case 4 - Add cost rates to a Chargeback model

Use Case summary

Request Body

<costs>
<costRate>
<costObjectId>{Memory Option Cost-id}</costObjectId>
<costObjectKey>MEM_4GB</costObjectKey>
<cost>2</cost>
<sinceDate>1970-01-01</sinceDate>
<toDate>9999-01-01</toDate>
</costRate>
<costRate>
<costObjectId>{Memory Option Cost-id}</costObjectId>
<costObjectKey>MEM_8GB</costObjectKey>
<cost>4</cost>
<sinceDate>1970-01-01</sinceDate>
<toDate>9999-01-01</toDate>
</costRate>
<costRate>
<costObjectId>{VMemory Option Cost-id}</costObjectId>
<costObjectKey>MEM_16GB</costObjectKey>
<cost>7</cost>
<sinceDate>1970-01-01</sinceDate>
<toDate>9999-01-01</toDate>
</costRate>
</costs>

Response Body

<model>
<name>Cost Model CM1</name>
<allocations>
<modelAllocation targetId="{Div - Austin-id}">
<allocPct type="MANUAL_SPECIFIED">100</allocPct>
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-GOLD-id}"/>
</modelAllocation>
<modelAllocation targetId="{Div - Houston-id}">
<allocPct type="MANUAL_SPECIFIED">100</allocPct>
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-SILVER-id}"/>
</modelAllocation>
<modelAllocation targetId="{Div - Pune-id}">
<allocPct type="MANUAL_SPECIFIED">100</allocPct>
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-SILVER-id}"/>
</modelAllocation>
</allocations>
<costs>
<costRate>
<costObjectId>{Memory Option Cost-id}</costObjectId>
<costObjectKey>MEM_4GB</costObjectKey>
<cost>2</cost>
<sinceDate>1970-01-01</sinceDate>
<toDate>9999-01-01</toDate>
</costRate>
<costRate>
<costObjectId>{Memory Option Cost-id}</costObjectId>
<costObjectKey>MEM_8GB</costObjectKey>
<cost>4</cost>
<sinceDate>1970-01-01</sinceDate>
<toDate>9999-01-01</toDate>
</costRate>
<costRate>
<costObjectId>{VMemory Option Cost-id}</costObjectId>
<costObjectKey>MEM_16GB</costObjectKey>
<cost>7</cost>
<sinceDate>1970-01-01</sinceDate>
<toDate>9999-01-01</toDate>
</costRate>
</costs>
</model>

An image showing the cost rates you just created

The following image is an example that shows the cost rates you created using the API calls illustrated in the preceding section.

Cost rates created by the API call
uc4.png

Use Case 5 - Promote a cost model to golden

Use Case summary

Request Body

<status value="OK"/>

Use Case 6 - Allocate a cost object to a target

Use Case summary 

Request Body

<allocationDescription>
<allocPct type="EQUALLY_SHARED" />
<allocResources type="BASED_ON_RULES">
<domainRule type="INHERIT" />
</allocResources>
<sinceDate>1970-12-01</sinceDate>
<toDate>9999-12-31</toDate>
<costObject costObjectId="{BCO-Offering-GOLD-id}"/>
</allocationDescription>

An image showing the allocation you just created

The following image is an example that shows the allocation you created using the API calls illustrated in the preceding section.

Allocation created by the API call
uc6.png

Use Case 7 - Search a composite cost object

Use Case summary 

Request Body

<lookupInfo srcid="1">
<fields>
<field>
<name>uuid</name>
<value>422ca5cd-650b-209b-99aa-6c2532206ebc</value>
</field>
</fields>
</lookupInfo>

Where to go from here

Executing-a-chargeback-model

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*