Automation

 View Only
  • 1.  Adding a SATP rule using esxcli

    Posted Mar 10, 2011 04:19 PM

    Hi,

    I'm trying to replicate the following esxcli command using the esxcli cmdlet

    esxcli nmp satp addrule --vendor="Pillar" --claim-option="tpgs_on" --satp="VMW_SATP_ALUA" --description="Pillar Axiom ALUA Support"

    I started with this


    connect-viserver <myEsxHost>

    $esxcli=Get-Esxcli

    $esxcli.nmp.satp.listrules() |  group-Object –Property "Vendor" # to list all satp rules defined

    $esxcli.nmp.satp.addrule("tpgs_on","Pillar Axiom ALUA Support",$null,$null,$null,$null,$null,$null,$null,"VMW_SATP_ALUA",$null,"PILLAR")


    The remote server returned an error: (500) Internal Server Error.
    At line:1 char:25
    + $esxcli.nmp.satp.addrule <<<< ( "tpgs_on", "Pillar Axiom ALUA Support", $null, $null, $null, $null, $null, $null, $null, "VMW_SATP_ALUA", $null, "PILLAR")
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : MethodInvocationException

    any idea of what I'm doing wrong ?



  • 2.  RE: Adding a SATP rule using esxcli

    Broadcom Employee
    Posted Mar 10, 2011 08:01 PM

    After connecting to the ESX host, you should first issue:

    $esxcli = Get-EsxCli

    Now you can proceed using the esxcli through the $esxcli variable.



  • 3.  RE: Adding a SATP rule using esxcli

    Posted Mar 10, 2011 08:18 PM

    thanks avlleshout.

    I just miss to include it in my example but I did it in my script.

    The esxcli.nmp.satp.listrules() |  group-Object –Property "Vendor" cmdlet that I'm using to get the defined rules is working as expected.

    The issue I have is with the addrule() method.



  • 4.  RE: Adding a SATP rule using esxcli
    Best Answer

    Posted Mar 11, 2011 02:23 PM

    Hi,

    I tried the same call. The first time it passed without problems and returned true. The second time it throw the internal server error. Probably the reason is that the rule already exist. Can you try it on another host?

    Vitali

    PowerCLI Team



  • 5.  RE: Adding a SATP rule using esxcli

    Posted Mar 11, 2011 03:04 PM

    Hi,

    Vitali you're right!

    The error message is not clear but the rule have been created.

    I know that because using the esxcli command line I get a (much more useful) duplicated rule error message.

    I tried to check the existence of the new rule using the listrules() method

    $esxcli.nmp.satp.listrules() | ft

    but I can't find any information regarding my rule.

    Are you getting different results ?

    Thanks



  • 6.  RE: Adding a SATP rule using esxcli

    Posted Mar 11, 2011 03:06 PM

    I seem to experience the same thing here, I can add a rule (nor error) but I can't seem to list it.



  • 7.  RE: Adding a SATP rule using esxcli

    Posted Mar 11, 2011 03:32 PM

    Hi,

    I can't see the rule with listrules(). Also check esxcli excutable within the ESX console - the rule does not appear there. I'm not sure where's the problem.

    About the error messagae - I will file a bug to check is it possible to obtain the detailed error message thrown by esxcli method call.

    Vitali



  • 8.  RE: Adding a SATP rule using esxcli

    Posted Mar 11, 2011 03:40 PM

    Nice.

    Anyway the new "hidden" rule seems working fine because I successfully changed the RR default settings.

    Thanks

    Fabio