The list of all the Resource Pools that are part of a group of ESXi

Hello

I'm trying to get a piece of code work that will list all the resource pools that are present in a cluster of ESXi.

  • I know I can find what list of resources of a virtual machine resides in.  I don't want that.

// Find a matching resource pool on an ESXi hosts
  var esxiCluster = esxiHost.parent;
  var esxiClusterResourcePools = esxiCluster.resourcePool_ResourcePool;


  System.log("what is the ESXi cluster: " + esxiCluster.name);
  System.log("vimtype: " + esxiCluster.vimType);
  System.log("what pools exists: " + esxiClusterResourcePools);

So I know that the vimType will come back with what I expect (ClusterComputeResource).  The question I have is the object "resourcePool" is reference to the root resource list (in my case, it is 'resources').

What I want is all DRS resource pools are configured.  I need something like "resourcePool_ResourcePool.children".

Any help is appreciated.

Thank you

B

Hello

Check if this code example that works in your case:

var esxiCluster = esxiHost.parent;
var esxiClusterResourcePools = esxiCluster.resourcePool_ResourcePool;
var pools = System.getModule("com.vmware.library.vc.resourcePool").getAllChildResourcePool(esxiClusterResourcePools);

// dump names of child pools
for each (var pool in pools) {
  System.log(pool.name);
}

Tags: VMware

