How to list VM attributes

I would like to identify the attributes a single VM, like the CPU, memory, disk, NIC, IP by using JavaScript. The following script will enter the virtual computer object and display some of the attributes, but does not have the attributes I'm looking for.

var getVM = 'LAB-TEST-VM1;

var strVMArray = System.getModule("com.vmware.library.vc.vm").getAllVMsMatchingRegexp (getVM);

var strVM = strVMArray [0];

attributes vcVirtualMachine

System.log ("Variable:" + strVM);

System.log ("computer:" + strVM.name);

System.log ("database:" + strVM.datastore);

System.log ("vCenter host:" + strVM.vimHost);

System.log (' VM ID: "+ strVM.id");

The above script produces the following output:

[2015-05-18 13:01:08.135] [I] Variable: DynamicWrapper (Instance): [VcVirtualMachine]-[class com.vmware.vmo.plugin.vi4.model.VimVirtualMachine] - VALUE: VirtualMachine, vm-29806 > 'LAB-TEST-VM1.

[2015-05-18 13:01:08.135] [I] computer: LAB-TEST-VM1

[2015-05-18 13:01:08.136] [I] the data store: DynamicWrapper (Instance): [VcDatastore]-[class com.vmware.vmo.plugin.vi4.model.VimDatastore] - VALUE: Datastore < datastore-219 > "VMFS2-LAB-HQ.

[2015-05-18 13:01:08.136] [I] vCenter host: DynamicWrapper (Instance): [VcSdkConnection]-[class com.vmware.vmo.plugin.vi4.VimHost] - VALUE: hq - dev - vc01.acme.local

[2015-05-18 13:01:08.136] [I] VM ID: vm-29806

Q1. How can I get the attributes that I'm looking for (CPU, RAM, network, IP card)?

Q2. How can I display only the value of the output displayed above, not the info from DynamicWrapper?

ResourceConfig maybe isn't the right place.

What is

strVM.config.hardware.numCPU

strVM.config.hardware.memoryMB

It's all in the API Explorer. I just went and found. You can do it too!

Tags: VMware

Similar Questions

  • The sum of a list of attributes TimeOfDay

    Hi all

    Is there a way to add a list of attributes TimeOfDay.

    See you soon

    I don't know that this data type is suitable for your needs. TimeOfDay isn't really a unit of measure, it is more than a reference to a point in time.

    In my opinion, the best option if you plan to use OWD is to create your own custom formatter to format the entry and the exit of a number. More details on this subject are in aid of developer under the heading 'Presentation of Plugin' trainer.

    However, if you are looking for a pure solution of rules, you could add technically moments of the day together, but you may encounter problems in certain circumstances (as your time of day variable should not exceed 23:59:59).

    the seconds worked = 360 ExtractHour (worked time) + 60 * ExtractMinute (worked time) + ExtractSecond (the time worked) *.
    Sum every second your employees have worked, then format it how you want dividing back out in hours, minutes and seconds.

    It of not pretty, but should work as long you are only collecting each employee per day times.

  • My iPad is more listed on my Apple ID. How do listed?

    MY iPad 2 model MC770LL/A with OS 9.2.1 (13 D 15) does not appear on my list of device Apple ID.  How do listed?

    When the iPad application my Apple ID in the dialog box, the box is a former ID, I've updated some time ago.  And I have more the old email address or password.

    Thank you.

    What id shows in the settings > iTunes and App Store? If the old version of your id then tap top and journal of it and log back with the updated release to id (and if the old id still present in settings > iCloud, settings > Messages > Send and Receive and settings > FaceTime): what to do when you have changed your Apple ID email address or password - Apple support.

  • WebCenter Sites REST API: How to add multiple attributes to Active?

    I created an asset with a multiple attribute, as for example, a set of images.

    I would like to insert images of this asset with the Webcenter Sites REST API but I Don t know how.

    Single attribute is like this:

    sourceAssetAttribute = new Attribute();
      sourceAssetAttributeData = new Data();
      sourceAssetAttribute.setName("FSIILongDescription");
      sourceAssetAttributeData.setStringValue("Test Long Description");
      sourceAssetAttribute.setData(sourceAssetAttributeData);
      sourceAsset.getAttributes().add(sourceAssetAttribute);

    And multiple is how?

    I finally got.

    https://support.Oracle.com/epmos/faces/DocumentDisplay?_afrLoop=563491042188574&parent=document&SourceID=1528601.1&ID=1510322.1&_afrWindowMode=0&_adf.CTRL-State=m55lxhl4z_58

    It s like this:

    sourceAssetAttribute = new Attribute();

    sourceAssetAttributeData = new Data();

    sourceAssetAttribute.setName ("attribute_name");

    sourceAssetAttributeData.getStringLists (.add(0,"Asset_type:"+asset_id));))

    sourceAssetAttributeData.getStringLists (.add(1,"Asset_type:"+asset_id));))

    sourceAssetAttribute.setData (sourceAssetAttributeData);

    sourceAsset.getAttributes () .add (sourceAssetAttribute);

  • How to list the columns for a view

    Dear experts

    I know how to list the columns in a table. This easy by querying the data USER_TAB_COLUMNS dictionary.

    But my problem is how to issue a query that returns the columns for a view?

    Thanks in advance

    USER_TAB_COLUMNS stores the metadata for both views.

    Select * from user_tab_columns where table_name = 'YOUR_VIEW_NAME"of order of column_id.    -Replace with your view_name (mandatory course)

    See you soon,.

    Manik.

  • How to access the attributes of VO through binding...

    I have a lookup table that has 2 columns namely encode and attrib.

    I created a ViewObject with SQL like:

    SELECT THE CODE, REFER TO THE STUDY_TYPE_CODES

    And he stated in an Application Module.

    Now I want to post it to the end-user as part of a selection
    that should show REFER to but returns the value CODE.

    I want to iterate the elements and generating the choices myself.
    So I tried this on my page:

    < af:selectOneChoice label = "Test" required = "true" >

    < af:forEach elements = "#{bindings." Var StudyTypeCodesVVO1.allRowsInRange}"="row">

    "< af:selectItem value =" #{row.code} "label =" #{row.describ} "id ="si3"/ >

    < / af:forEach >

    < / af:selectOneChoice >

    It gives an error. Looks like how I use
    "#{row.code}" or "#{row.describ} ' is false.  If I ' # {line} "then
    It's OK, and I could see that the line is a

    ViewRow [oracle.job.Key []]

    But I do not know how to access attributes by name 'Code' and ' means ".". " I also tried
    "#{rank." Code}"with the capital and it does not work.

    How to access the attributes 'code' and 'describe' of each line?

    Kindly help.

    Thank you.

    Check the RangeSize property on the iterator to pageDef.

    Dario

  • How to list the cars on unix terminal databases

    Hi guys, I want to know how to list all the cars on unix terminal databases.
    the following command lists all databases running on a server

    *'ps - ef | grep smon | AWK '{print $8} ' | f '_' awk ' {print $3} "*.

    These databases, I try to find all the databases that are active rac.

    I tried srvctl status database-d 'database name'
    but with that I was able to find information on the single database at a time. So I'm looking for a single command that lists all the cars to a one-way ticket databases.
    can someone help me please understand this command

    Thank you

    Try:

    srvctl config database
    
  • How to list the Total number of messages in the specific queue

    Hi all
    Message queue
    How to list the total number of messages in the specific queue using wlst

    Published by: 666666 on 8 March 2012 04:42

    You might have more luck post it on the forum JMS...

  • How to list the active recording points in a session?

    How to list the active recording points in a session?

    Brands of Marcelo - ESRI wrote:
    How to list the active recording points in a session?

    not easily

    http://www.orafaq.com/Forum/t/122719/2/

  • How to list the numbers in the list of values for a url parameter IRIN/filter

    Hello

    I'dl likes to call it the Apex interactive report with filter IRIN parameter page in the URL
    to get the report to get a list of the IDS of the action.

    When the filter looks like IRIN_ACTION_ID:189353, I get the report for action_id = 189353 correctly.
    However, the point would be to get the report for a set of values action_id, but I am struggling to find the format how to list more worth action_id to achieve the desired result.


    It works, gives what I expect:
    http://../pls/Apex/f?p=999:916:1087915793180497:CIR:IRIN_ACTION_ID:189353

    These formats do not work, here, I'm trying to get the action_id report IN 189353,19004
    http://.../pls/Apex/f?p=999:916:CIR:IRIN_ACTION_ID:189353 %2C 190043
    http://.../pls/Apex/f?p=999:916:CIR:IRIN_ACTION_ID:189353, 190043

    Action_id = 190043 is not included in the report that there is.

    Please can someone confirm how the values of type numbers must appear in the URL for the IN operator?

    Thank you very much
    Lajos

    Published by: lvarady on 10-Sep-2011 06:39

    The way to proceed is to encapsulate all the values passed within backslashes. Like this: \189353,190043\

    Passing in your url and it has all the great work!

  • How to list all the users who have the privilege of s/n?

    How to list all the users who have the privilege of s/n?

    Peter

    Select * from dba_role_privs where GRANTED_ROLE = 'DBA ';

  • How to get the attributes from the list of values

    Hello

    I have two display objects, of 'Customer' and 'CustomerDetails '.
    'Client' view, has the attribute 'CustomerId' I've defined as LOV with view of 'CustomerDetails '.
    Like this:
    <ListBinding
        Name="LOV_CustomerId"
        ListVOName="CustomerDetailsView1"
        ListRangeSize="-1"
        NullValueFlag="start"
        NullValueId="${adfBundle['oracle.javatools.resourcebundle.SystemBundle']['NULL_VALUE_RESID']}"
        MRUCount="0">
        <AttrArray Name="AttrNames">
          <Item Value="CustomerId"/>
        </AttrArray>
        <AttrArray Name="ListAttrNames">
          <Item Value="Id"/>
        </AttrArray>
        <AttrArray Name="ListDisplayAttrNames">
          <Item Value="Name"/>
        </AttrArray>
        <DisplayCriteria/>
      </ListBinding>
    I hung out in the soc on my page
    <af:selectOneChoice value="#{bindings.CustomerId.inputValue}" label="#{bindings.CustomerId.label}"
          required="#{bindings.CustomerId.hints.mandatory}"
           shortDesc="#{bindings.CustomerId.hints.tooltip}" id="soc16" autoSubmit="true">
     <f:selectItems value="#{bindings.CustomerId.items}" id="si16"/>
    </af:selectOneChoice>
    In the 'CustomerDetails' view, there is also "address" attribute.
    I would like to get the address according to the ID.

    How could I get through links?
    or in another way.

    Thank you!!

    Hello

    You want to display the address that is present in VO from customer to customer details?

    If so,.

    Perform the following steps:

    1 - Create a transient with string type attribute customer details VO (always updated).
    2 - I hope you have an attribute customer id here attribute where you created LOV. When LOV created in create list of values jump towards the top in the list of return values assign the value of the address in the transitional attribute.

    If you put this attribute on the user interface you can see the customer address id value correspondent.

    Thank you
    Prateek

  • How to define an attribute of the declarative component with the list of options

    12.1.3 jdev

    I'm trying to define a declarative component UOM. It has a text box with a selectOneChoice of the optional codes for this type of unit of MEASURE.

    I have uomType as one of the attributes of my unit of MEASURE. It may be of WEIGHT, VOLUME, LENGTH, etc. Is it possible to provide a list of the channels supported for my uomType? So, when the user uses this component, they can select a type they want in the list, instead of typing in themselves.

    < afc:attribute >
    < afc:attribute - name > uomType < / afc:attribute - name >
    < afc:attribute - class > java.lang.String < / afc:attribute - class >
    < afc: required > true < / afc: required >
    < / afc:attribute >

    Thank you.

    Hello

    Unfortunately the lists are not an option with the declarative elements

    Frank

  • [DITA] How to use the attribute valign for table row to control the position of a list

    This attribute seems quite apply to < TEXT >. If a ul, p, or fig element appears in the table cell, it will not work.

    I also tried to write a rule context to li, as ul < entry < row [valign = "middle"], but there is no chance.

    OK, I had finally it works.

    I should have written the rule of context as a paragraph, so that it will not be substituted by another rule.

  • How to remove file attributes

    I have Vista Home Premium running on my laptop (and I wouldn't if I could get XP to reload) and she put on my WD external hard drive file attributes to read-only.  I found the following thread and followed the steps in it.

    http://social.answers.Microsoft.com/forums/en-us/vistaperformance/thread/595795ba-3ffd-4052-8a0a-afd51292292d

    Unfortunately, what is to me a message that says:

    E:\ > attrib r * / S/D
    Invalid switch - / S/D

    [I tried to run with just the/s but what is gives me a very long list of reset do not file hidden - E:\[File name].

    Can someone Please, please, please tell me how to get rid of this attribute of reading only freaking that I neither want nor need.

    Hello

    The above command is spelled wrong. It should be
    attrib - r [drive:] *. * /s /d
    don't forget the space between /s and / d

    I just wanted to share in case anyone has a similar problem as my client where all files and directory have been hidden and the hidden attribute is grayed out.
    This means that the files and folders are classified as system folders, to fix this use:

    attrib s h [drive:] *. * /s /d
    This will change the attribute on all the directory and file in the drive letter specified, including the subdirectory.

    or use:
    attrib s h [drive:] [path] *. * /s /d
    to change only the files in a specified path or directory

    don't use this on your c: drive because it will expose completely all system folders which, in most cases, is not a good idea.
    Use for files and folders, or USB drives where the files are hidden or classified wrongly as file system.

    Best wishes
    Thomanji

Maybe you are looking for