VMware Cloud Community
blanket
Enthusiast
Enthusiast

VRA-7.5 MachinePrefix delete API bug?

Hi,

I manually or via API create a MachinePrefix:

GET request to URL https://vra-server/iaas-proxy-provider/api/machine-prefixes/tenant?page=1&limit=20 works as expected.

One of the elements is:

{

      "@type": "MachinePrefix",

      "id": "7a40b058-48d4-40c1-b69b-f572d5722263",

      "name": "testDelete",

      "nextMachineNo": 0,

      "machineNumberLength": 0,

      "tenantId": "d"

}

After that... DELETE request to: https://vra-server/iaas-proxy-provider/api/machine-prefixes/7a40b058-48d4-40c1-b69b-f572d5722263 CRASHES with:

Response code: 500

Response Body:

{

  "errors": [

    {

      "code": 50505,

      "source": null,

      "message": "System exception.",

      "systemMessage": "HTTP/1.1 400 Bad Request : <?xml version=\"1.0\" encoding=\"utf-8\"?><m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\"><m:code /><m:message xml:lang=\"sl-SI\">Syntax error at position 28 in 'HostnamePrefixID eq 7a40b058-48d4-40c1-b69b-f572d5722263'.</m:message><m:innererror><m:message>Syntax error at position 28 in 'HostnamePrefixID eq 7a40b058-48d4-40c1-b69b-f572d5722263'.</m:message><m:type>Microsoft.Data.OData.ODataException</m:type><m:stacktrace>   at Microsoft.Data.OData.Query.ExpressionLexer.ValidateToken(ExpressionTokenKind t)&#xD;   at Microsoft.Data.OData.Query.UriQueryExpressionParser.ParseFilter(String filter)&#xD;   at Microsoft.Data.OData.Query.ODataUriParser.ParseFilterImplementation(String filter, IEdmType elementType, IEdmEntitySet entitySet)&#xD;   at System.Data.Services.Parsing.RequestExpressionParser.ParseFilter()</m:stacktrace></m:innererror></m:error>",

      "moreInfoUrl": null

    }

  ]

}

Version: 7.5.0 (Build: 10053500)

Tested in swagger here: https://vra-server/component-registry/services/docs#!/apis/10011?!/machine45prefix/deleteMachinePref...

It really looks like a bug. I hope somebody from VMware can confirm this. GSS did not want to confirm / verify this.

Thanks!

Reply
0 Kudos
7 Replies
daphnissov
Immortal
Immortal

I get the same result as you, although I have not done any work on my own to read the API docs or experiment with other formatting options. I'm not sure why you say GSS was unwilling to do this. Do you have active support?

Reply
0 Kudos
blanket
Enthusiast
Enthusiast

We have active break & fix support. With that support we opened a ticket and their answer was they do not handle this.

We do not have active SDK support, but the reason is that the vRealize Automation API is not covered by SDK support last time we checked.

Reply
0 Kudos
blanket
Enthusiast
Enthusiast

Bump...

Reply
0 Kudos
vrtealizeit
Contributor
Contributor

I think one workaround would be to instead trigger a Orchestrator workflow through the Orchestrator REST PI, that then deletes the machine prefix. Check out the OOTB-workflow called "Delete a Machine Prefix".

blanket
Enthusiast
Enthusiast

vrtealizeit​​​ yeah... we did that at the end. Still it really looks like a bug...

Thanks for your input!

Reply
0 Kudos
mdavidh
Contributor
Contributor

I can confirm this is a bug in the API. Swagger docs cannot be updated but there is a KB in the process of being published.

In the interim to resolve the issue the ID part of the request can be wrapped in the OData guid syntax of guid'dddddddd-dddd-dddd-dddd-dddddddddddd'

For example, this query will allow the delete to execute successfully:

/iaas-proxy-provider/api/machine-prefixes/guid'MachinePrefixID'

Reply
0 Kudos
mdavidh
Contributor
Contributor

Kb has since been published: https://kb.vmware.com/s/article/71344