• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Custom shares on a Resource Pool, scripted

Duncan Epping · Feb 24, 2010 ·

We’ve spoken about Resource Pools a couple of times over the last months and specifically about shares. (The Resource Pool Priority-Pie Paradox, Resource Pools and Shares.) The common question I received was how can we solve this. The solution is simple: Custom Shares.

However, the operational overhead associated with custom shares is something most people want to avoid. Luckily for those who have the requirement to use share based resource pools one my colleague Andrew Mitchell shared a powershell script. This powershell script defines custom shares based on a pre-defined weight and the amount of VMs / vCPUs in the resource pool. I would recommend to schedule the script to run on a weekly basis and ensure the correct amount of shares have been set to avoid running into one of the scenarios described in the articles above.

Please keep in mind that if you use nested resource pools you will need to run a separate script for each level in the hierarchy.

Eg. If the resource pools are setup like this the following you will need one script to set the shares for RP1, RP2 and RP3, and another script to set the shares for RP1-Child1 and RP1-Child2.

RP1
>>RP1-Child1
>>RP1-Child2
RP2
RP3

Download the script here. Again to emphasize it I am not the author, we would appreciate it though if you could share any modifications / enhancements to this script.

Related

Management & Automation, Server drs, ESX, esxi, resource pools, vSphere

Reader Interactions

Comments

  1. Andrew Mitchell says

    25 February, 2010 at 07:27

    Thanks for putting this up Duncan. Although I’ve tested it thoroughly, if anyone tries this script and finds a problem with it please let me know via twitter (@amitchell01)

  2. Horst Mundt says

    25 February, 2010 at 21:46

    Thanks Andrew and Duncan, comes very handy. Just went through the exercise of adjusting RP shares with some customers. Not really looking forward to doing it manually again.
    May I suggest an adjustment?
    The script sets an upper limit of 8000 for the shares that are granted to the highest priority resource pool. Now if somebody creates a new resource pool with default settings, that resource pool will get 4000 shares. So until the script runs again, there will be a (probably not desired) imbalance.
    That’s why I suggested to my customers to give their really important resource pools a higher share value (say 80.000 instead of 8.000). Just to make sure that their resource planning is not overly sensitive to “default values”.

  3. Doug Youd says

    17 December, 2010 at 06:26

    Thanks for this, was just thinking of writing something myself…. but beaten to it.

    Nice and clean, except one type-oh.

    $MinPoolCPUshares = 100
    $MinPoolMemShare = 100

    Should be:
    $MinPoolCPUshares = 100
    $MinPoolMemShares = 100

    Was wondering why my that wasn’t applying properly, logic looked sound…. simple things are so easy to miss.

    🙂

  4. Doug Youd says

    21 December, 2010 at 01:52

    Hi Duncan / Andrew,

    It’s a bit late… but I made some modifications to suit my environment that I thought might be helpful to others.

    My modified version is available Here

    Hopefully it’s of some help to others.
    -Doug

  5. Manish Patel says

    29 August, 2011 at 21:31

    Hi Doug,

    Pl check the location of your modified script as its not working. I can highlight “Here” but not actually linked to anything.

  6. Loren Gordon says

    15 September, 2011 at 23:04

    I modified this script (with Doug’s edits) so it would set custom shares on child resource pools and vApps. Let me know if you’re interested and I’ll send it to you (loren)@(fleet-it.com).

Primary Sidebar

About the author

Duncan Epping is a Chief Technologist in the Office of CTO of the Cloud Platform BU at VMware. He is a VCDX (# 007), the author of the "vSAN Deep Dive", the “vSphere Clustering Technical Deep Dive” series, and the host of the "Unexplored Territory" podcast.

Upcoming Events

May 24th – VMUG Poland
Aug 21st – VMware Explore
Sep 20th – VMUG DK
Nov 6th – VMware Explore
Dec 7th – Swiss German VMUG

Recommended Reads

Sponsors

Want to support Yellow-Bricks? Buy an advert!

Advertisements

Copyright Yellow-Bricks.com © 2023 · Log in