In hybrid cloud environments, you might have different scenarios for each department, location, business unit, or even client in the case of service providers. One of the benefits a cloud can offer is the ability to measure and bill your clients based on the current consumption of services. Tracking utilization for these resources can be difficult and complex and requires proper applications and systems.
Hyper-V makes that simple with Resource Metering. This allows you to track and measure the current usage for virtual machines and resources pools, helping the IT department to bill clients based on the usage of cloud resources.
These are some examples of metrics that can be collected with Resource Metering:
With Resource Metering, companies can implement advanced billing strategies, creating a cost-effective way to track resource utilization, based on virtual machines and resource pools.
You will see in this recipe how Resource Metering can be enabled for virtual machines and resource pools and how to extract its results.
Although it is not configured by default, Resource Metering can be enabled on every virtual machine in Windows Server 2012 and higher versions using PowerShell. Make sure you have a PowerShell console opened as administrator before you begin.
The following steps will walk you through the Resource Metering PowerShell commandlets.
Enable-VMResourceMetering –VMName *
Enable-VMResourceMetering –VMName 2012R2
Get-VM * | Format-List Name,ResourceMeteringEnabled
Primordial
and the resource pool type to Memory:Enable-VMResourceMetering –ResourcePoolName Primordial–ResourcePoolType Memory
Measure-VMResourcePool
, as shown in the following screenshot:Reset-VMResourceMetering
to reset the resource utilization data collected by Resource Metering. The following command shows how to reset the data for a virtual machine called 2012R2
:Reset-VMResourceMetering –VMName 2012R2
Disable-VMResourceMetering
command. The following command shows how to disable Resource Metering for a virtual machine called 2012R2
:Disable-VMResourceMetering –VMName 2012R2
Although there is no graphical interface to configure it, Resource Metering is quite easy to manage using PowerShell. The commands let you enable, measure, reset, and disable the counters for virtual machines and resource pools. It is also easy to create reports with measurement outputs using the output values to create advanced methods to charge your clients based on utilization of resources.
The four resources that can be monitored on a VM are processor (in megahertz) and memory, network, and disk (in megabytes).
The results can be collected and reset at any time, helping you to measure the virtual machine or resource pool usage based on your company's needs.
Now, with resource utilization details, you can create your billing system or simply track the resource information from your virtual machines and resource pools.
3.147.61.142