Charge Back and Exporting Data Usage Reports

Explore this Page

Overview

This topic explains how to use the Charge Back feature in SANsymphony to track I/O statistics per host group, generate usage reports, and export them for billing or capacity planning. It covers the following:

  • About Charge Back: Describes how the feature works, what performance metrics it collects, and prerequisites such as the need for a remote SQL Server to store recorded data.
  • Enabling or Disabling Charge Back: Step-by-step instructions to turn the feature on or off for a host group, including how to configure the recording server connection.
  • Data Usage Reports: Summarizes the types of reports available (summary and detailed), the metrics included, and guidelines for report retention and export formats.
  • Exporting Data Usage Reports Using Script: Details the provided PowerShell script (Export-DcsDataUsageReport.ps1), its parameters, and usage examples to automate exporting data usage statistics.

About Charge Back

The Charge Back feature allows IT organizations to track and measure I/O statistics per host group. This feature allows I/O resources to be "metered" so that organizations, such as Cloud Service Providers, can determine the resources used per host group and charge back the costs of storage-related expenses to customers. Charge back can also be used to determine usage in order to evaluate future storage needs and appropriate resources more effectively within an organization.

The Charge Back feature is a host group setting. When enabled, performance counters for the host group are added to the performance recording session. These counters are used to provide data usage metrics:

  • Total Bytes Written/sec
  • Total Bytes Read/sec
  • Total Reads/sec
  • Total Writes/sec
  • Total Bytes Provisioned

See Recorded Performance for more information about counters.

Data Usage Reports

Data Usage reports can be created to collect and export I/O statistics for host groups during a specified date range. The performance counters added when the feature is enabled are used to provide data in the reports. Statistics include Total Bytes Transferred, Total Bytes Read, Total Bytes Written, Total IO Operations, Total Read Operations, Total Write Operations, Data Status and Total Bytes Provisioned. Data is gathered and recorded in the database every two minutes.

All statistics, except Data Status and Total Bytes Provisioned, are cumulative for the specified time period. The time period is specified by entering a start and end date and data on both the start and end date is included in the calculation. Total Bytes Provisioned shows the storage space provisioned to a host group. It is the sum, in bytes, of the sizes of all virtual disks served to the host group. The Total Bytes Provisioned statistic is not cumulative, so the amount of provisioned space is shown for the time period during which it was valid.

The Data Usage report provides total statistics for one or more selected host groups during a time period specified by start and end date.

The Detailed Data Usage report provides the same statistics for one selected host group. All statistics are provided on an hourly basis.

Data can be provided in the reports for up to one year as long as it has been recorded and still exists in the database. The report data can be exported in several formats including CSV and XLS. This data can then be imported into billing systems in order to charge back customers. See Reports for more detailed information about these reports.

  • Since performance counters are added for this feature to function, a performance recording server must be configured. If a recording server is not already configured, it can be configured when the feature is enabled.
  • Always use a remote SQL server running Microsoft SQL Server to record data that will be used to charge back customers. A local SQL server (running SQL Server Express on a DataCore Server) should only be used for temporary demonstration purposes. See Recorded Performance for important information about configuring a recording server, as well as instructions for changing the recording server if necessary.
  • Recorded data for a host group cannot be reported after that host group is deleted from the configuration. Do not delete host groups unless recorded data is no longer needed.

  • When Charge Back is disabled for a host group, all counters used for charge back are removed from the recording session, regardless of whether they were being recorded for purposes other than charge back. Those counters must be manually added again to the recording session if they need to be recorded for other purposes.
  • The Charge Back feature is not available for VMware hosts discovered through the VMware vCenter Integration feature.

Enabling or Disabling Charge Back

To enable charge back:

  1. Open the Host Details page for the host group.
  2. In the Settings tab, select the Charge Back Enabled check box.
  3. If the recording server is not configured, the Performance Recording Settings area will appear to configure it.
    1. Select Remote SQL Server. (Only select Local SQL Server for temporary demonstration purposes.)
      1. In Remote server, enter the hostname and server instance name of the remote SQL Server. (For example, hostname\SQL Server instance name)
      2. In Database name, enter the name of the database in which to store the recorded data. If the database does not exist, it will be created on the remote server.
      3. To use Windows login credentials to authenticate, enable the Use Windows Authentication check box.

        The credentials must be configured on the remote SQL Server.

        or

      4. To use the SQL Server credentials for authentication, clear the Use Windows Authentication check box and enter the Username and Password configured for the SQL Server login.
    2. Click Test Connection. The status of the connection will be displayed in the box.

      During the test, the status will read:

      CONNECTING...

      A successful connection status is:

      === CONNECTION ESTABLISHED! ===

      If the test completes and the status is "connection failed", check the network connection or ensure proper name resolution exists.

    3. Click Apply. The performance counters required for the Charge Back feature will be added and recording session will be started.

Disable Charge Back

  1. Open the Host Details page for the host group .
  2. In the Settings tab, clear the Charge Back Enabled check box.
  3. Click Apply. The counters added for charge back will be removed from the recording session.

