How to run specific scripts of site for a virtual machine?

I need to run a script that will update the virtual machine IP to DNS server.  I intend to use the dns_update.cmd.

1. can I create stimulus steps that are specific to the site?

2. don't VMware SRM SDK provides what API s to determine the name of the Site?

TIA,

Sudhir

> 1. Can I create stimulus steps that are specific to the site?

SRM provides environment variables to scripts step command that will allow you to do. See variable environment for the ordering steps in the administration guide for more information on variables.

The key variable is the variable 'VMware_VC_Host '. You can use this variable in your script to perform different actions depending on which VC you get to.

> 2. VMware SRM SDK provides APIs that s to determine the name of the Site?

Yes, I'm not sure why you would do that? Typically, you call the SRM API to a stage of order recovery plan. You can share what you intend to use these methods for?

Discover the methods "GetSiteName" and "GetPairedSite" in https://www.vmware.com/support/developer/srm-api/srm_58_api.pdf

Tags: VMware

Similar Questions

  • How to get the list of files for a virtual machine?

    Hello

    Virtual machines can have their files distributed on several issues (even through several data warehouses).

    PowerCLI gives us an easy way to retrieve the data warehouse associated with a virtual (Get-data store) machine, but it doesn't seem to be a built-in method to get the list of all records where a given virtual machine stores all its files. Or maybe I'm just blind ;-)

    Can anyone offer an overview on how to achieve this?

    Thank you

    No, that sounds like a good idea to copy/back up virtual machines.

    I adapted the script. She now returns one row for each unique record

    foreach($vm in Get-VM){
      $folders = $vm.ExtensionData.LayoutEx.File | %{$_.Name.Split('/')[0]} | Sort-Object -Unique  $folders | Select @{N="VM";E={$vm.Name}},@{N="Folder";E={$_}}
    }
    
  • How can I assign a static ip for each virtual machine

    I have the NIC 2 and 3 vm on my vm server.

    I did find documentation how to assign an ip for each virtual computer fix.

    pleas help me... but probably easy...

    Assuming you have the management and the virtual machines on the same network, attach both rising/NIC bindings to the vSwitch0, configure the management network and tie each VM to the port "VM Network" group. As DSTAVERT mentioned, the IP of the virtual machine configuration is done in the VM themselves, as if they were physical systems.

    sample:

    If you have different subnets for the management and the virtual machines, you must either create multiple vSwitches or work with the VLAN.

    André

  • How can I set the Script of customization for all virtual machines in a paralytic

    By using the. ExtensionData method found here: http://communities.vmware.com/thread/392462?start=0 & tstart = 0 (thanks alanrenouf)

    I am able to identify a few comments properties via PowerCLI adjustments.

    My question is how to set the value of CustomizationScript with a client cust simple script?

    Is it possible to store it in a $variable?

    Sample script that I first:

    off @echo

    If "% 1" == "precustomization")

    tasks precustomization echo

    ) ElseIf '%1% ' == 'postcustomization')

    cmd /c schtasks.exe/change /TN "\Microsoft\Windows\Defrag\ScheduledDefrag" /Disable

    )

    Thanks for the help.

    Answered by tests.  It's the double quotes.

    $civapp = get-CIVApp TEST

    $script =

    "@echo off".

    If "" %1% "" is "" precustomization"")

    tasks precustomization echo

    ) ElseIf "" %1% "" == "" postcustomization"")

    cmd /c schtasks.exe/change /TN "" \Microsoft\Windows\Defrag\ScheduledDefrag"" /Disable

    )"

    Foreach ($civm to ($civApp |)) Get - CIVM)) {}

    $GuestCustomization = $civm. ExtensionData.Section | Where {$_.} {GetType () - like "* GuestCustomizationSection"}

    $GuestCustomization.Enabled = $true

    $GuestCustomization.ChangeSid = $false

    $GuestCustomization.ResetPasswordRequired = $false

    $GuestCustomization.CustomizationScript = $script

    $GuestCustomization.UpdateServerData)

    }

    Post edited by: jgreenback

  • How to run a script for all the images in a folder?

    How to run a script for all the images in a folder?

    You can assign your script to an action, then use processor by batch or image with the option apply to all subfolders.

  • How to run a script in environment unix and how to run this program into a toad

    Hello guys
    Please help me!
    How to run a script in the unix environment (Group of programs (cursor, programs...) stored in a file file.sql).

    file.sql luks like this


    WHENEVER OSERROR EXIT FAILURE
    WHENEVER SQLERROR EXIT SQL. SQLCODE
    SET the position
    SET serveroutput size 1000000
    coil ins2aais_jobs;
    SELECT "FILE IS: ins2aais_jobs' FROM dual;"
    SELECT "STARTED:' began, to_char (sysdate," YY/MM/DD HH24:MI:SS) TIME FROM dual; "
    DECLARE
    lv_upd_ct number: = 0;
    lv_ins_ct number: = 0;
    lv_exp_ct number: = 0;
    ---------------------

    date of lv_FROM_date;
    date of lv_to_date;
    lv_mon_or_week varchar2 (20);
    date of lv_week_end_date;
    lv_month_indicator varchar2 (8);
    -------------------------------------------------
    Aais CURSOR IS
    SELECT the ID substr (ID, 1, 7), SSN, FNAME, LNAME
    , SUCCESS, COMPENSATE, INSTALLATION
    , MODU, DRIVE, REVERSE, SUCC_RATE
    TRANS_TOTAL, FILE_NAME, WEEK_END_DATE
    RUN_DATE
    OF weekly_aais;

    -------------------------

    I aais % rowtype;


    -------------------------
    PROCEDURE p_ins (r1 aais % ROWTYPE) IS
    BEGIN
    BEGIN
    INSERT INTO AAIS_JOBS
    (ID, SSN, SUCCESS, COMPENSATE, INSTALL, MODU
    , DRIVE, REVERSE, SUCC_RATE, TRANS_TOTAL
    FILE_NAME, WEEK_END_DATE, RUN_DATE
    AAIS_FNAME, AAIS_LNAME
    )
    VALUES
    (r1.ID, r1. SSN, r1. SUCCESS, r1. COMPENSATE, r1. INSTALLATION, r1. MODU
    r1. DISK, r1. CONVERSELY, r1. SUCC_RATE, r1. TRANS_TOTAL
    r1. File_name, r1. WEEK_END_DATE, r1. RUN_DATE
    r1. FNAME, r1. LNAME
    );
    lv_ins_ct: = lv_ins_ct + 1;
    EXCEPTION
    WHILE OTHERS then
    DBMS_OUTPUT. PUT_LINE ('ERROR IN THE INSERT STATEMENT');
    DBMS_OUTPUT. Put_line (SQLERRM);
    lv_exp_ct: = lv_exp_ct + 1;
    END;

    END;

    ------------------------------

    PROCEDURE p_disp_msg IS
    BEGIN
    DBMS_OUTPUT. Put_line (' number of insertion: ' | to_char (lv_ins_ct));
    DBMS_OUTPUT. Put_line (' number of Exceptions: ' | to_char (lv_exp_ct));

    lv_ins_ct: = 0;
    lv_exp_ct: = 0;
    END;

    ---------------------------

    BEGIN

    lv_FROM_date: = to_date ('& 1', 'DD-MON-RR');
    lv_to_date: = to_date ('& 2', 'DD-MON-RR');
    lv_mon_or_week: = 'and 3';

    lv_month_indicator: = di.get_month_ind (lv_mon_or_week, lv_FROM_date, lv_to_date);

    ------------------------------------

    REMOVE FROM AAIS_JOBS
    WHERE WEEK_END_DATE = lv_to_date;

    -------------------------------------

    COMMIT;

    Aais OPEN;
    LOOP
    EXTRACT the aais IN i;
    OUTPUT WHEN aais % NOTFOUND;
    BEGIN
    p_ins (i);
    END;
    END LOOP;
    Aais CLOSE;

    commit;

    DBMS_OUTPUT. PUT_LINE ('INSERT INTO TABLE JOBS AAIS');
    p_disp_msg;


    -----------------------------------

    END;
    /
    SELECT "FINISHED: ' | '. TO_CHAR (sysdate, "MM/DD/YY HH24:MI:SS'") FROM dual
    /
    spool off
    "exit";


    and also how we organize this into a toad?


    Thank you.

    Hello

    You vous connecter connect to oracle through unix and SQL prompt, run these commands in a .sql file.

    Toad, you can run the instructions individually by selecting the sql statements or in a set with the F5 key.

    Kind regards
    AJR

  • How to disable auto-start for the virtual machine at the start of merger?

    Hi all

    I use Fusion 2.0.4 to run different OSs and have 4 different virtual machines that are installed. But whenever I start the merger, regardless of the previous state when I stopped him, he starts a specific virtual machine. How to avoid this? I want to start just merge and then choose which machine to start.

    TIA.

    Hello

    Welcome to the VMware Forums!

    In the virtual machine library, there is a star in the list of your virtual machines that you can click and she acts as a toggle to start the virtual machine on the opening of Fusion.

    It is somewhat a weird UI design choice, don't know me either until someone reminded last week.

    --

    Wil

    _____________________________________________________

    Visit VMware developers at http://www.vi-toolkit.com wiki

  • I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    Hi gurrus and LucD

    I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    The script should search for information in a multiple Vcenter servers and multiple clusters and list all the VMs name, status (two powers on or off) with type card NETWORK Type E1000 only no other.

    Concerning

    Nauman

    Try like this

    $report = @)

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    foreach ($vm in (Get-VM-location the $rp |)) Where {Get-NetworkAdapter - VM $_______ | where {$_.}} Type - eq "e1000"}})) {}

    $report += $vm. Select @{N = "VM"; E={$_. Name}},

    @{N = 'vCenter'; E={$_. Uid.Split('@') [1]. "Split(':') [0]}},"

    @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}}

    }

    }

    }

    $report | Export Csv C:\temp\report.csv - NoTypeInformation - UseCulture

  • How to find the age of a child and snapshot number snapshot for a virtual machine.

    Hi all

    How to find the age of a snapshot for a virtual machine child count and snapshot.

    This code snippet should help... Assuming that you have the following entries:

    VM (VC:VirtualMachine)

    snapshot (VC:VirtualMachineSnapshot)

    System.log("====== Snapshot details for VM: "+snapshot.config.name+" ======");
    var snapshotTrees = vm.snapshot.rootSnapshotList;
    System.log("Snapshot Tree Count: "+snapshotTrees.length);
    for each (snapshotTree in snapshotTrees){
        showSnapshotInfo(snapshotTree, snapshot);
    }
    
    function showSnapshotInfo(snapshotTree, selectedSnapshot){
        if(selectedSnapshot == snapshotTree.snapshot){
            System.log("====================");
            System.log("Name: "+snapshotTree.name);
            System.log("Id: "+snapshotTree.id);
            System.log("Description: "+snapshotTree.description);
            System.log("createTime: "+snapshotTree.createTime);
            System.log("quiesced: "+snapshotTree.quiesced);
            System.log("replaySupported: "+snapshotTree.replaySupported);
            System.log("backupManifest: "+snapshotTree.backupManifest);
            System.log("snapshot id: "+snapshotTree.snapshot.id);
            System.log("state: "+snapshotTree.state.value);
            var childSnapshotList = snapshotTree.childSnapshotList;
            if(childSnapshotList != null){
                System.log("childSnapshotList length: "+snapshotTree.childSnapshotList.length);
            }
            System.log("");
        }
        if(snapshotTree.childSnapshotList != null){
            System.log("Children found: "+snapshotTree.childSnapshotList.length);
            for each (childSnapshotTree in snapshotTree.childSnapshotList){
                showSnapshotInfo(childSnapshotTree, selectedSnapshot);
            }
        }
    }
    

    During the passage of one of my virtual machines, here is an example of output I get:

    [2014-06-12 15:19:21.493] [I] Snapshot Tree Count: 1
    [2014-06-12 15:19:21.493] [I] ====================
    [2014-06-12 15:19:21.494] [I] Name: before upgrade to 5.0.1
    [2014-06-12 15:19:21.494] [I] Id: 31
    [2014-06-12 15:19:21.494] [I] Description:
    [2014-06-12 15:19:21.495] [I] createTime: Mon Mar 19 2012 13:48:57 GMT-0400 (EDT)
    [2014-06-12 15:19:21.495] [I] quiesced: false
    [2014-06-12 15:19:21.495] [I] replaySupported: null
    [2014-06-12 15:19:21.495] [I] backupManifest: null
    [2014-06-12 15:19:21.496] [I] snapshot id: snapshot-83
    [2014-06-12 15:19:21.496] [I] state: poweredOff
    [2014-06-12 15:19:21.496] [I] childSnapshotList length: 1
    [2014-06-12 15:19:21.496] [I]
    [2014-06-12 15:19:21.497] [I] ====================
    [2014-06-12 15:19:21.497] [I] Name: Before 5.1 upgrade
    [2014-06-12 15:19:21.497] [I] Id: 36
    [2014-06-12 15:19:21.497] [I] Description:
    [2014-06-12 15:19:21.498] [I] createTime: Fri Sep 21 2012 21:59:58 GMT-0400 (EDT)
    [2014-06-12 15:19:21.498] [I] quiesced: false
    [2014-06-12 15:19:21.498] [I] replaySupported: null
    [2014-06-12 15:19:21.498] [I] backupManifest: null
    [2014-06-12 15:19:21.499] [I] snapshot id: snapshot-84
    [2014-06-12 15:19:21.499] [I] state: poweredOff
    [2014-06-12 15:19:21.499] [I] childSnapshotList length: 1
    [2014-06-12 15:19:21.499] [I]
    [2014-06-12 15:19:21.500] [I] ====================
    [2014-06-12 15:19:21.500] [I] Name: Before Named Instance
    [2014-06-12 15:19:21.500] [I] Id: 37
    [2014-06-12 15:19:21.501] [I] Description:
    [2014-06-12 15:19:21.501] [I] createTime: Mon Nov 11 2013 13:40:46 GMT-0500 (EST)
    [2014-06-12 15:19:21.501] [I] quiesced: false
    [2014-06-12 15:19:21.501] [I] replaySupported: null
    [2014-06-12 15:19:21.502] [I] backupManifest: null
    [2014-06-12 15:19:21.502] [I] snapshot id: snapshot-236
    [2014-06-12 15:19:21.502] [I] state: poweredOff
    [2014-06-12 15:19:21.502] [I]
    
  • How to check the file for the virtual machine size Esxi shell

    Anyone who can tell me how to check the file for the virtual machine size Esxi Shell. I tried this command-h ls but does not work.

    Have you checked "ls-lh', it will provide information as the attached screenshot." "

  • How to get the moref vCenter for a virtual machine

    I use with the vCloud orchestrator plugin.  I would like to understand how I can access the moref for a virtual machine identifier (as see vcenter) that is contained in a vCloud VAPP.

    Thank you

    Here is something I wrote to do. It uses the query service.

    Note that to be able to do, you need your plugin vCD to be connected to the org of system and use the administrator credentials.

    var vcdHost = vm.getHost();
    var vApp = vm.parent;
    
    var vms = new Array();
    var queryService = vcdHost.getQueryService();
    
    expression = new VclExpression(VclQueryAdminVMField.CONTAINER, vApp.getReference().href, VclExpressionType.EQUALS);
    filter = new VclFilter(expression);
    params = new VclQueryParams();
    params.setFilter(filter);
    
    var resultSet = queryService.queryRecords(VclQueryRecordType.ADMINVM, params);
    while (resultSet != null) {
        var records = resultSet.getRecords(new VclQueryResultAdminVMRecord());
        System.log(records.length + " VM records found");
        for each (var record in records) {
            if (record.name == vm.name) {
                return record.moref;
                }
    
        }
        resultSet = resultSet.getNextPage();
    }
    return null;
    

    Christophe.

  • Looking for a Script to extract information for a virtual machine

    HiEvryone

    Looking for a Script pull information for a virtual of VC machine what operating system installed (2003, 32-bit or 64-bit, 2008 etc), vCPU and memory allocated and State. Output in CSV format.

    Thank you

    vmguy

    You mean something like this

    Get-VM |
    Select Name,NumCpu,MemoryMB,PowerState,@{N="OS";E={$_.Guest.OSFullName}} |
    Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture
    
  • How to configure the CD driver on the host for a virtual machine?

    After you create a virture machine and put the CD of driver on host, when powered on the vertual machine, may not start the drive form the CD only from NIC.

    How to configure the CD driver on the host for a virtual machine?

    Right-click on the virtual computer and go to edit settings. Click the Options tab and under the tip list, there should be Boot Options. Enter an amount of milliseconds to wait before your boot, so you can activate the CD-ROM. You can also activate the CD even if it boots to the NETWORK card option, and then reset the virtual machine. Get the focus of this virtual machine on the console session, and then press ctrl-alt-insert. Your CD-ROM will stay connected if you do not want to delay the startup process.

  • How to change network name for all virtual machines within the same cluster

    We have recently changed name vswitch to take into account that something significant, in the past vCenter could change the labels of networh for all virtual machines... seems this time help labels are not changed (maybe its got something to do with the update vcenter for 2.5.U3)...

    in any case, someone at - it a powershell script that could find all the virtual machines that are referring to the old label network and then changing again the name... ?

    Enjoy the respponses...

    Thanks in advance

    A few things on this blog could help.

    If you know the names you want to use, you could also just use something like:

    Get-Cluster X | Get-VM | Get-NetworkAdapter | Where { $_.NetworkName -eq "OldNetwork" } | Set-NetworkAdapter -NetworkName "NewNetwork" -confirm:$false
    Get-Cluster X | Get-VM | Get-NetworkAdapter | Where { $_.NetworkName -eq "NewNetwork" } | Set-NetworkAdapter -Connected:$true -confirm:$false
    
  • How can I change the looks of Access Infrastructure Web location for the virtual machine files?

    How can I change the looks of Access Infrastructure Web location for the virtual machine files?

    My default is set to MACHINES C:\VIRTUAL.  But I want to change it to turn to an external drive connected with an eSata cable. Can I do this?

    Hello

    Add just like a new data store.

    Login to your web access, select your host (not the virtual machines) in the left menu.

    You should see a link on the right side with "Add data store", give it a name of store and add the directory.

    Now, you can add a virtual machine to this place.

    Good luck!

    --

    Wil

    _____________________________________________________

    Visit VMware developers at http://www.vi-toolkit.com wiki

Maybe you are looking for

  • Compatibility of screen Tecra M2.

    I need to buy a replacement for a Tecra M2 PTM20E 01KWY screen - 7 d. Do you know how many pins the connection for this model? I find it difficult to find this information. I don't know what to buy.

  • Add fonts

    Hi all I need add fonts to the CVI for (especially 128) barcode. I copied the fonts in Windows/Fonts, and I guess that ICB will detect it after that. Some time, it didn't. What should I do? Best regards.

  • trying to get pictures on camera file to go on one file for facebook

    try to get images of the camera file in a file to put on facebook

  • Windows 7 automatically by clicking links

    I know that this subject has been discussed elsewhere, but the proposed solutions do not work for me. I am using windows 7 pro with a dell latitude d630. I have a touchpad and no mouse. Windows constantly moving my cursor until I finished my task and

  • BI Publisher Excel Template test fails

    Hi people,This forum has been a great source of information. I'm developing a simple report in Excel to the BI Publisher in outstanding balances. A document XML generated and used the worksheet BlankTemplate provided with BI Publisher Desktop in the