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
}

Tags: VMware

Similar Questions

  • 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);
    }
    
  • '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

  • How get the resource group in the application model by local current-based program?

    Hi all


    We use JDeveloper Studio Edition Version 12.1.3.0.0 and deployed on GlassFish Server Open Source Edition 3.1.2.2 (build 5) and connect to the SQLServer database.


    How get the resource group in the application model by local current-based program?

    We have two local unions; En and Ar.

    -Resource Bundle for Arabic: ModelBundle_ar.properties

    -Bundle resources for English: ModelBundle_en.properties

    We try to use the code but the room below is still in English

    ResourceBundleDef resourceDef = this.getResourceBundleDef ();

    Settings regional locale = this.getDBTransaction () .getSession () .getLocale (); How to change the locale in the session?

    Dim retVal =

    StringManager.getLocalizedStringFromResourceDef (resourceDef, key,

    local, NULL, null,

    (false);

    Also, this is the code that I use when changing the local at the bean:

    Locale newLocale = new local (local);

    FacesContext context = FacesContext.getCurrentInstance ();

    context.getViewRoot () .setLocale (newLocale);

    refreshPage();



    Settings regional locale = this.getDBTransaction () .getSession () .getLocale (); How to change the locale in the session?

    This will return a locale for db connection.

    Instead, try with: ADFContext.getCurrent () .getLocale)

    Dario

  • 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

  • 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.

  • How to programmtically get the resource group in the model project

    In the proposed model I can specify the flags of the UI for EO via EL use all resources.

    Is there, is it possible programmtically get the resource group that is configured for the model project (in project property Panel) as I don't want to hardcode the path of the file.

    Have you tried the following as mentioned in one of the threads above? :

    Assuming that the property is located in com.subbanasolutions.samples.Bundle.properties

    Imports
    Import oracle.javatools.resourcebundle.BundleFactory;

    Constants
    private static final String RESOURCE_BUNDLE_NAME =
    'com.subbanasolutions.samples.Bundle ';

    Code to access all of the resources and get a value associated with a key
    ResourceBundle resourceBundle =
    BundleFactory.getBundle (RESOURCE_BUNDLE_NAME);
    If (resourceBundle! = null)
    {
    Here, FOLLOW_UP_LABEL is the key found in the resource group
    String ActivityName = resourceBundle.getString ("FOLLOW_UP_LABEL");
    }

    Thank you
    Nini

  • How to get the device folder Structure?

    Hi all

    I'm new BB10 Native Development. Please help me to get the list of device folder Structure.

    like...

    books.

    camera.

    docuents

    downloads

    Misc

    music

    photos

    print

    protected_meda

    I want the same impression that I put here.

    Please, please share your exp.

    Thank you
    Pawan

    QDir::entryList (). Or maybe QDirIterator.

  • Root user cannot create VMS within the Resource Pool after you rename the Cluster

    Currently, vCenter manages two clusters. I renamed a single cluster and the root user seems now are not allowed to create a new Virtual Machine in resource pools to the title of the group with the changed name. I tried to change the name of the cluster to its original name... no luck.

    The root user can still create a VM under the individual cluster nodes, but not in a resource pool.

    The cluster that has not been renamed yet can be managed completely with the root user. Resource pools it allow me to create a virtual machine.

    I found this last issue and checked on each cluster node that the ACEDataRoleId is-1 for each section: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 1031192

    I am at a loss, any help would be greatly appreciated! Thank you!

    I think it's a bug. When I created a new data center and migrate all nodes in cluster about him, the permissions problem I was experiencing did not follow.

    Thank you for your help.

  • 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

  • Summary of the Resource Pool tab

    It is what I read from the book of ICM5:-

    Orders (not shown) component allows you to perform actions such as creating a virtual machine, creating a pool of resources and changing the parameters of a pool of resources.
    I did not understand this line. Can someone help me explain this threshold.

    In the vSphere Client, select a resource pool in the left pane. Now, select the Summary tab for the pool of resource selected in the right pane. There is a component of commands (or box) visible in the bottom left of this tab with the following options: Edit virtual machine settings, new Pool of resources.

  • Plan a stop of all guests in the Resource Pool

    Hello

    What is the best way to stop all clients in a Pool of resources according to a calendar?

    I want to stop my development/TEST servers at midnight every night.

    With the help of:

    Advances in vSphere 4.1

    vCenter Standard

    Thank you very much

    Welcome to the community.

    Vcenter Server GUI, you can only plan this operation on the specific virtual machines, not for a whole resource pool.

    The best solution is to use any custom CLI... for example:

    http://www.VMware.com/support/developer/viperltoolkit/doc/utilityappsdoc/VMControl.html

    André

  • Use of the Resource Pool with vSphere Essentials

    A silly question but I have to ask anyway:

    I have a license of vSphere Essentials with my two hosts ESXi4.  I knew that he was not in vSphere DRS.  What was not so obvious to me, it's that you need DRS activated in order to create a pool of resources to the cluster level vSphere without it.  (The option to create a new cluster is grayed out). http://kb.vmware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 1004098

    So my question is:

    Are there benefits to creating a cluster if you do not have DRS?  I now have to double and create pools of resources at the level of the host for two guests, who is an administrative burden.  In addition, one of the main reasons I have used resource pools was to facilitate the access rights based upon roles to specific virtual machines.   These two will now have to be defined for each host.

    We greatly appreciate your comments on this

    Other than the ability to use the VCA mode and setting up the location of the pagefile.  According to me, there isn't much more to a cluster if you use no HA or DRS.  Since you do not have DRS yor cannot create pools of resources that span multiple hosts within a cluster.

    You will need to create individual pools of resources on each host by taking your host from a cluster and have just in the data center.

    OBM

  • Get the Bad Pool Caller

    I'm getting Bad pool caller error please help me I wil u give the silent file there is please help

    https://onedrive.live.com/redir?RESID=E8AA1ECAA522A19C! 19619 & authkey =! ALa_F2JBunaSF48 & ithint = the file % 2cdmp.

    Please help fasst

    PS: I have windows 10 build 10041

    These accidents were related to the corruption of memory (probably caused by a driver).

    Run these two tests to check your memory and find which driver is causing the problem.  Launch auditor.  You need not run memtest again unless you want to.

    If you are overclocking anything reset by default before running these tests.
    In other words STOP! If you don't know what it means that you're probably not  


    1-Driver Verifier (for full instructions, see our wiki here)

    2-Memtest. (You can learn more about running memtest here)


