Hostsvc/rsrc/pools get: Difference between revisions

From VI-Toolkit
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 13: Line 13:


   cat /etc/vmware/hostd/pools.xml | grep "RESOURCE_POOL_NAME" -A1 | grep "<objID>" | sed 's/<objID>//;s/<\/objID>//g' | sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//'   
   cat /etc/vmware/hostd/pools.xml | grep "RESOURCE_POOL_NAME" -A1 | grep "<objID>" | sed 's/<objID>//;s/<\/objID>//g' | sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//'   
To register a VM and assign it to a given resource pool, you can do the following (Assuming you have a VM named *UCSB-GAUCHOS* and Resource Pool named *UCSB-DEV-RP*:
  vmware-vim-cmd solo/registervm /vmfs/volumes/olga-local-SAS.Storage/UCSB-GAUCHOS/UCSB-GAUCHOS.vmx UCSB-GAUCHOS `cat /etc/vmware/hostd/pools.xml | grep "UCSB-DEV-RP" -A1 | grep "<objID>" | sed 's/<objID>//;s/<\/objID>//g' | sed -e 's/^[[:blank:]]*//;s/[[:blank:]]*$//'`




[[Category: Vimsh]]
[[Category: Vimsh]]

Latest revision as of 00:22, 6 January 2009

vimsh hostsvc/rsrc/pools_get

Usage: pools_get poolId

Get the list of pools nested within the specified pool.

Example

To extract the poolId, you actually have to look in the following file:

 /etc/vmware/hostd/pools.xml

Here is a quick snippet of code to extract the poolId based on a VM Name:

 cat /etc/vmware/hostd/pools.xml | grep "RESOURCE_POOL_NAME" -A1 | grep "<objID>" | sed 's/<objID>//;s/<\/objID>//g' | sed -e 's/^blank:*//;s/blank:*$//'  

To register a VM and assign it to a given resource pool, you can do the following (Assuming you have a VM named *UCSB-GAUCHOS* and Resource Pool named *UCSB-DEV-RP*:

 vmware-vim-cmd solo/registervm /vmfs/volumes/olga-local-SAS.Storage/UCSB-GAUCHOS/UCSB-GAUCHOS.vmx UCSB-GAUCHOS `cat /etc/vmware/hostd/pools.xml | grep "UCSB-DEV-RP" -A1 | grep "<objID>" | sed 's/<objID>//;s/<\/objID>//g' | sed -e 's/^blank:*//;s/blank:*$//'`