VMware Cloud Community
fsecchia
Contributor
Contributor
Jump to solution

Adding a SATP rule using esxcli

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 ?

Reply
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

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

View solution in original post

Reply
0 Kudos
7 Replies
avlieshout
VMware Employee
VMware Employee
Jump to solution

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

$esxcli = Get-EsxCli

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

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
Reply
0 Kudos
fsecchia
Contributor
Contributor
Jump to solution

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.

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

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

Reply
0 Kudos
fsecchia
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
admin
Immortal
Immortal
Jump to solution

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

Reply
0 Kudos
fsecchia
Contributor
Contributor
Jump to solution

Nice.

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

Thanks

Fabio

Reply
0 Kudos