Get AHV VM NIC - Server Error 500 | Nutanix Community
Skip to main content
Question

Get AHV VM NIC - Server Error 500

  • August 23, 2019
  • 5 replies
  • 2479 views

Forum|alt.badge.img
Using PowerShell and AOS 5.11 and same version cmdlets...

I have an AHV VM in the object $VM that I retrieved from Prism Central.

I'm trying to retrieve the NIC information but I keep getting an error:

PS E:\Scripts> get-ntnxvmnic -vmid $vm.uuid -IncludeAddressAssignments
Error occurred while getting NIC list of VM
get-ntnxvmnic : The remote server returned an error: (500) Internal Server Error.
At line:1 char:1
+ get-ntnxvmnic -vmid $vm.uuid -IncludeAddressAssignments
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Nutanix.Prism.Common.NutanixCluster:NutanixCluster) [Get-NTNXVMNIC], WebException
+ FullyQualifiedErrorId : {"message":"Error occurred while getting NIC list of VM"},Nutanix.Prism.PS.Cmds.Acropolis.GetVMNIC


I get a similar error if I specify the UUID (this VM only has 1 NIC):

PS E:\Scripts> get-ntnxvmnic -vmid $vm.uuid -nicid $vm.virtualNicUuids -IncludeAddressAssignments
For input string: "Sy"
get-ntnxvmnic : The remote server returned an error: (500) Internal Server Error.
At line:1 char:1
+ get-ntnxvmnic -vmid $vm.uuid -nicid $vm.virtualNicUuids -IncludeAddre ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Nutanix.Prism.Common.NutanixCluster:NutanixCluster) [Get-NTNXVMNIC], WebException
+ FullyQualifiedErrorId : {"message":"For input string: \"Sy\""},Nutanix.Prism.PS.Cmds.Acropolis.GetVMNIC


Any idea why I am getting this error? I've tried against other VMs and get the same thing.

Thanks!
This topic has been closed for comments

5 replies

andymlloyd
Forum|alt.badge.img+2
  • Trailblazer
  • 13 replies
  • August 24, 2019

Hi @TimothyGaray .

Is this perhaps related to my observations about the connection to the cluster using the latest cmdlets I raised here?

https://next.nutanix.com/scripts-32/latest-powershell-cmdlets-for-5-11-33194


Forum|alt.badge.img
  • Author
  • Adventurer
  • 4 replies
  • August 26, 2019
Thanks @andymlloyd, I do include the -ForcedConnection switch to my Connect-NTNXCluster and am able to get other information. It is just the NIC information that is resulting in the error.

I'm not overly stressed about it since looking in the Prism Central UI it doesn't look like I would get much additional information from that other than the MAC address.

I have a script that retrieves detail VM information from VMware and I wanted to add as much information as I could from AHV VMs as well to the report.

-TimG

sandeepmp
Nutanix Employee
Forum|alt.badge.img+19
  • Nutanix Employee
  • 64 replies
  • August 26, 2019

@TimothyGaray

This command works fine in PE. Let me check internally and get back.


Forum|alt.badge.img
  • Nutanix Employee
  • 3 replies
  • September 4, 2019
Are you querying Prism Central or Prism Element? The Powershell Cmdlets are built on v1 API which only works with Prism Element AFAIK.

Forum|alt.badge.img
  • Author
  • Adventurer
  • 4 replies
  • September 4, 2019
conradcorbett wrote:

Are you querying Prism Central or Prism Element? The Powershell Cmdlets are built on v1 API which only works with Prism Element AFAIK.


Prism Central - I get everything else ok.

-TimG