• No results found

Performance Statistics Script

The performance statistics script helps you obtain the average resource usage details for the virtual machines that are part of any hierarchy created in vCenter Chargeback Manager.

Running the Guest OS Licensing Script in SQL Server

You must have the SELECT permission on the tables in the vCenter Chargeback Manager database to run the guest OS licensing script.

On running the script, two database objects are created.

n The CB_VIEW_VC_STAT_INVENTORY database view.

n The CB_FN_VC_STAT_PAYG function.

The CB_VIEW_VC_STAT_INVENTORY view contains the average usage details of different resources for all the virtual

machines that are part of any hierarchy created in vCenter Chargeback Manager. Table 8-6 lists the details of the columns in the CB_VIEW_GOS_LICENSE_INVENTORY view.

Table 8-6. Column Details of the Performance Statistics Database View

Column Name Data Type Nullable Description

VM_NAME NVARCHAR2(255

CHAR) No Name of the virtual machine. VM_MOID NVARCHAR2(255

CHAR) No Managed Object ID of the virtual machine. VC_SERVER_UUI

Table 8-6. Column Details of the Performance Statistics Database View (Continued)

Column Name Data Type Nullable Description

HIERARCHY_NA

ME NVARCHAR2(255CHAR) No Name of the chargeback hierarchy in which the virtualmachine exists. RESOURCE_TYPE NVARCHAR2(255

CHAR) No The type of resource. For each virtual machine, the viewcontains at least nine rows, one each for the following resource types:

n Average CPU usage in MHz.

n Average memory consumed in KB.

n Average disk read and write in KB/s.

n Average disk read in KB/s.

n Average disk write in KB/s.

n Average network received and transmitted in KB/s.

n Average network received in KB/s.

n Average network transmitted in KB/s.

n Average storage usage in KB. RESOURCE_VAL

UE NUMBER No The value for the resource. START_TIME DATETIME Yes The start time for the resource type.

END_TIME DATETIME Yes The end time for the resource type or the end time of the virtual machine in the hierarchy, whichever is earlier. After the view is created, you can run SELECT queries on the view to obtain the necessary information.

Table 8-7 shows the sample output for a SELECT query on the CB_VIEW_VC_STAT_INVENTORY view.

Table 8-7. Sample Output for a SELECT Query on the CB_VIEW_VC_STAT_INVENTORY View

VM_NA ME VM_M OID VC_SERVER_U UID HIERARCHY_ NAME RESOURCE_TY PE RESOURCE_ VALUE START_ TIME END_TIM E VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0 DB Hierarchy 1 CPU 606 8/29/11 2:00 8/29/114:00 VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0 DB Hierarchy 1 Memory 2472619 8/29/11 2:00 8/29/114:00 VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0

DB Hierarchy 1 Disk Read and

Write 228 8/29/112:00 8/29/114:00 VM01 vm-444

2 7BF5FFD5-F56C-4205-808D- 329BB92636F0

DB Hierarchy 1 Disk Read 5 8/29/11

2:00 8/29/114:00 VM01 vm-444

2 7BF5FFD5-F56C-4205-808D- 329BB92636F0

DB Hierarchy 1 Disk Write 222 8/29/11

2:00 8/29/114:00 VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0 DB Hierarchy 1 Network Received and Transmitted 166 8/29/11 2:00 8/29/114:00 VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0 DB Hierarchy 1 Network Received 77 8/29/112:00 8/29/114:00

Table 8-7. Sample Output for a SELECT Query on the CB_VIEW_VC_STAT_INVENTORY View (Continued) VM_NA ME VM_M OID VC_SERVER_U UID HIERARCHY_ NAME RESOURCE_TY PE RESOURCE_ VALUE START_ TIME END_TIM E VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0 DB Hierarchy 1 Network Transmitted 87 8/29/112:00 8/29/114:00 VM01 vm-444 2 7BF5FFD5-F56C-4205-808D- 329BB92636F0 DB Hierarchy 1 Storage 4096 8/29/11 2:00 8/29/114:00

The CB_FN_VC_STAT_PAYG function returns the average usage details of different resources for all the virtual

machines in a given hierarchy in the Pay As You Go model. You must provide values for the following input parameters when running the function:

n hierarchy name: Name of the hierarchy for which the virtual machine details must be retrieved. n start time: The start time in the format YYYY-MM-DD hh:mm:ss:mls.

n end time: The end time in the format YYYY-MM-DD hh:mm:ss:mls.

For example,

SELECT * from CB_FN_VC_STAT_PAYG('Test Hierarchy', '2011-01-14 00:00:00.000', '2011-07-14 23:59:59.999');

The function returns values similar to the output of a SELECT query on the CB_VIEW_VC_STAT_INVENTORY database

view. However, in this case the data for only a given hierarchy and for a specific duration is returned. NOTE The CB_FN_VC_STAT_PAYG function assumes that all the virtual machines in vCenter Chargeback Manager

under the Pay as You Go model for any hierarchy organization is present under Pay as You Go >

Any_OrgVDC > vApps Folder > vApps.

Running the Guest OS Licensing Script in Oracle

You must have the SELECT permission on the tables in the vCenter Chargeback Manager database to run the guest OS licensing script.

On running the script, two database objects are created.

n The CB_VIEW_VC_STAT_INVENTORY database view.

n The CB_FN_VC_STAT_PAYG function.

The CB_VIEW_VC_STAT_INVENTORY view contains the average usage details of different resources for all the virtual

machines that are part of any hierarchy created in vCenter Chargeback Manager. The CB_FN_VC_STAT_PAYG

function returns the average usage details of different resources for all the virtual machines in the Pay As You Go model for a given hierarchy ($hierarchy_name) and for the specified time period ($start_time : $end_time). Table 8-6 lists the details of the columns in the CB_VIEW_VC_STAT_INVENTORY database view. The

CB_VIEW_VC_STAT_PAYG function returns values similar to the output of a SELECT query on the

CB_VIEW_VC_STAT_INVENTORY database view. However, in this case the data for only a given hierarchy and for

a specific duration is returned. For example,

SELECT * from TABLE(CB_FN_VC_STAT_PAYG('Test Hierarchy',to_timestamp('20110114 00:00:00', 'YYYYMMDD HH24:MI:SS'), to_timestamp('20110714 23:59:59', 'YYYYMMDD HH24:MI:SS')));

NOTE The CB_FN_VC_STAT_PAYG function is created based on the assumption that all the virtual machines in

vCenter Chargeback Manager under the Pay as You Go model for any hierarchy organization is present under Pay as You Go > Any_OrgVDC > vApps Folder > vApps.