Home » PowerShell Tips » New-VMResourcePool – Create Resource Pool

New-VMResourcePool – Create Resource Pool

New-VMResourcePool cmdlet in PowerShell is used to create a resource pool for measuring memory usage. It’s available in the Hyper-V module. To measure pool usage use Measure-VMResourcePool cmdlet in PowerShell to measure processor usage, memory usage, disk capacity, and network traffic for one or more virtual machine resource pools.

In this blog post, we will learn how to use the New-VMResourcePool cmdlet to create a virtual machine resource pool that is used to measure the monitoring and reporting of the usage of resources.

New-VMResourcePool Syntax

New-VMResourcePool cmdlet in PowerShell is used to create a virtual machine resource pool.

Syntax

New-VMResourcePool
   [-Name] <String>
   [-ResourcePoolType] <VMResourcePoolType[]>
   [[-ParentName] <String[]>]
   [[-Paths] <String[]>]
   [-CimSession <CimSession[]>]
   [-ComputerName <String[]>]
   [-Credential <PSCredential[]>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Parameters:

ComputerName:- Specifies one or more Hyper-V hosts on which the resources pool to be created. Default is the local computer.

Name: Specify the name of the resource pool

ParentName: Specify the parent resource pool name for the new resource pool.

ResourcePoolType: Specify the resource type of resource pool. Accepted resource pool types are Memory, Processor, VHD, Ethernet, ISO, VFD, FibreChannelPort, FibreChannelConnection, and Pci-Express.

Create Virtual Machine Resource Pool

Using New-VMResourcePool cmdlet in PowerShell to create virtual machine resource pool as below

New-VMResourcePool "AzureTestVM" VHD -Paths C:\Users\Public\Documents\Hyper-V\Virtual hard disks

It creates a virtual hard disk resource pool associated with a specified path.

The output of the above command as below

Create VM Resource Pool
Create a VM Resource Pool

Create Resource Pool for Multiple Paths

Use the below command to create a resource pool for multiple paths using the New-VMResourcePool cmdlet in PowerShell

New-VMResourcePool "VMTestpool" VHD  -Paths "C:\VHDs","D:\VM\"

In the above PowerShell script, the New-VMResourcePool cmdlet creates a virtual hard disk (VHD) resource pool associated with multiple paths specified by the Paths parameter.

Cool Tip: How to start the virtual machine using PowerShell!

Create EtherNet Resource Pool

To create an ethernet resource pool, use the below command

New-VMResourcePool "VMTestPool" Ethernet

In the above PowerShell script, it creates an Ethernet resource pool.

Conclusion

I hope the above quick post on using New-VMResourcePool to create a virtual machine resource pool to monitor the usage of the resource pool is helpful.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.