In the last few days, I have been ramping back up on NSX-T usage, especially as I take a closer look at VMware Pivotal Container Service (PKS) which hopefully I will be able to share more with an upcoming blog series (at least, thats the plan when I find some spare time). While working on some Automation using the NSX-T REST APIs and the new NSX-T PowerCLI cmdlets, I found it to be pretty challenging and frustrating to troubleshoot NSX-T error messages thrown from the PowerCLI cmdlets.
For example, below is a PowerCLI snippet which I wrote to create a new T1 Logical Router in NSX-T.
$edgeClusterService = Get-NsxtService -Name "com.vmware.nsx.edge_clusters" $edgeCluster = $edgeClusterService.list().results | where { $_.display_name -eq "Edge-Cluster-01" } $logicalRouterService = Get-NsxtService -Name "com.vmware.nsx.logical_routers" $lrSpec = $logicalRouterService.Help.create.logical_router.Create() $lrSpec.display_name = "Foo" $lrSpec.router_type = "TIER1" $lrSpec.high_availability_mode = "ACTIVE_STANDBY" $lrSpec.failover_mode = "FAILOVER_MODE_PREEMPTIVE" $lrSpec.edge_cluster_id = "ea655f88-e184-47fe-9352-8ab9d8c955a7" $lrAdd = $logicalRouterService.create($lrSpec)
However, when I ran the code, PowerCLI threw back a pretty generic and useless error which I am sure some of you have probably seen before "A server error occurred: 'com.vmware.vapi.std.errors.invalid.frequest': . Check $Error[0].Exception.ServerError". Even checking the error variable as stated in the error message did not yield any further details or specific to the issue I was running into.