Similar Questions

  • Backup feature of virtual machine for the virtual machines that are part of a paralytic

    In the powerclibook I found the backup-vm very useful function (Chapter 10)

    I do not post the direct link to the function because I don't know if this is allowed.

    You will find the function if you follow http://www.powerclibook.com/

    I wonder if this could be changed to backup vms several that are part of a paralytic.

    Thanks for help.

    concerning

    Andreas

    Hi Andreas, no problem mentioning the link since we already published as well in our PowerCLI book: download Scripts, functions and Modules post.

    Regarding your question, you can try something like this

    Get-VM-location (Get-VAPP-name MyvApp). %{

    Backup-VM - VM $_ - Datastore (Get-data store MyDS

    )

  • I am currently using Firefox in 3.6.27. I want to be updated, but not to "the last and best." How can I view a list of all versions of Firefox that are always available, choose the one I want and download it?

    Does not apply.

    In addition, with the new quick release cycle, the update process has changed. For example, the firefox 8 which was released several months ago is the same 8 Firefox there today. For some releases there maybe an update minor to fix one or two issues, but usually known bugs has waited until the next version which will be fixed. (Example, if a bug was in Firefox 5, it was not set up to 6, etc..). So unlike before, when you could run Firefox 3.5.x for looking after 3.6 was released, and the old version have always updated, this story has changed now.

    There is a downgrade of Firefox 3.6, which was left to the organizations until we found a strategy to support. Something that you might be interested in is the Extended Support Release of Firefox. At present, it is based on firefox 10 and you will receive minor updates for a year, then is upgraded to a version not (for example, next year it will probably be Firefox 17) If you want something that isn't to change that but always has the most recent security patches.

    http://www.Mozilla.org/en-us/Firefox/organizations/

  • Get the resource pool structure

    Hello

    I try to get the VMS in our resource pools. We have a pool of resources like this structure:

    Ministere1

    -


    Dev

    -


    Level 1

    -


    Level 2

    -


    Prod

    -


    Level 1

    -


    Level 2

    Department2

    -


    Dev

    -


    Level 1

    -


    Level 2

    -


    Prod

    -


    Level 1

    -


    Level 2

    Running get-resourcepools the output is like this:

    ID name

    =====================

    Resources ResourcePool-resgroup-8

    Tier1 ResourcePool-resgroup-1011

    Level 2 ResourcePool-resgroup-1012

    Ministere1 ResourcePool-resgroup-305

    Prod ResourcePool-resgroup-306

    Tier1 ResourcePool-resgroup-307

    Level 2 ResourcePool-resgroup-308

    Department2 ResourcePool-resgroup-291

    Level 2 ResourcePool-resgroup-770

    Prod ResourcePool-resgroup-294

    Tier1 ResourcePool-resgroup-296

    Level 2 ResourcePool-resgroup-297

    dev ResourcePool-resgroup-767

    dev ResourcePool-resgroup-759

    Tier1 ResourcePool-resgroup-769

    If I get the virtual machines on each resourcepool in the list above, I'd be unable to distinguish if Tier1 is from the branch of a branch of Department2\Prod or Department1\Dev.

    How can I get that information, that is to say, the 'level 1' resourcepool (ResourcePool-resgroup-296) is in which parent resource group.

    Thank you

    Chi

    There are 2 things to consider before attack us the script.

    (1) resource pools can be created in 2 different locations, under a Cluster and a standalone host

    (2) in the vSphere environment, there are some hidden files. One of them is the pool of resources of the parent 'resources '.

    You can find this file under each group and each stand-alone host.

    The script uses a function called Get-RpPath, which makes it much easier to recursively down the structure of resource pool

    The script now prints the hidden folder "Resources" as the beginning but this can be replaced by the name of the cluster or standalone host just above.

    The script begins with the collection of all of the 'Resources' folders that are hidden in your vSphere environment and recursively then descends from the quest of sub-resourcepools.

    $indent = 4
    
    function Get-RpPath{
         param($rp, $level)
    
         Write-Host ($rp.Name).PadLeft($level + $rp.Name.Length, "-")
         foreach($child in $rp.ChildConfiguration){
              $nrp = Get-View -Id $child.Entity
              if($nrp.GetType().Name -eq "ResourcePool"){
                   Get-RpPath $nrp ($level + $indent)
              }
         }
    }
    
    $clusters = Get-Cluster
    $hosts = Get-VMHost | where {-not ($_.ParentId -like "Cluster*")}
    
    $RProot = $clusters | % {
         Get-Inventory -NoRecursion -Location $_ | where {$_.gettype().Name -eq "ResourcePoolImpl"}
    }
    $RProot += ($hosts | % {
         Get-Inventory -NoRecursion -Location $_ | where {$_.gettype().Name -eq "ResourcePoolImpl"}
    })
    
    $RProot | Get-View | % {
         Get-RpPath $_ 0
    }
    
  • 'Custom actions' of the CPU in the Resource Pools: should I also set the VMs child on "custom"?

    Hello world

    Imagine a VMware vSphere 4.1 cluster managed, of course, by vCenter Server, with some 4.1 ESXi hosts.

    This cluster has 3 Pools of resources: development, Production, quality

    Now consider that the Resource Pools have been initially implemented in the following way, about the 'actions' for 'CPU resources':

    -Development: Shared low =

    -Quality: Sharing = Medium

    -Production: Sharing high =

    Several virtual machines were placed in the Resource Pools. Some virtual machines are single vCPU, but others are vSMP ones: some have 2 vCPU and some of them have 4 vCPU.

    Now, I read the following articles of the (large) put at disposal by Duncan Epping, VMware, in his blog "Yellow brick", on "Resource Pools" and actions:

    The Resource Pool priority-Pie Paradox - yellow bricks [written by Craig Risinger]

    Actions on Resource Pools

    http://www.yellow-bricks.com/2010/12/14/shares-set-on-resource-pools/

    Actions on a Resource Pool, custom scripted

    http://www.yellow-bricks.com/2010/02/24/custom-shares-on-a-resource-pools-scripted/

    Now, imagine that I have manually changed several Pools of resources from low/normal/high "Custom" and gave them the following values:

    -Development: 3000

    -Quality: 6000

    -Production: 9000

    The virtual machines inside each Resource Pool appear to be all set up to 'Actions' = 'Normal '.

    I want to know is this:

    1 - since I changed Resource Pool shares 'Low' / 'Normal' / 'High' to 'Custom', I should / need to change the 'actions' in each individual VM from "Normal" to "Custom"?

    2 - I'm guessing that the sum of the actions of all virtual machines in a Resource Pool must be equal to the actions that I gave to this Pool of resources. Am I wrong?

    3 - I also guess that the only practical way to make this change to Virtual PCs, if necessary, is to generate scripts, preferably using PowerCLI. Friend, I have right?

    Thanks in advance!

    See you soon,.

    Ricardo

    Whatever resources the resource pool level are applicable to this pool of resources and will get the part accordingly. So that resources will be divided between the virtual machines according to the shares they hold.

    Example:-two pool of resources A and B.

    Total cycles CPU = 10000 Cycles CPU

    A part (custom set) = 6000 CPU Cycle.

    Part B (custom set) = Cycle CPU 4000.

    Now a resource pool has three virtual machines powered with shares.so high normal and low on this desire to cycles CPU 6000 cases divided among them in 4:2:1

    VM1 have = 4 * 6000/7 = 3428 cycles cpu.

    VM2 will get = 2 * 6000/7 = 1714 cycles cpu.

    Vm3 will get = 1 * 6000/7 = 857 cycles cpu.

    so according to your requirement, you can change your actions at the level of the virtual machine.

    PS:shares come into picture when there is a conflict.

    HTH

  • CloneVM_Task fails on the resource pool when cloning tempalte

    I'm trying to use the CloneVM_Task to clone a template, but it keeps failing because no resource pool.  We have a cluster with no pool DRS/HA or resources configuration, we use the cluster for the VCA mode.

    I have a reference to the host server, but I don't know what is needed for the pool of resources, given that we have not one.

    While

    cloning a virtual machine from a template, the resource pool is a required parameter.

    It specifies the resource pool that this virtual machine should be attached.

    Incase you do not have a resourcePool hierarchy, you must specify the root

    resourcePool 'Resources' as a resourcePool. It's the resourcePool

    managed your ComputeResource object. A ComputeResource always has a root

    ResourcePool associated with him.

  • Good candidates for the resource pools?

    Hi, I do not currently use resource pools, but often the impression that I should watch more in him.  We have our four node 5.1 cluster 16 web servers (among others in the virtual computer) that are exactly the same and serve the same function.  I was wondering if those who would be good candidates to be added to a pool of resources, so they can take resources needed?  I tend to approve statically the RAM and CPU on these "just in case", but maybe it's stupid, if there is a better way.  Thank you.

    Also consider that if you have no compelling reason to prioritize resources for all virtual machines on one of the virtual computer, then you really don't have a reason to use the resource to all pools.  In this case, each virtual computer will be given some memory he needs on demand, DRS will balance the load between the hosts if a host is out of balance, and there will be fairness when ESXi pray return of VMs pages when there is a conflict.

    Discover the vSphere resources management Guide, you will find everything you always wanted to know about the Pools of resources and any other topic of management resources in general.

    http://pubs.VMware.com/vSphere-51/topic/com.VMware.ICbase/PDF/vSphere-ESXi-vCenter-Server-51-Resource-Management-Guide.PDF

  • How to calculate the cpu in the resource pool

    How to calculate the cpu in the resource pool

    and don't forget that shares in pools of resources are not inherited by the virtual machines in the pools. the action is related to the pool itself.

  • Understanding of the resource pools

    I thought I knew pools of resources but realize that my interpretation is wrong and despite reading the documentation and navigation

    messages on this site, I'm still confused and hoping someone can help.

    I thought that:

    1. set up a reserve of 256 MB of Ram on a pool of resources means that each virtual machine has been awarded to a minimum of 256 MB of RAM and that if this

    was not available, then the VM not illuminate.

    2. If the limit has been set to unlimited (or even a limit capped to say 90% of the available RAM) a VM would use more RAM if needed.

    3. the allocation of memory in the definition of a virtual machine in the settings was not relevant because the vm used as much ram has been defined by the resource pool.

    However, I can see my graphics that some virtual machines, while using very little memory, resemble the memory is limited.

    What I mean is that when I look at vcentre: resource - VMS-> guest mem % pool. I see a percentage high and in some cases

    the bar indicator changes from green to yellow. I do not know what threshold is reached - possibly the amount of RAM allocated to the VM in its

    configuration settigs.

    So should I do the following:

    1 build a virtual machine and to allocate as much RAM as I think that the VM needs

    2. set the memory reserve on a pool of resources as being the sum of which has been attributed to each virtual machine

    3 or the reservation to be what I think, that each virtual machine will usually use the value

    4. If done correctly, then vms uses more memory in the limits imposed.

    Is none of this?

    TAM

    1 build a virtual machine and to allocate as much RAM as I think that the VM needs

    Of course, it is better to give more ram and maybe avoid swapping

    2. set the reserve memory on a pool of resources as being the sum of what

    have been allocated to each virtual machine

    Of course, you can, it depends on if you have too many commissioning

    3 or the reservation to be what I think, that each virtual machine will usually use the value

    Resource pools have just two functions restrict or warranty. Constraint is that if you overprovised a virtual computer, you can stop hunger on the other

    VMS. Or guarantee the current host does not have enough resources both by the DRS vmotion virtual machine to another host

    4. If done correctly, then the vms uses more memory limits

    imposed.

    Yes about

  • All my iTunes music is on a disk hard Ext. connected to my home network through a router. Is it possible that devices that are part of my home network share iTunes can access the music on this disc hard Ext. without my laptop being on?

    All my iTunes music is on a disk hard Ext. connected to my home network through a router. Is it possible that devices that are part of my home network share iTunes can access the music on this disc hard Ext. without my laptop being on?

    Additional information: the laptop is what I used to install all the music, via iTunes, which is located on the external hard drive connected through home network router.

    Is it possible that devices that are part of my home network share iTunes can access the music on this disc hard Ext. without my laptop being on?

    Laughing out loud

  • How to delete a resource pool that is read-only?

    An admin on my server ESXi created a pool of test resources and inadvertanly everyone gave read access only.  Now, we can not assigned VM in the resource pool or never remove it.  All admin users have only contextual menus gray when you access that resource group.

    Is there way to delete a resource group or change its permissions to access again?

    If you have not removed from the local Administrators group - you may be able to a new local user of this group and access it that way - by default from the local Administrators group is given admin access to the upper level of the inventory.

    If you find this or any other answer useful please consider awarding points marking the answer correct or useful

  • Smart phone BlackBerry Smartphones does not meet the system requirements that are needed to support Blackberry App World

    Hello

    I just all new BB Curve 8900 on Vodafone. Its the first BB I've owned and I seem to have a bit of trouble. When I try to download the App World, I get the following error message:

    "Device does not meet the system requirements that are needed to support Blackberry App World"

    How can this be?

    OK then... interesting for Vodafone to push support far... Well, by I guess.

    So I guess that I change their instructions... rather than to remove an installed version of the AppWorld in the way they suggest, I suggest go to:

    Homescreen > Options > Advanced Options > Applications

    See if BB AppWorld is listed as installed. If so, highlight (but do not click) it and then press the BBKey and select Delete. If she wasn't there, then continue on these steps.

    Then do a batt pull reboot:

    With power ON, remove the hood back and remove the battery. Wait a minute, then replace the battery and cover. Power on and wait patiently through the long reboot - about 5 minutes.

    Then re - activate your THS:

    Homescreen > Options > Advanced Options > host Routing Table > BBKey > sign up now

    Then re - send all the service books:

    http://www.BlackBerry.com/BTSC/microsites/search.do?cmd=displayKC&docType=kc&externalId=KB02830&SLIC...

    Then do another reboot batt-pop.

    Then, get a new link for AppWorld from here:

    http://NA.BlackBerry.com/eng/services/appworld/download.jsp#tab_tab_download

    And re - download and install it.

    I hope it's going to go right. If not, then it could still be useful a call to Vodafone...

    See you soon!

  • Tried to open the Excel spreadsheet in Sharepoint, but get the message "cannot open the window because it contains the following features that are not supported by Excel in the browser: sheet Protection.

    I tried to open this Excel spreadsheet in Sharepoint and received the following message.

    "Cannot open the window because it contains the following features that are not supported by Excel in the browser:

    -Protection plate

    You want to try to open the message in Excel? »

    Learn more about the unsupported features.

    YES                       NO

    When I type 'Yes', I had then the second message.

    "To open this workbook, your computer must have a version of Microsoft Excel is installed and your Web browser must support opening files directly from Excel in the browser".

    What should I do?

    Original title: sharepoint excel files

    Tommy:

    I have 64 bit explore.  So I guess that the thought is that the error message was generated by the incoming file, as I have other files Excel I can access in Sharepoint with no problem?  I sent the file Outlook e-mail and was able to open it with no problem at all.  .

    Thanks for the information,

    Jim

  • Script to replace the small caps that are typed in capital letters with capital letters (A = > a, B = > b, etc...)

    I am looking for a way to replace the small caps that are typed in capital letters by their normal equivalents.

    I have a text that contains many names that should all be set in small capitals.

    In fact, they are, but because the letters are used for the first letters that they don't fit.

    In short: I would like to be able to look for A, B, c... (in small capitals) and replace them with (a, b, c...) in small capitals only once.

    (compare two tables?-> is this possible in indesign scripting)

    Hi Cramik,

    Try this.

    var doc = app.activeDocument,
        _char = doc.stories.everyItem().characters.everyItem().getElements();
    
    for(var i=0;i<_char.length;i++)
    {
            if(_char[i].capitalization == Capitalization.SMALL_CAPS)
            {
                    _char[i].capitalization = Capitalization.CAP_TO_SMALL_CAP;
                }
        }
    

    Kind regards

    Cognet

  • How to find the library files that are not due to problems of indexing

    I need help to know how to find the library files that are not as a result of indexing problems?

    I use Windows 7

    Thank you

    Charlene

    Try to open the folder that the library uses directly.  For example, if it is your Documents folder, open C:\Users\Charlene\Documents

Maybe you are looking for

  • How can I activate the spell checker as a default?

    I was typing merrily along and noticed a typo in the fact that the fault of strike was NOT highlighted in red wavy underlines. Hmmmm, I thought. Tweak, I discovered an option on the right click that allowed me to turn on the spell checker. Now, whene

  • My Chase Bank statements will be open, but with the fox 3.6.17 will open statements

    Can not open my bank statement in Firefox with any update past 3.6.17. So I always reinstall the updated older so I can open my statement. It either that or go back to the Explorer for instructions to open. A complete waste of time since I have 5 Acc

  • This Epson Stylus D68 printer.

    Epson Stylus D68 printer. Of ink and recycles bin red lights flash alternately and the printer does not. Why?

  • can I get rid of msn today completely

    Hi I managed to get rid of the pop up I was wondering short to a firewall and blocking it how can I get rid of the news feed/RSS feed that chew up bandwidth msntoday I tried a lot of things in my blocking host file, but nothing helped and it bites my

  • How to add the listenter in a folder

    Hello friends, Please help me out by telling how can I add a file listener in any folder in flex. whenever a file is added to this file, I can get any event, which tells me that on the file, Exactly, I want to add the listener to record image in play