VMware Cloud Community
pirhovi
Contributor
Contributor

PowerCLI error reporting is broken when working with vCloud Director

It seems that PowerCLI Cmdlets error reporting for vCloud Director cmdlets is broken.

For example:

When creating new vapp from template with New-CIVapp and it fails (due storage quota exceeded) powercli returns error:

New-CIVApp    The server returned 'Bad Request' with the status code 400 - BadRequest.

Its impossible to know the real reason, because in exception or "innerexception" there is no data about the real error message which is returned by vcloud:

<Error xmlns="http://www.vmware.com/vcloud/v1.5" stackTrace="com.vmware.vcloud.api.presentation.service.StorageQuotaExceededException: The requested operation will exceed the VDC's storage quota: storage policy &quot;Basic Storage Policy&quot; has 17,766 MB remaining, requested 22,528 MB

.........long stacktrace.......

majorErrorCode="400" message="[ 88254ce9-1ced-428d-902c-d591e2bfb52c ] The requested operation will exceed the VDC's storage quota: storage policy &quot;Basic Storage Policy&quot; has 17,766 MB remaining, requested 22,528 MB" minorErrorCode="STORAGE_QUOTA_EXCEEDED" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://x.x.x.x/api/v1.5/schema/master.xsd"></Error>

If you dig around you can see that exception is coming from HttpClientErrorException from the Spring.Rest.Client.HttpResponseException.

That exception class has property "Response", which has "Headers", "StatusCode" and "StatusDescription" and "Body". It would be REALLY nice if the Body would have that Error-xml which is being sent by vcloud director and that "message" attribute would be in the Exception class in "VMware.VimAutomation.Cloud.Types.V1.CIException" as property.

Is there currently any method to get the "real" error message?

0 Kudos
5 Replies
knikolov
VMware Employee
VMware Employee

Hi,

Can you check the ServerError property of the exception thrown. Is there useful information in that property?

Kamen

0 Kudos
pirhovi
Contributor
Contributor

Neither exception (exception thrown or BaseException) has property ServerError.

Exception types: VMware.VimAutomation.Cloud.Types.V1.CIException

and from there GetBaseException() gets you to Spring.Rest.Client.HttpClientErrorException.

No ServerError property in those types.

0 Kudos
pirhovi
Contributor
Contributor

PING.

PowerCLI team, wake up!

0 Kudos
pirhovi
Contributor
Contributor

PONG!

7 months and nothing. Really guys?

0 Kudos
pirhovi
Contributor
Contributor

This was FIXED in PowerCLI 6.5 R1 !

0 Kudos