Due to licensing limitations internally we’re looking at a method to limit the number of powered on VMs by user, i.e. we enforce a limit of 4 running Windows VMs for a user and if they provision a new instance it’ll power the oldest VM off, email, or some other action.
At first I thought this would be a perfect job for a control policy but i’m a little confused as to how I can get the policy to count VMs on a user basis. Would anyone be able to provide any guidance? I know this can be easily achieved with a external script via the API but ideally i’d like it all to be in system if possible.