How to retrieve the view coming from Onyx?

Hello

I started to use the Onyx project recently. That is truly amazing to see what he does. I wonder if there is a possibility to check the main view... let my try to explain this.

I want to change the box of esxi5 - Advanced/Logging option to external syslog server.

While in the interface graphics, I did my steps and Onyx prints the output:

#---UpdateOptions-

$changedValue = new-Object VMware.Vim.OptionValue [] (1)
$changedValue [0] = new-Object VMware.Vim.OptionValue
.key $changedValue [0] = "Syslog.global.logHost".
$changedValue [0] .value = "tcp://x.x.x.x:514".

_this $ = get-view-Id "OptionManager-EsxHostAdvSettings-456.
_this $. UpdateOptions ($changedValue)

This does not work as expected. I can throw it to powercli and it will introduce the option. This works only for this area special esxi. I want to create a loop that will change this option to each area of esxi in the cluster.

The view that uses onyx is: ' Get-View-Id "OptionManager-EsxHostAdvSettings-456'»»

That he already knows the moref / host of the view.

But if I would like to have this in a loop, so it will do for each host, so how can I get this kind of view?

So far, I could build only something like

foreach($vmhostview_in_(get-view-ViewType_HostSystem-SearchRoot_(get-cluster_"xxyyzz").ID))

{

$changedValue = new-Object VMware.Vim.OptionValue [] (1)
$changedValue [0] = new-Object VMware.Vim.OptionValue
.key $changedValue [0] = "Syslog.global.logHost".
$changedValue [0] .value = "tcp://x.x.x.x:514".

$number = $vmhostview.moref.split("-") [1]

_this $ = get-view-Id OptionManager - EsxHostAdvSettings - $nombre
_this $. UpdateOptions ($changedValue)

}

Which is totally stupid approach I think it works... splitting moref...

After a while, I noticed that

http://pubs.VMware.com/VI-SDK/visdk250/ReferenceGuide/Vim.option.OptionManager.html

Said OptionManager is owned by configuration manager. So that I could get the id from this point of view:

((get-vmhost myHost | get-vue).) ConfigManager.AdvancedOption). ToString()

which will result in the output: OptionManager-EsxHostAdvSettings-456

In order to have this I could make my loop at the end:

foreach($vmhostview_in_(get-view-ViewType_HostSystem-SearchRoot_(get-cluster_"xxyyzz").ID))

{

$changedValue = new-Object VMware.Vim.OptionValue [] (1)
$changedValue [0] = new-Object VMware.Vim.OptionValue
.key $changedValue [0] = "Syslog.global.logHost".
$changedValue [0] .value = "tcp://x.x.x.x:514".

_this $ = get-view-Id ($vmhostview. ConfigManager.AdvancedOption). ToString()

_this $. UpdateOptions ($changedValue)

}

Now I don't know that it was just a chance that I found the location of the view name or it's the way I'm supposed to find the name of view id. I wonder how other people treat such cases, if there is more easy way to do it. If someone could share its experience I would really appreciate it.

Kind regards

Greg

There is not need to build these view ID as you see them from Onyx.

In fact, I wanted to write this script like this

$changedValue = New-Object VMware.Vim.OptionValue[] (1)
$changedValue[0] = New-Object VMware.Vim.OptionValue $changedValue[0].key = "Syslog.global.logHost" $changedValue[0].value = "tcp://x.x.x.x:514"

Get-View -ViewType HostSystem -Searchroot (Get-Cluster "xxyyzz").ExtensionData.MoRef | %{
  $optMgr = Get-View $_.ConfigManager.AdvancedOption  $optMgr.UpdateOptions($changedValue)
}
  • Move the part that does not change with each HostSystem outside the loop
  • The ConfigManager is a table with MoRefs pointing to the respective managers. You can just do a Get - view with a MoRef and it returns the object that represents the Manager
  • From the object manager, you can now call the method

BTW, you better see the last SDK Reference.

You can find the HostConfigManager here.

Tags: VMware

