If you use the vSphere UI to configure individual virtual disk I/O shares or limits for a Virtual Machine, it looks like this functionality has been removed in vSphere 8.x in favor of using VM Storage Policies, which has been around for almost a decade now.
Prior to vSphere 8.x, you could configure both disk shares and limits on an individual VMDK as shown in this screenshot below for a vSphere 7.x environment:
While this capability can be useful, it does come with some operational overhead of having to configure each and every virtual disk that has such a requirement and can certainly be error prone. Fortunately, this problem of defining various storage requirements and attributes for a VM and its virtual disks has already been solved with Storage Policy Based Management (SPBM) and the use of VM Storage Policies.
As early as vSphere 6.5, Storage Policy Components can be used to define both encryption and Storage I/O Control (SIOC) requirements
which can then be consumed when constructing a VM Storage Policy by enabling host based services and then selecting the specific storage policy component profile.
While VM Storage Policy is the preferred way to manage these SIOC requirements on a per-VMDK basis, it looks like the underlying vSphere API for managing these configurations can still be used in vSphere 8.x for those interested in managing this outside of VM Storage Policies, especially for unmanaged ESXi hosts without vCenter Server.
If you have an unmanaged ESXi host, the ESXi Host Client can be used to configure both shares and limits for a specific virtual disk. If the ESXi host is managed, then these settings can not be modified without going through vCenter Server.
If you still wish to manage the SIOC configurations on an VM basis, you can use the StorageIOAllocationInfo vSphere API property on a virtual disk is and here is a quick PowerCLI snippet that demonstrates using the vSphere API to configure a limit for a virtual disk with the label "Hard disk 2" as an example.
$vmName = "Tanzu-Sources-for-Knative-VM-Test" $vmDiskName = "Hard disk 2" $diskLimit = 1000 ### DO NOT EDIT BEYOND HERE ### $vm = Get-VM $vmName $disk = ($vm | Get-HardDisk) | where {$_.Name -eq $vmDiskName} $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $spec.DeviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec[] (1) $spec.DeviceChange[0] = New-Object VMware.Vim.VirtualDeviceConfigSpec $spec.DeviceChange[0].Device = $disk.ExtensionData $spec.DeviceChange[0].Device.Key = $disk.ExtensionData.key $spec.DeviceChange[0].Device.UnitNumber = $disk.ExtensionData.UnitNumber $spec.DeviceChange[0].Device.ControllerKey = $disk.ExtensionData.ControllerKey $spec.DeviceChange[0].Device.Backing = $disk.ExtensionData.Backing $spec.DeviceChange[0].Device.StorageIOAllocation = $disk.ExtensionData.StorageIOAllocation $spec.DeviceChange[0].Device.StorageIOAllocation.Limit = $diskLimit $spec.DeviceChange[0].Operation = 'edit' # Required in vSphere 8.0 Update 1 and later if($global:DefaultVIServer.ExtensionData.Content.About.Version -gt "8.0.0") { $spec.VirtualNuma = New-Object VMware.Vim.VirtualMachineVirtualNuma } $vm.ExtensionData.ReconfigVM_Task($spec)
Here screenshot of the output after running the following snippet:
We can then verify that limit has been set for the specific virtual disk by now running the following command:
(Get-VM $vmName | Get-HardDisk | where {$_.Name -eq $vmDiskName}).ExtensionData.StorageIOAllocation.Limit
Here screenshot of the output after running the following command:
Claus Nielsen says
Nice, but will the feature also be there in the next version?
David Pasek says
Hi William,
first of all, thanks for very valuable information and PowerCLI snippet.
Now the question ... do you know or can you ask product management or engineering if vSphere API property StorageIOAllocationInfo will stay in the future versions of vSphere and mclock scheduler I/O limits will work? We are IaaS cloud provider providing VMs with vDisks and we are billing by disk capacity and performance (GB/IOPS). We are developing our own Cloud Management Platform which sets VM IOPS limits (mclock scheduler limits) to each particular vDisk based on disk capacity as we know GB/IOPS ratio. Therefore, VM IOPS limit is very important feature for as. We use it almost 13 years. Unfortunately, SPBM IOPS limits (I/O Filter limits) are not scalable for us because at the moment every vDisk can have different limit and we cannot imagine we would create Storage policy for each vDisk in vCenter inventory.
In vSphere 7 Update 3 Release notes is following statement
Deprecation of Shares and Limit – IOPS fields in the virtual machine Edit Settings dialog: Starting from vCenter Server 7.0 Update 3, the use of Shares and Limit – IOPS fields in the virtual machine Edit Settings dialog is deprecated, because all I/O settings are only defined by using a storage policy. In a future vSphere release, the two fields are planned to be removed from the virtual machine Edit Settings dialog.
The statement is only about GUI (Edit Settings dialog) and not about API.
On the other hand, when I read KB Article 313242 at
https://knowledge.broadcom.com/external/article/313242/changing-an-existing-inputoutput-operati.html
it seems to me that there can be some problems with mclock scheduler IOPS limits which might be the reason to remove vDisk IOPS limit from GUI.
If there are some problems with I/O limiting in mclock scheduler, setting vDisk (mclock) IOPS limits via API would not be the right solution for the future.
Any answer is highly appreciated.