Maybe you are looking for

  • suddenly I'm asking as a new tab and not google search - driving me crazy

    Ask the home page is driving me crazy. I want my google search customary as that which opens when I press on the new tab. I was everywhere on the internet to try to fix this. nothing works.

  • Problem USB P10 (or disaster)

    Hello My display suddenly flashed white and the computer freezes, after that I restarted everything worked fine except all the usb ports.Device Manager is showing that the usb hub is working properly, and Toshiba PC diagnostic Tool V3.0.6 usb test.an

  • Laptop HP 15-d003se: NOT of Wifi on Hp 15-d003se

    HELLO EVERYONE! Hoping someone can help me. So, the thing is that I do not have wifi on my Hp 15-d003se at the present time. I don't know what happened, all I remember, it was last week (May 21, 2016) when I'm trying to connect to my wifi cousin, the

  • Portable printer HP 150 ~ Bluetooth

    I have a mac book air and I try to connect to the Hp 150 mobile printer via bluetooth, but when I click on pair it says pairing failed. I then click on options and it asks me for a code and I don't know where to find the code... Someone please help!

  • T430 - how the permanent backlight keyboard?

    Hello Is it possible to make permament keyboard backlight? Would be nice if it worked all the time. I had this option in my Dell Vostro and I really miss this feature.