Add VM to VAPP in orchestrator API script

Anyone know how to add a virtual machine to VAPP in orchestrator API script? I searched the forums and found topics on the use of cloud Manager, but I do not have what is allocated to me.

I figured out how to create a VAPP leave a resourcePool, but I don't know how to add a VM, I create after that for the vApp, I did. Any ideas?

I got it!

table = new Array();

Array [0] = VM.

vApp.moveIntoResourcePool (matrix);

Tags: VMware

Similar Questions

  • Add or remove nodes shared using a Script of Action

    Is it possible to add or remove shared nodes using action script? If so, what script to use?

    Thank you!

    Yes it is possible,

    Instead of adding you must AddInsert to maintain a Shared node,

    'Indicator Version, hierarchy, node, Parent, AddInsert, sheet/Limb.

    Instead of deletion it is advisable to remove shared nodes and after, thanks to analysis if necessary, please perform Delete,.

    'DELETE Version, hierarchy, node.

    Let me know if you see problems,

    Murali-

  • Output of REST Orchestrator API

    How do you get the output of a workflow using the REST API?

    In the example below, I ran the workflow to call an external script to call a powershell script external which connects to a vCenter and gets a list of all hosts. The output is visible in the client Orchestrator, but what format the object must be converted to be seen in the output of the API?

    I would like to be able to run a workflow through the API to extract data in JSON and display that in an external web page. Someone at - it all example workflows that would do that?

    Output.JPG

    You must copy the object to a string.

    Check the method. getAsJson() of a PowerShellRemotePSObject.

    So wrap the workflow "invoke an external script" in a custom workflow, add a script task after the workflow, when you run this method, and bind the result to an output channel of your custom workflow parameter.

    Kind regards

    Joerg

  • Add/change the columns of data type (scripting)

    Hello

    I am writing a script to add default columns and their values in tables. So far, for me, it is possible to add columns to an existing table in the model.

    Then, I want to add value to the data type. I discovered there is a method called getDataType(). So far, I have not found the "setter; for this property.

    Like other scripts, I started by creating a table with columns, and then using the API to read the values.

    A simplified version of my code:

    get the columns of table

    myTab var = model.getTableSet () .getByName ("T_POSITIONS");

    colArray = myTab.getElementsCollection () .toArray ();

    loop through columns

    for (i = 0; i < colArray.length; i ++) {}

    the type of var data = colArray [i] .getDataType ();

    model.getAppView () .log (colArray [i] + "a datatype" + dataType);

    colArray [i] .setDataType ("VARCHAR2 (1)");

    }

    An error occurs when I want to run this script: could not find setDataType function in the object ID.

    I can't find the right method to add/change the datatype property.

    Any information would be appreciated.

    Hi Bart,.

    Here's what's in the column in the XML file:

    
    FDB11R21
    EMPLOYEES
    FIRST_NAME
    
    2015-01-13 12:45:08 UTC
    First name of the employee. A not null column.
    HR_870
    true
    false
    1
    LOGDT024
    20 BYTE
    false
    
    

    20 BYTES

    If you need set the size in "20 BYTE" or "20 CHAR".

    Philippe

  • Issue by the way CHIEF: ChefHost Chief Workflow parameter in vRealize Orchestrator API

    I have an environment with vRealize Orchestrator with CHIEF plugin installed. I want to call the API to initiate a workflow LEADER in vRealize Orchestrator.

    I want to call the workflow MANAGER Add New Role . The input parameters for this workflow are

    <input-parameters> 
         <parameter description="Chef Server" type="CHEF:ChefHost" name="host"/> 
         <parameter description="Name of new role" type="string" name="role"/> 
         <parameter description="(Optional) Description of new role" type="string" name="description"/> 
    </input-parameters>
    

    The format for sending the parameters of the form type="string" is

    In JSON

             

    {
         "value":{"string":{"value": "role name"}},
         "type": "string",
         "name": "role"
    }
    

    In XML

    <execution-context xmlns="http://www.vmware.com/vco">
      <parameters>
           <parameter name="role" type="string">
                <string>Role Name</string>
           </parameter>
      </parameters>
    </execution-context>

             

    The problem, I do face is with the parameter type="CHEF:ChefHost" . I can't get the correct syntax for the shipment of type = "CHIEF: ChefHost '. During the test with the factor, I always get a 400 error with descriptionThe request sent by the client was syntactically incorrect.

    Is there a document that shows how to create a CHEF:ChefHost type?

    PS: I asked this question in http://stackoverflow.com/questions/37405901/issue-in-passing-chefchefhost-parameter-for-chef-workflow-in-vrealize-orches...

    Because I don't have an answer of SO, I ask you here.

    Chief Guest, as any other plugin object are passed as objects sdk-object are identified uniquely by their type and the id attributes. Here's how the body of the request should look like:

    in XML:

    
        
            
                
            
        
    
    

    in JSON:

    {
      "parameters" : [
        {"value":{"sdk-object":{"type":"Chef:Host","id":"b0c408c4-1d85-4a97-9314-727552fd5a39"}},"type":"Chef:Host","name":"host"}
      ]
    }
    

    You need to replace the id attribute in applications above with the current host id. To find the real ID of your host, you can query vRO catalog REST API - /GET https://{vro-host-or-ip}:8281/vco/api/catalog/Chef/Host

    In the returned response, find your host data, get the value of the dunesId attribute (must be a GUID string) and use it as a value for the id attribute in applications above.

  • How to read / follow the Orchestrator API

    Hello

    Purely a newbie question for someone who is not a developer/programmer.

    How to follow the API to get the syntax of a command?

    E.g. var allPools = cluster.resourcePool.resourcePool_ResourcePool

    How to compile this string of syntax using the API?  Is there any type of guide from beginner to using the API?  Trying to find the proper syntax is my main problem.

    Thank you

    B

    I find the web documentation to be useful also (more easy/fast to follow to try to dig through what is available in the interface script).  For example:

    https://www.VMware.com/support/Orchestrator/doc/vco_vsphere55_api/HTML/index-so_types.html

    I read usually by there when I want to see what properties and methods of an object.

  • My google toolbar does not respond and when I open tools &gt; Add-ons, a window pops up saying script is unresponsive, which is followed by firefox crashing

    When I try a search using my google toolbar it stops responding and when I open tools > Addons, a window pops up saying script is unresponsive, which is followed by firefox crashing. How can I fix it?

    It is possible that you have a problem with some Add on Firefox which is an obstacle to the normal behavior of your Firefox. Have you tried to disable all add-ons (just to see) to see if Firefox goes back to normal?

    Whenever you have a problem with Firefox, whatever it is, you must make sure that it is not caused by one (or more) of your installed modules, whether an extension, a theme or a plugin. To do this easily and cleanly, start Firefox in safe mode (remember to select disable all add-ons when you start safe mode). If the problem goes away, you know that it's an add-on. Disable them all in normal mode and allow them one by one until you find the source of the problem. See this article for more information on troubleshooting extensions and themes and this one for plugins.

    If you need help with one of your modules, you will need to contact the author.

    If the problem does not disappear when all add-ons are disabled, please tell me, so we can work from there. Please be afraid not to follow my instructions to the line, as everything can be easily undone.

  • Base - Add the user name and password in script?

    Hello

    Scripting is not my thing, I run the script below in order to get the use of the data store space and it requires user name and password for vcenter, how do I add it in the script, then I can run as a scheduled task on my Windows Server that has installed PowerCli?

    # These are the properties assigned to the table via the ConvertTo-HTML cmdlet.

    $tableProperties = '< style >.

    $tableProperties = $tableProperties + "TABLE {border-width: 1px;}. border-style: solid; border-color: black ;} »

    $tableProperties = $tableProperties + "TH {border-width: 1px;}. padding: 5px; border-style: solid; border-color: black ;} »

    $tableProperties = $tableProperties + "TD {text-align: center;} '. border-width: 1px; padding: 5px; border-style: solid; border-color: black ;} »

    $tableProperties = $tableProperties + ' < / style >.

    ##The script will automatically connect to the server if necessary. The $server variable must

    #be changed if the server name changes.

    $server = "192.168.132.1".

    If (!) () to connect-viserver $server - ErrorAction SilentlyContinue). IsConnected)

    {

    Write-Host "connection to the server: ' $server

    to connect-viserver $server - ErrorAction SilentlyContinue err - ErrorVariable

    If ($Err)

    {

    Write-Host "Connection to the server error, please check server name." - ForegroundColor Red

    breaking

    }

    Write-Host "Full" - ForegroundColor Green

    }

    # cmdlet to retrieve information from data warehouses.

    # variable $rep stores all the information for each data store.

    $rep = @)

    Get-Datastore. Sort-Object-property name. {ForEach-Object

    $Datastore = $_

    $Report = "" | Select-Object - property Datastore, CapacityGB, FreeSpaceGB, PercFreeSpace

    $Report.Datastore = $Datastore.Name

    $Report.CapacityGB = [math]: tour ($_.) CapacityMB / 1 KB, 0)

    $Report.FreeSpaceGB = [math]: tour ($_.) FreeSpaceMB / 1 KB, 0)

    $Report.PercFreeSpace = [math]: Round (((100 * ($_.))) FreeSpaceMB)) / ($_.) (CapacityMB)), 0)

    $rep += $Report

    }

    # Formats date, file name, etc. #.

    #Write - Host "Generating report".

    $date = get-date

    $datefile = get-date - uformat ' %d-%m - Y % - hour %M ' %S

    $filename = "C:\vmware\powercli\reports\VMwareDatastoreUsage_" + $datefile + ".htm".

    # Generates vsphere datastore usage report #.

    Write-Host "Full" - ForegroundColor Green

    Write-Host "Generating datastore usage report".

    $rep | Sort PercFreeSpace | ConvertTo-HTML-head $tableProperties - body ' < th > < font style = ' "color: #000000 '" > < big > < b > VMware Datastore using < /b > < / big > < / font > < /th > | Out-file $filename

    Write-Host "Full" - ForegroundColor Green

    Write-Host "usage of your data store report has been saved to: ' $filename

    ##Send email with attached generated report #.

    #Write - Host "sending email with report:" $filename + "attached".

    Send-MailMessage-to "vmware-reports < . " [email protected] >"-subject 'vSphere datastore use' - to ' Andy White < [email protected] > "-body" VMware report attached: use of the data store "- attachment $filename - high - dno onSuccess, onFailure - smtpServer 192.168.13.3

    The connection is made in this line

    SE connect-VIServer $server - ErrorAction SilentlyContinue err - ErrorVariable

    You can add the user and password parameters of the cmdlet Connect-ViServer . But you want to have this info hardcoded in the script?

    An alternative is to use the credentials store.

    There are other alternatives to store the credentials.

  • Add a minimum value in a calculation script

    I'm working on a new form and add a minimum for a calculation script that calculates the amount of the loan, but if the calculation is <$ 175, it fills as $175 and is no less than that.

    Current script is:

    function MyRound (nValue, nDec) {}

    var nRound = util.printf ("" %, 1-1. "') + nDec + "f", nValue)

    Return Number (nRound);

    } / / end MyRound funciton.

    custom calculation script lenderstitlebase;

    lenderstitlebase = (loanamount *. 0030) circle until neareast 0;

    calculate the value;

    var lenderstitlebase = this.getField("loanamount").value * 0.0030.

    round the value;

    Event.Value = MyRound (lenderstitlebase, 1);

    Thank you!

    Add this line at the end of the code:

    If (event.value<175) event.value="">

  • HttpClientErrorException with the REST of Java Orchestrator APIs

    Hello

    I'm trying to quickly reach the speed to use this API.  I'm using version 5.1.0 configured with PASS-THROUGH authentication.

    I'm trying to run a workflow, or simply call whatever it is really on the Orchestrator who also interacts with vCenter.

    I went through the code example in the rest-client-examples-test that comes with Orchestrator, and I get an exception. My code is on a closed network, sorry that I can't copy paste.

    but here's the gist of the stack trace:

    org.springframework.web.client.HttpClientErrorException: 400 < big long guid > false - rest - not related caused by: big long guid > false - rest - not related

    at.org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:76)

    .. few other spring classes

    .

    .

    at com.vmware.o11n.sdk.rest.client.SsoAuthenticator.getVcoSolutionPrincipal(SSoAuthenticator.java:174)

    at com.vmware.o11n.sdk.rest.client.SsoAuthenticator.getVcoSolutionPrincipal(SSoAuthenticator.java:155)

    at com.vmware.o11n.sdk.rest.client.DefaultVcoSessionFactory.newSsoSession(DefaultVcoSessionFactory.java:89)

    at com.vmware.o11n.sdk.rest.client.examples.tests.RestTest < init > (RestTest.java:93)

    at com.vmware.o11n.sdk.rest.client.examples.tests.RestTest.main(RestTest.java:118)

    Looks like it will always fail in trying to get the principal amount of the solution?

    I saw the post here: How to move the VM of Workflow using JavaSDK name?

    and tried to not not using the call to newSsoSession() as suggested in the post and create my own SSOAuthenticator and passing the session, but which resulted in the same exception.

    That's essentially what my code looks like:

    public class RestTest

    {

    Public Shared Sub main (string args [])

    {

    try {}

    VcoSession session = DefaultVcoSessionFactory.newSsoSession (new URI ("https://hostname:8281 / api /"), new URI ("https://hostname:7444/ims/STSService"), 1234567, 'user', 'pass');

    WorkflowService wfService = new WorkflowService (session);

    InventoryItemQuerySpec filter = new InventoryItemQuerySpec();

    filter.setMaxResult (10);

    List InventoryItemsList = wfService.getAll (filter);

    System.out.println ("Got list:" + (list is nothing));

    }

    catch (System.Exception e)

    {

    System.out.println (e);

    }

    }

    }

    Note: if I use DefaultVcoSessionFactory.newLdapSession () just for fun and then tried to call UtilService.getSupportedApiVersion () and who does not, but I guess it's because no interaction is required with the vCenter server to call this method.

    I'm stuck! Any ideas or suggestions would be greatly appreciated! THX!

    I understood that... Finally, looks like I didn't specify mydomain user@domain, and I was not authenticated correctly, or maybe to halfway.  Error message returned should be much better, as the only way that I thought that this point has been to the server.log the Orchestrator.

    THX!

  • Add the disk storage format to the script

    All, morning

    I had this script that I use to extract data on the virtual machine and their use of the disk, however I need to say and to report on the type of commissioning the disk and I can not find the command for it

    $VMFS = get-Datastore-Refresh - name "LUN? _VMFS_DS "| Sort-Object $_. Name

    $report = @ data structure empty #)

    $allvms = get - VM | Sort-Object $_. # Name I like sorts my datas

    {foreach ($vm to $allvms)

    $vmview = $vm | Get-view # get - view to see the details of the FM

    foreach ($disk in $vmview. Storage.PerDatastoreUsage) {# disks for the virtual machine

    $dsview = (get-view $disk. Data store) # store data used by drives

    $dsview. Refresh # RefreshDatastoreStorageInfo() to get the latest data

    $vmview. Config.Name # Echo to the screen to view the progress

    $row = "" | Select VMNAME DATASTORE, VMSIZE_MB, VMUSED_MB, blank line # PERCENTAGE

    $row. VMNAME = $vmview. Config.Name # add the data to the line

    $row. DATA store is $dsview. Name

    $row. VMSIZE_MB = (($disk.Committed+$disk.Uncommitted)/1024/1024)

    $row. VMUSED_MB = (($disk.Committed)/1024/1024)

    $row. P = [int] (($row.)) VMUSED_MB / $row. (VMSIZE_MB) * 100)

    $report += $row # add the line to the structure

    }

    }

    $report | Export-Csv dump of # "C:\temp\vm_ds.csv" - NoTypeInformation .csv report

    $DSReport Virgin @ reinscriptible = () # for the information store

    {foreach ($LUN to $VMFS)

    $VMSizeSum = 0 # we will summarize the data from the previous report for this LUN

    $LUN. Name # Echo to the screen to view the progress.

    foreach ($row in $report) {# Generate sum for this LUN

    If ($row. DATA store - eq $LUN. Name) {$VMSizeSum += $row.} VMSIZE_MB}

    }

    # Create a blank line and add data to it.

    $DSRow = "" | Select Datastore_Name, Capacity_MB, FreeSpace_MB, Allocated_MB, Unallocated_MB

    $DSRow.Datastore_Name = $LUN. Name

    $DSRow.Capacity_MB = $LUN. CapacityMB

    $DSRow.FreeSpace_MB = $LUN. FreeSpaceMB

    $DSRow.Allocated_MB = [int] $VMSizeSum

    $DSRow.Unallocated_MB = $LUN. CapacityMB - [int] $VMSizeSum # NB than if we have overused # disk space it will be a negative number

    $DSReport += $DSRow # add the line to the structure.

    }

    $DSReport | Export-Csv "C:\temp\Datastores.csv" - NoTypeInformation # dump make .cs

    This report on everything I need, but it will indicate the type of commissioning. Could you help me at all?

    Thank you very much

    Alex

    Ah, it is a bit of a problem, I'm afraid.

    vSphere provides only the freespace on a level of data store, not by the hard drive.

    There are a number of ways to get the freespace by hard drive, but none of them are foolproof, as far as I know.

    For example have a peek at the post called Alan PowerCLI: using Virtual Machine disc

    This gives the freespace, but an internal view of the BONE. In other words, it shows the OS partition information.

    And mapping of the partitions of hard disk operating system is not simple.

    A good method, which works in most cases, is the method of Arnim Match VM and HDDs in Windows using PowerCLI

  • Api scripting flaw or bug in the code?

    I have a custom action and the workflow to save output settings to the last step in a workflow, so I don't know what data is passed. However the script statement that I use is null rather than the types of right back.

    Can someone tell me if there is a problem with scripting api or a bug in their code?

    Attach the workflow actions and example

    The action of the problem is logOutputParams.

    It uses 2 other actions for printing actually log files that I've also attached for reference.

    Yes, output parameters are available in the attributesStack property, which contains the attributes + input + output.

    An example of code to iterate over them:

    var attStack = workflow.attributesStack;
    for (var i in attStack) {
      var elem = attStack[i];
      for (var j in elem) {
         var att = elem[j];
         System.log(" name " + att.name);
         System.log(" type " + att.type);
         System.log(" value " + att.value);
      }
    }
    
  • How to add a color sample in a Photoshop script?

    Hello

    I would like to set a point of color sampler in a Photoshop script?

    Could you please help me on this.

    Thank you

    Rajiv.s

    var theSampler = app.activeDocument.colorSamplers.add([10,10]);

    Alert (theSampler.color.rgb.red + "_" + theSampler.color.rgb.green + "_" + theSampler.color.rgb.blue);

    Edit: And don't forget that a document can have only four ColorSamplers (from CS5 at least).

  • Java API script

    Hello

    I have problems using the underside of an element. Basically, I want to convert all lowercase letters to uppercase.

    Online help
    $v_Upper (NDP)
    Sets the value of a form (NDP) uppercase element.

    Return value

    Does not apply.
    Parameters

    pNd (DOM node |) String)

    1 what DOM node / String stand?

    I tried to put the code in attributes of elements of HTML form elements, and it did not work
    Is the $v_Upper (this) correct syntax or someone could help me what exactly is the syntax / needed
    in order to use the java script API


    Thank you

    Hello

    pNd (DOM node |) String) in most cases would be the name of the element.

    $v_Upper ('P1_ITEM')

    in your case since you want to use it directly on an item you would use this in your form element attributes

    onchange="$v_Upper(this)" onkeyup="$v_Upper(this)"
    

    in this case, it's a DOM node

    Here is an example running [http://apex.oracle.com/pls/otn/f?p=11933:64]

    Kind regards
    Carl

    blog: [http://carlback.blogspot.com/]
    examples of apex: [http://apex.oracle.com/pls/otn/f?p=11933:5]

  • Howw can I use extensions I have installed as the admin for a standard user account? When I go on my Add ons under the standard user, no script is not an option. Thank you

    Hi, I'm using Vista and Firefox 3.6. I installed some popular addons such as no script and the web page of the trust for the admin account, but when I connect under the standard account with fewer rights, I do not have them available. The only way I can get to run is to right click and run as administrator which defeats the purpose to log on as a standard user. Thanks for any help you can provide.

    See:

Maybe you are looking for

  • Tecra A4-204: Bluetooth power off

    I have laptop Toshiba Tecra A4-204. I would like to know if it is possible to disable bluetooth radio using the software only. It can be disabled using the hardware on the front of the computer switch. He is also an item called "Turn Bluetooth Radio

  • HP Envy 700-215xt: ieee 1394

    I need to install an IEEE 1394 interface card.  I understand that my computer has a PCI-Express expansion slots.   How can I be sure that a card IEEE will work in one of these machines slot?

  • computer keep crashing shortly after switch on

    I can't be sure, but this happened after I updated windows service Pack 3 Source: System error Description: error code 000000f4, parameter1 00000003, parameter 2 82178528, parameter3 8217869c, parameter4 80604548

  • Firewall, Security Center and Windows updates does not

    Hey guys Original title - I really need help with my computer I really need help, my firewall will not turn on when I try to turn it on it says that "firewall Windows was unable to make a requested update.When I try to turn on my Security Center it s

  • "windows defender encountered an error: 0 x 80070424.

    I could have caused this problem on my Vista Home Premium by stopping abruptly. Now, my defender service is turned off, and when I tried to turn it on, I got the following message:' "Windows defender encountered an error: 0 x 80070424. How can I solv