Exporting Data Usage Reports

Generate and export charge back reports using a PowerShell script that collects host group I/O statistics for a defined period. Reports can be scheduled or run manually, and saved in various formats for billing or analysis.

About the Script File

A Windows PowerShell script file named Export-DcsDataUsageReport.ps1 is included in the DataCore SANsymphony installation folder (default path C:\Program Files\DataCore\SANsymphony) to facilitate exporting data usage statistics for host groups in order to charge back the costs of storage-related expenses to customers. The script can be run in an automated task to create and export data usage and detailed data usage reports for scheduled times when the statistics are needed for billing. The script can also be run from a PowerShell command line. The script uses the PowerShell cmdlet Export-DcsReport, which is included in the suite of DataCore Cmdlets, see Getting Started with DataCore Cmdlets.

The script connects to the local server and passes the specified parameters (below) to create and export either a Data Usage or Detailed Data Usage report. The task is run on locally on the DataCore Server from where it is run. The report will be saved on the same DataCore Server.

To run the script in a task, a task must be created:

  • The trigger can be of any type, but to create the reports based on a scheduled date and time, the trigger type should be a Scheduled Time trigger.
  • The action should be configured to Run a PowerShell Script. See the Task Parameters section for descriptions, syntax, and examples.

Charge back must be enabled for host groups and data must exist in the database in order to receive data in the reports.

Script Parameters

The script uses different parameters from those used to create and export reports with the Export-DcsReport cmdlet in PowerShell.

The parameter set to create the Data Usage or Detailed Data Usage report:

Export-DcsReport -

Do not select the Append the associated Task Trigger Data objects check box when creating the action, trigger states are not used with this script.

Parameter Descriptions

Parameter Description

ReportName

The name of the report.

Description

The description of the report.

ExportType

The format of the report. Possible parameter values include "Csv", "Html", "Mht", "Pdf", "Rtf", "Text", "Xls", "Xlsx", "Bmp", "Gif", "Jpeg" or "Png".

Path

The path where the report should be saved. The report will be saved on the computer that invokes this cmdlet. Specify the path to an existing folder. For example, to save the report to an existing folder on the C: drive named Reports, the path would be "C:\Reports\". To save the report directly to the C: drive, the path would be "C:\".

HostGroup

Filtering parameter used to specify host group names, supplied in an array of strings separated by commas.

The Data Usage report can be exported with one or more host group names. For example, "Host Group 1", "Host Group 2", "Host Group 3". If this parameter is specified for the Data Usage report, only data for those host groups will be included in the report. If the parameter is not specified, data for all host groups in the local server group will be included in the report.

The Detailed Data Usage report provides data for one host group and that name must be specified. More than one host group is not supported for this report.

DaysBack

The number of days proceeding the current day that the report data should begin. This would represent the start date of the report. The end date would be the day before the report is run (EndDate = Today-1).

SortBy

Sort order criteria. Specify this parameter to sort the report by the designated value.

For Data Usage report, possible values include "HostGroupName", "

The Detailed Data Usage cannot be sorted.

Detailed

Specify this parameter to create a Detailed Data Usage Report. If this parameter is not included in the invocation, the Data Usage report will be created.

DescendingOrder

Specify this parameter to sort the report in descending order. If this parameter is not included in the invocation, the report will be sorted in ascending order.

AddDateToFileName

Specify this parameter to append the creation date of the report to the beginning of the report name. The date is in the format year.month.day, for example: 2014.10.31 Data Usage for All

Script Parameter Examples

To create a Data Usage report for all host groups:

-ReportName "Data Usage for All Host Groups" -Description "Charge back statistics for all host groups for the month" -

At the configured scheduled time, the report named "Data Usage for All Host Groups" will be created in comma separated value format and saved to the path "C:\Reports\Data Usage for All Host Groups 10/31/14.csv". The creation date (10/31/14) of the report in appended to the name. Since the

To create a Data Usage report for more than one host group:

-ReportName "Data Usage for Area 1" -Description "Monthly charge back statistics for all host groups in Area 1" -

At the configured scheduled time, the report named "Data Usage for Area 1" will be created in a text file and saved to the path "C:\Reports\Data Usage for Area 1.txt". Data for the host groups named "Host Group 1", "Host Group 2", and "Host Group 3" for the last 30 days will be included in the report. Since the parameter

To create a Detailed Usage report for a specified host group:

-ReportName "Detailed Data Usage for Host Group 1" -Description "Detailed charge back statistics for Host Group 1 for the month" -ExportType xls -Path "C:\Reports\" -HostGroup "Host Group 1" -DaysBack 14 -SortBy "HostGroupName"

At the configured scheduled time, the report named "Detailed Data Usage for Host Group 1" will be created in an Excel spreadsheet format and saved to the path "C:\Reports\Detailed Data Usage for Host Group 1.xls". Detailed data for the host group named "Host Group 1" for the last seven days will be included in the report. Since the parameter.

Learn More