PowerCLI - how to distinguish the true placeholder SRM vm

Hello

I'm using PowerCLI to list all the vm that are in my vCenter but I am be double file for some of the vm.

I checked in vCenter and found that what I'm be are real and SRM placeholders on the same list, how VM pouvez I distinguish real vm to SRM placeholder in PowerCLI?

To extract all the virtual machines that are not placeholders of SRM, you can use the following command PowerCLI:

Get - VM | Where-Object {$_.} ExtensionData.Config.ManagedBy.ExtensionKey - don't "com.vmware.vcDr"}

SRM spaces reserved to retrieve only the virtual machines, you can use the following command PowerCLI:

Get - VM | Where-Object {$_.} ExtensionData.Config.ManagedBy.ExtensionKey - eq "com.vmware.vcDr"}

Tags: VMware

Similar Questions

  • How to distinguish the physical interface and logic (subinterface) interface to the Cisco router/Switch?

    Hi Expert,

    How to distinguish the physical interface and logic (subinterface) interface to the Cisco router/Switch? Can you please clarify a formal way for this so have?

    A physical interface is numbered with the same name of the interface when printing on the physical port. For example "GigabitEthernet 0/1" corresponds to port 1 of the 0 module (or the base unit).

    A logical interface can be a subinterface on a routed port and will have a point ("". "") preceding the number sous-interface (ex. GigabitEthernet 0/1.1). It can also be a loop or a virtual interface (on a router this could also include interfaces like the tunnel and virtual tunnel or VTI types). A switch may also have a VLAN logical interfaces (e.g. interface vlan 1) which are used as layer 3 virtual interfaces of type.

  • How to distinguish the figures and characters from a string

    I am looking for a simple way to do this or any built-in subVIs that can do this.

    I have 3 strings "1234c", "ab3dc". 'XYA', I want to identify those who have numbers and to reclaim all of the numbers. So an important step is to distinguish the character numeric and non-numeric characters. How can I do it in Labview with subVIs integrated?

    Thank you

    [0-9] is looking for a number, "+" makes the search for 1 or more of them (it is "greedy", so it will get as many as there are has).  I added a rope in addition to your list to show that the Pattern Match will match only the first instance of a number.  If there's a chance you have data as the last element that you need to run it in a loop.  Decimal string number can also work if a figure is the first character that it finds.

  • How to distinguish the events within an EventHandler?

    Hi all,

    being a newbe in JavaFX I try to distinguish the different eventtypes.

    I try to produce a MouseEventHandler accepting soe as MOUSE_DRAGGED and MOUSE_PRESSED events

    for the calculation of how mouse took and use it to translate my graphics nodes.

    I still don't really understand what is the correct syntax.

    something like

    If (event.getEventType instanceof MouseEvent.MOUSE_PRESSED ())

    {

    ...

    }

    obviously does not work.

    something like

    switch (event... getEventType())

    {

    case MOUSE_PRESSED:

    ...

    }

    also isn't the right way.

    Is it possible to tell them apart?

    Thank you very much in advance

    Malta

    if (event.getEventType() == MouseEvent.MOUSE_PRESSED) {
    // ...
    }
    

    should work.

    I've never done this, fwiw. I always just save different implementations of listener for different event types:

    node.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler() {
         @Override
         public void handle(MouseEvent event) {
              // handle mouse pressed
         }
    });
    
    node.addEventHandler(MouseEvent.MOUSE_RELEASED, new EventHandler() {
         @Override
         public void handle(MouseEvent event) {
              // handle mouse released
         }
    });
    

    In Java 8 this will get much less verbose (using lambda expressions).

  • How to distinguish the form as textfield element

    I use the following script to disable all elements on the page:

    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount ++) {}

    var oFields = xfa.layout.pageContent (nPageCount, "field");
    var nNodesLength = oFields.length;
    Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount ++) {}
    If (oFields.item (nNodeCount) .access! = "readOnly")
    {
    oFields.item (nNodeCount) .access = "readOnly";
    }
    }

    I have a requirement where I have to disable only the textfields. So, can someone please help me with how to get the field of a particular field type.

    Thank you.

    Paul approach is good. But it requires the developer to follow a specific naming standard.

    Here is my code that makes the TextFields readOnly fields regardless of the name of the field.

    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
        {
             var oFields = xfa.layout.pageContent(nPageCount, "field");
             var nNodesLength = oFields.length;
    
             for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
             {
                   var ref = oFields.item(nNodeCount).getElement("ui");
    
                  if(ref.nodes.item(0).className=="textEdit")                    // If the field is a TextBox, then proceed
                  {
                       if(oFields.item(nNodeCount).access != "readOnly")
                       {
                           // Set the field property.
                            oFields.item(nNodeCount).access = "readOnly";
                       }
                  }
             }
        }
    

    I would like to know if you want...

    Nith

  • How to distinguish the samples from 6 different inputs analog

    Hello everyone, I'm still new to NOR-DAQmx. I write a C++ program that reads 6 analog inputs of the card PCI-6220.

    Basically, I created 6 virtual channels in a single task, looks like I'm acquisition of required inputs.

    However, the problem is that I don't know which sample comes from what analog input channel. I put the fill mode "DAQmx_Val_GroupByChannel".

    Please help me, how can I distinguish between samples of different analog inputs.

    Best regards from Kazakhstan,

    Khassan

    Khassan,

    Channel order would be decided in the order in which you added your channels to the task.  So let's say I create a task and adds three channels and add them in the order ai0 ai1 and ai2.  If I set the fill to "DAQmx_Val_GroupByChannel" mode, DAQmxRead will copy data in "readArray' such that ai0 data all together, followed by the data of ai1, which is followed by the data of ai2.  The size of each of these sections of the buffer must be returned through the 'sampsPerChanRead' argument to read.  So if were to call read and DAQmx returned 5 for "sampsPerChanRead", then my data buffer would look like this:

    AI0, ai0, ai0, ai0, ai0, ai1, ai1, ai1, ai1, ai1, ai2, ai2, ai2, ai2, ai2

    Hope that helps,

    Dan

  • To Powercli how to get the actual number of the paths to the data details store

    I'm looking for a command Powercli get the real number of the paths to the data store > Details of the data store

    See you soon,.

    Vincent

    You can do something like this

    $esxName = "MyEsx".

    $esx = get-VMHost-name $esxName

    $esxcli = get-EsxCli - VMHost $esx

    $esxcli.storage.vmfs.extent.list () |

    Select VolumeName,ExtentNumber,@{N='Device'; E={$_. DeviceName}},

    @{N = ' path # ';} E = {}

    $esxcli.storage.core.path.list ($_.) DeviceName) | Measure-object | Select Count - ExpandProperty

    }}

  • VMware View | PowerCLI | How to get the number of virtual machine in a specific pool-ID

    Hello

    Generally, to get the number of VMS in a pool, I run this command:

    Get-pool | Select Pool_id, @{Name = "NumVM"; Expression = {($_ |)} (Get - DesktopVM). County}} | out-gridview

    But how can I list all the pools and then select the pool I want a county of?

    Maybe something like:

    Select 1 for accounts

    Select 2 for Marketing

    and then County VM just for this pool and immediate where at the output (Out-gridview or Export-CSV)

    Thanks, Julien

    Hi LucD

    I don't understand the line:

    1.. $pools. County | %{
    Write-Host "$_" $Pools [$_ - 1]. Name

    Why do we need the 1...

    Also is the same as get-get-resourcepool pool?

    Thanks, Julien

  • How to set the alarm in SRM

    I configured SRM alarm in order to find if the remote site is inaccessible, but l can't find a setting for "Repeat alarm triggered each X minitues.

    By default it send alerts every 5 minutes.

    Alarm.png

    Thanks again,

    SRM UI can you please do a right click on your site XXX (Local), select "Advanced settings" and then validate that all the parameters in the section "remoteSiteStatus" are according to the default values in my attachment?

    Thank you

    Stefan

  • How to distinguish the same fields of XML to RTF model?

    Hi friends,

    I am using the XML file as a data source and create running in peoplesoft.
    There are two data fields same "DESCR", which are the filling running.
    Now if we run report, second field 'DESCR' shows value of the first field "DESCR".

    How to avoid above question, if same data fields in a single RTF model?

    You can have as


    I think that's what you need.

  • How to distinguish the SQL capabilities of PL/SQL?

    I m having trouble understanding what functions is used ONLY in SQL and are used in regular expr instructions (IE, variable assignment,). Can someone show me a list of each or maybe a URL to look for?

    I have searched through the guide and reference is the developer, but could not find an indication appropriate in a place that it is clear.

    For example, I thought that I can use the CAST function in a variable assginment as follows:
    declare
     cursor myCur is SELECT Value_varchar2(1) FROM table WHERE id = 1;
     myRec myCur%ROWTYPE;
     var_a NUMBER(1);
    begin
     OPEN myCur;
     FETCH myCur INTO myRec;
     CLOSE myCur;
    
     var_a := CAST(myCur.Value_varchar2(1) AS NUMBER(1));
     DBMS_OUTPUT.PUT_LINE('var_a = ' || TO_CHAR(var_a));
    end;
    . 
    It seems that CAST function can ONLY be used in an SQL statement, but no doc has so far only?

    Edited by: HappyJay 05/12/2010 12:05

    In PL/SQL, drop the length specifier when you cast:

    SQL> exec dbms_output.put_line(cast('123' as number(5)));
    BEGIN dbms_output.put_line(cast('123' as number(5))); END;
    
                                                   *
    ERROR at line 1:
    ORA-06550: line 1, column 48:
    (blah blah blah)
    
    SQL> exec dbms_output.put_line(cast('123' as number));
    123
    
    PL/SQL procedure successfully completed.
    
  • How to get the lov value(true/false) that is running by pressing the F3 function key

    Hello

    I mapped key F3 function for list of values (lov), pressing F3 on the element of text (with associated lov) poster lov, but here the lov is implicitly run, so I am unable to get the value of lov(true/false), how to get the true or false value from the lov.

    I use Oracle forms 11 GR 2.

    What exactly do you mean by "the true or false value of the lov? Want to know if the user chose something from the lov. If so, you can create a KEY-LISTVAL-trigger on your textitem with something like

    IF SHOW_LOV('THE_NAME_OF_THE_LOV') THEN
      -- do something here
    END IF;
    
  • How to get the inline query which is drawn from the TAB specific Application.

    Hi all I use 10.2.0.4.0 oracle version.

    I want to capture the sql that is raised in my prod database when an applicaton tab is hit as it takes about 5 minutes for the tab to be loaded. So is it possible, for the inline sql, which is the origin of the problem, directly from the prod environment.

    (Note: I looked through the browser session in PROD DB for the query, but there, I found a lot of meetings and a lot of requests, I do not know how to distinguish the session being created by the specific tab I hit).

    >

    Hello

    I want to capture the sql that is triggered to my database of prod
    When an applicaton tab is hit as it takes about 5 minutes so that the tab
    to be loaded. So is it possible to get the inline sql, which is
    the origin of the problem, directly from the prod environment.

    Please, please tell us that you have a Test environment? Log into that, then run a trace.
    No doubt you can either descend all test for a few miinutes and/or
    easily distinguish sessions on your Test System? That's exactly what the test
    the environments are for.

    The SQL execution will be the same - you can go try to find
    the root cause of the problem.

    HTH,

    Paul...

  • How to extend the ralations duplicate?

    Hi all
    I tableA (code, street_name, street_number, att1, att2) and theres duplicate code, street_name and street_numbers.
    I have found using code duplication:
    Select code from tableA where code in (select code from tableA group by code having count (*) > 1)
    but at the same time, the code has been changed and I have other code and the old street_name and the old street_number
    so tableA now have:
    oldCODE, street_name, street_number and newCODE, street_name, street_number - double street_name and street_number!.
    tableA have 7000 files.
    Question how is this double street_name and street_number with this different code (old and new CODE)?
    Thanks in advance
    Gordan

    Published by: useruseruser on August 25, 2008 09:48

    Here is a test:

    SQL> with tbl as
      2  (select 1 id, 'str1' str, 12 nb from dual union all
      3   select 2 id, 'str1' str, 12 nb from dual union all
      4   select 3 id, 'str1' str, 12 nb from dual union all
      5   select 4 id, 'str2' str, 13 nb from dual union all
      6   select 5 id, 'str3' str, 14 nb from dual)
      7  select str, nb, max(ltrim(sys_connect_by_path(id,' - '),' -')) keep (dense_rank last order by length(sys_connect_by_path(id,' - ')))dup_id
      8  from   tbl
      9  connect by prior id < id and prior str = str and prior nb = nb
     10  group by str, nb
     11  having count(*)>1;
    
    STR          NB DUP_ID
    ---- ---------- --------------------------------------------------------------------------------
    str1         12 1 - 2 - 3
    
    SQL>
    

    However, not sure how to distinguish the old code and the new.

    Nicolas.

  • PowerCLI 5.5 R2 and SRM - how to check the status of a Recovery Plan?

    I need to write a script that will examine the current status (apparently called a "RunMode") of a Recovery Plan, is the appropriate status (1 = Test, 3 = cleaning), then get a list of all virtual machines in a suitable specific folder and they will light up (wait 15 seconds between move them on to the next). There are reasons why the Recovery Plan cannot be responsible to do, so why do I need to write a script (the reasons have nothing to do with PowerCLI). And I have problems with the first part, determination of status.

    I have this (I won pretty well most of this pure and simple of the blog of Ken Werneburg. Thank you, Ken!) :

    $DR_vCenter = "xxxxxx".

    $SRM = connect-SrmServer-Server $DR_vCenter

    $SRM_API = $SRM. ExtensionData

    $PlanMoRef = $SRM_API. . Moref Recovery.ListPlans () [2]

    (My plan is #2, others their test plans. I checked this by looking at the name of each plan. And all the good things I want is in this 'moref,"apparently...)

    $HistoryMoRef = $SRM_API. Recovery.GetHistory ($PlanMoRef)

    (it's the history of the races of this plan. Here it is the story of the last race)

    $HistoryMoRef.GetRecoveryResult (1)


    Key: 68835

    Plan: VMware.VimAutomation.Srm.Views.SrmRecoveryPlan

    Name: Recovery_Plan_PHA

    Description:

    StartTime: 15/07/2014 11:03:15

    StopTime: 15/07/2014 11:09:29

    ExecutionTimeInSeconds: 374

    TotalPausedTimeInSeconds: 0

    ResultState: success

    RunMode: CleanupTest

    WarningCount: 0

    ErrorCount: 0

    SO: I understand how to get the history of the plan that I want, and it's more progress. The problem I have is that if the RunMode is a specific value (either "Test" or "Failover", then I need to launch other actions (power of virtual machines.) And I can't seem to do. «$HistoryMoRef.GetRecoveryResult (1).» RunMode"is empty return. I don't know how it is that the value of "CleanupTest".

    How can I query the RunMode, to see if it is a value which I am interested in?

    $HistoryMoRef.GetRecoveryResult (1) | GM


    TypeName: VMware.VimAutomation.Srm.Views.SrmRecoveryResult


    Name MemberType definition

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

    Equals method Boolean Equals (System.Object, obj)

    GetHashCode method int GetHashCode()

    Type of the method GetType GetType()

    String the ToString ToString() method

    Description property System.String Description {get; set ;}}

    ErrorCount property System.Int32 ErrorCount {get; set ;}}

    ExecutionTimeInSeconds property System.Int64 ExecutionTimeInSeconds {get; set ;}}

    Key key of System.Int32 property {get; set ;}}

    Property System.String name {get; set ;}}

    Plan of property VMware.VimAutomation.Srm.Views.SrmRecoveryPlan {get; set ;}}

    ResultState property VMware.VimAutomation.Srm.Views.SrmRecoveryResultResultState ResultState {get; set ;}}

    RunMode property VMware.VimAutomation.Srm.Views.SrmRecoveryPlanRecoveryMode RunMode {get; set ;}}

    StartTime property System.DateTime StartTime {get; set ;}}

    StopTime property System.DateTime StopTime {get; set ;}}

    TotalPausedTimeInSeconds property System.Int64 TotalPausedTimeInSeconds {get; set ;}}

    WarningCount property System.Int32 WarningCount {get; set ;}}

    Thank you

    Well, I managed to reproduce the problem and to understand what might happen.

    First the error "you can not call a method on an expression evaluated to null." seems to be linked to the "Write-Output"PG ="$pg" line. When I remove the error to go away (I'm not a person of PowerShell so don't know why this is the case).

    The second error (not not being filled seems to be linked to how they make the connection virtual computers SRM.) Specifically, you will need to establish the connection of VC and then do SRM login without specifying the SRM server, let that be determined by searching the SRM recorded with the VC you are connected to.

    The following code worked in my environment when it is connected to the protected so site full of hope that it will work for you as well:

    SE connect-VIServer-Server $protectedSiteVC - user $user-password $pass

    Connect-SrmServer-user $user-password $pass

    Write-Host "implementation details on Protection groups.

    Get-ProtectionGroup | {ForEach-Object

    $pg = $_

    Get-ProtectedVM - ProtectionGroup $pg} | {ForEach-Object

    #Write - Output 'do for each virtual computer.

    $output = "" | Select VmName, PgName

    $_. Vm.UpdateViewData)

    $output. VmName = $_. Vm.Name

    $output. PgName = $pg. GetInfo(). Name

    $output

    } | Format-Table @{Label = 'Name of the virtual computer'; Expression = {$_.} VmName}}, @{Label = 'Protection Group name'; Expression = {$_.} PgName}

    }

Maybe you are looking for