VMware Cloud Community
GawinD
Contributor
Contributor

vCloud API: Limit IOPs per VM

I would like to limit the IOPs for a disk of a VM based on the VM configuration (combination of CPU/RAM).

To achieve this, I am thinking about combining the vCloud RESTful API and the vSphere SOAP API (since vSphere has no RESTful interface).
The vSphere API should allow me to set the IOPS limit using SIOC (Storage I/O Control).
Steps:
1. Get every VM via the vCloud API using a query.
2. For every VM, get the disks.
3. Set the IOPs limit on every disk via the vSphere SOAP API, based on the VM configuration.
To further optimize this, I am thinking about only setting the IOPs after the disk is created or modified.
Unfortunately vCloud Director has no hooks/callbacks, so I guess I have to run a cronjob every x minutes.
Are there any other options?
0 Kudos
3 Replies
cfor
Expert
Expert

VCloud has the AMQP event tasks you might be able to us. This would let you know when a vApp was instantiate or deployed.  That might let you trigger a little better that just on a timer.

Also a warning - I did a similar thing, but for changing some reservation values while systems were online - it worked - however vCloud will show a "System Alert" on every VM - and vApp - that gets a change done via the vSphere API.  This is a warning that something outside of the vCloud control was changed.  To clear these I just did a vCloud database update, but it was something extra I had to do so my users would not see all the "errors."

Just as a side question - would using storage profiles do what you need?  (I know they are not in vCloud director right now...)

ChrisF (VCP4, VCP5, VCP-Cloud) - If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
GawinD
Contributor
Contributor

I wasn't aware of the AMQP abilities of vCloud, that sure sounds like a interesting direction to investigate.

Do storage profiles allow you to set IOPs limits?
And if so, how could I apply a storage profile after a vApp was instantiated or deployed? (Using the vSphere SOAP API?)
0 Kudos
lamw
Community Manager
Community Manager

AMPQ is definitely a possiblity but you could also just create a vSphere alarm which is triggered upon a VM deployment and automatically run a script which sets a particluar IOP limit. You would of course want to validate this works but this can also provide you a way without having to relate both enviornments and just have it automated for you.

0 Kudos