Question

Get AHV VM NIC - Server Error 500

  • 23 August 2019
  • 5 replies
  • 2464 views

Badge
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!

5 replies

Userlevel 2
Badge +2
Hi @TimothyGaray . Is this perhaps related to my observations about connection to the cluster using the latest cmdlets I raised here ? https://next.nutanix.com/scripts-32/latest-powershell-cmdlets-for-5-11-33194
Badge
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
Userlevel 4
Badge +19
@TimothyGaray
This command works fine in PE. Let me check internally and get back.
Badge
Are you querying Prism Central or Prism Element? The Powershell Cmdlets are built on v1 API which only works with Prism Element AFAIK.
Badge
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

Reply