Similar Questions

  • How to retrieve the image BLOB from database and display the image in rtf file using the Oracle XML Desktop 5.6.2 publication server?

    Hi all

    Here I have the image BLOB in the database files,

    I want to show the image to PDF using file to rtf using Oracle Xml Desktop Publisher,

    Hi all

    I found the solution for reading Image BLOB of data base & display in Pdf format.

    (1) read the image from DB.2) and then copy the picture using IO. UtilsCopy method to copy the picture

    (3) then encode with base64 converter then you will get the tag XML with Base64 as string then placed in your XML Code & preview the output, you will find the image

    Photo = (BlobDomain) currentRow.getAttribute ("Image");

    ByteArrayOutputStream OutputStream = new ByteArrayOutputStream();

                        Byte [] imageByte;
                          Byte [] b = null;
                        try {}
                        
                            IOUtils.copy (photo.getInputStream (), outputStream);
                            BS = outputStream.toByteArray ();
                            outputStream.flush ();
                            System.out.println("==="+BS.) Length);
                            Encoded byte [] is Base64.encodeBase64 (bs).;
                            encodedString = new String (encoded);
  • How to retrieve the network icons and the taskbar sound? They disappeared

    original title: extraction and network icons

    How to retrieve the network icons and the taskbar sound?  They disappear from the notification area of the taskbar.

    Hello

    There are different ways to fix it

    read all the information on the link below

    Try Method 1 or 3

    Method 1. :

    1. right click on the taskbar and click Properties.

    2 tab Area of Notification .

    3 check the (on) or disable (off) the options you want or do not want to display on the Taskbar Notification area

    Method of reading 3 etc. in the link below

    How to enable or disable the Notification area system icons in Vista

    http://www.Vistax64.com/tutorials/106787-notification-area-system-icons.html

  • After the system recovery running following a power outage, my user profile is lost. Unfortunately, he is also the administrator account. How to retrieve the profile or create a new?

    After the system recovery running following a power outage, my user profile is lost.  Unfortunately, he is also the administrator account.  How to retrieve the profile or create a new?

    ·                        Restore point:

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    If the above does not work:

    ·                        http://www.Vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded.html

    See if the information in the above tutorial will help you.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    Difficulty of a corrupted user profile

    After creating the profile, you can copy the files from the existing profile. You must have at least three user accounts on the computer to perform these operations, including the new account that you created.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://support.Microsoft.com/kb/947242

    A temporary profile is loaded after you connect to a Windows Vista-based system

    See you soon.

    Mick Murphy - Microsoft partner

  • How to retrieve the values of character without using single quotes

    Hi all

    How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL

    Please answer me...

    For example

    Is actual query-> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);

    I want to--> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.

    Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.

    shagarmahabubjan wrote:

    Hi all

    How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL

    Please answer me...

    For example

    Actual query is---> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);

    I want to---> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.

    Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.

    In short... you can't.  The channels are channels, and SQL and PL languages dictate that the string literals are provided within single quotes.

    I don't see how trying to retrieve more than 200 records of employees in the select statement means that you must get rid of the quotes.

    Be clear in what you ask: Re: 2. How can I ask a question on the forums?

    and take note of the FAQ link davidp provided the solution "variable IN the list.

  • How to see the "VIEW" in sqlplus script?

    Hello gurus,

    Can I know how to watch the plu "VIEW" in sql script?

    So far I used the editor to look at the script, but I don't know how to watch the view SQL script?


    Any idea?


    Thank you!!

    Hello

    Capitalize the name:

    select dbms_metadata.get_ddl('VIEW', 'TEST_VIEW') from dual;
    

    Do not forget that the text inside the quotation marks (quotation marks single or double quotation marks) is case-sensitive.

    The parser takes advantage of all that is not in quotes, so when you say:

    create or replace view xyz.test_view as select sysdate x from dual;
    

    What is actually esecuted is

    CREATE OR REPLACE VIEW XYZ.TEST_VIEW AS SELECT SYSDATE X FROM DUAL;
    

    and the view is called "TEST_VIEW" (uppercase), which is not the same thing as "test_view" (with all lowercase letters).

    It may be not important if the other argument to get_ddl ('view') is capitalized or not. Often people write procedures to forgive if you forgot something, and the error is obvious. There is a database object that is called 'VIEW' is not a database object called 'view', and so the function can be written to correct an obvious mistake to say "view" rather than "VIEW". But it cannot be assumed that, when you say "test_view", you really wanted "TEST_VIEW": you can actually have two different objects to these two names. It would not be a very good idea (I do not use lowercase letters in the names is a good idea in any case), but you could do it.

    Published by: Frank Kulash, Sep 15, 2010 15:40

  • OA Framework page customization - how to change the view Instance

    OA Framework page customization - how to change the view Instance

    Hello
    I have to add extra field to a page.
    View instance, I found, but there is no attribute that I need.

    Is it possible to change the Instance from the view of the application level
    because you use only not JDeveloper?

    Thank you
    Malin

    Hi smart,

    If your VO does not include the column you are looking for, then the only way to achieve is through substitution of VO for which you use jdeveloper.
    You can't accomplish by customizing.

    Thank you
    Sree

  • LOBs and how to retrieve the record inserted with EMPTY_BLOb()

    Hi guys


    How to retrieve the records inserted with EMPTY_BLOb() instead of NULL value.


    Best greetings
    A.G.

    There must be a better way, but these work:

    SELECT... from tableX where length (lob_column) = 0;
    SELECT... from tableX where dbms_lob.getlength (lob_column) = 0;

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "All experts it is a equal and opposite expert."
    Clarke

  • How to disconnect the access code from my iPad 2

    How to disconnect the access code from my iPad 2

    What do you mean by "disconnect"? If you mean stop using an access code then settings > password (enter your current password) > disable password

  • How to remove the effect - brightness, from there?

    How to remove the effect - brightness, from there.  First of all I thought to increase the sound volume using the BRIGHTNESS of the effect, but now improved Audio, I use the volume, which is enough.

    So I would remove the block of brightness from there.

    Thank you.

    The brightness setting should not have any effect as you turned it off.  .  .  the blue square is not lit.

    However, if you don't like the look of it sitting there, highlight as I did it and press the DELETE (backspace) key to make them disappear.

  • I sent an email to someone by mistake, how to retrieve the email until the receiver reads?

    I sent an email to someone by mistake, how to retrieve the email until the receiver reads?

    I sent an email to someone by mistake, how to retrieve the email until the receiver reads?

    You can not. It's like putting a letter in a physical mailbox. There is no way to recover it.

  • How to use the license acquired from Win 7 cd to be used on my WinXP?

    Windows XP License Activation

    I have a copy of Windows XP on my PC where I tried registering online, he says that's not authentic. I bought a copy of Win7 with downgrade rights to Windows XP Pro. How to use the license acquired from Win 7 cd to be used on my WinXP? I could not afford a complete reinstallation because several drivers needed to work on my pc do not work with Win7.

    Thank you!

    Hello Emerson_1

    Microsoft does not sell Windows 7 with a downgrade to Windows XP and a valid key. You will need to provide your own key. This option is only available with OEM Windows 7 Professional systems. If you wish to continue using XP you will need 2 keys as indicated by JW.
    Windows 7 offers XP mode and you can use it if you have chosen.
  • How to open the pdf files from hotmail.

    OMG no body can help with this question, how to open the pdf files from hotmail

    OMG no body can help with this question, how to open the pdf files from hotmail

    Told you that you need Adobe Reader, which is designed to open pdf files?

    Download Adobe Reader:

    http://www.Adobe.com/products/reader.html

  • Lost admin password, how to retrieve the current password to change it?

    I forgot my Admin password, I connect on my laptop using the scanner print finger all the time and when I try to change the password for Admin it ask the password which I do not remember. How to retrieve the current password and change it in Windows 7 Home premium?

    It's a laptop Acer 5738 G

    You can change your current password as follows:

    1. click on start.
    2. type the three letters cmd in the search box.
    3. press on Ctrl + Shift + Enter
    4. click on "run as Administrator".
    5. type the following command and press ENTER after each:
    NET user "user %%nom" 123456

    Now the password is 123456. While dealing with accounts and passwords: having a single admin account on a PC is about the same as having a unique key for your car. What happens if you lose? He lost? Break it? A robust Windows Setup requires at least the following:

    • Two admin accounts fully tested, with their passwords to record on paper.
    • A password key file. Click Start / Help, then search for help on "password". Follow the instructions to create a key on your USB flash drive file so that you'll never find yourself in this uncomfortable situation.
  • How to move the insertion point from editText ScriptUI?

    Hello.

    How to move the insertion point from editText ScriptUI?

    Please tell me the JS code.

    Thank you.

    I don't think you can. You can control the selection of text in an editText widget, but not the position of the insertion point.

Maybe you are looking for