vsphere-automation-sdk-python icon indicating copy to clipboard operation
vsphere-automation-sdk-python copied to clipboard

List all VMs API returning 500 server error

Open WinstonJake opened this issue 2 years ago • 4 comments

I get 500 server error when I run the (GET) /rest/vcenter/vm API on my company's vSphere client instance.

I notice that there are a few VMs that are inaccessible and a few that are orphaned. According to another (closed) thread, looks like this MIGHT be the issue. Is this a known bug?

  • vSphere version: 6.7.0.48000

Steps or code snippet to reproduce

Run the (GET) /rest/vcenter/vm API

Actual behavior

Getting 500 server error with the below API response { "type": "com.vmware.vapi.std.errors.internal_server_error", "value": { "messages": [ { "args": [ "null" ], "default_message": "Provider method implementation threw unexpected exception: null", "id": "vapi.bindings.method.impl.unexpected" } ] } }

Expected behavior

200 OK with the successful retrieval of the VM list

WinstonJake avatar Sep 06 '21 14:09 WinstonJake

I have the same issue with the same version. Version 7.0 and above works just fine! :+1:

Would be nice to know if there is any progress on this issue :grin:

Thanks!

HajkWho avatar Mar 23 '22 15:03 HajkWho

@Gallifreys11

Could you please share the logs (error logs/vc bundle), would like to investigate further.

Thanks!

shwetapurohit avatar Mar 23 '22 16:03 shwetapurohit

@Gallifreys11 There is a known issue in 6.7 when VMs are in invalid(orphaned/inaccessible) or VM being cloned state, we hit this internal_server_error 500. This issue is fixed in 7.0. A workaround here would be to remove these invalid VMs from inventory.

jobingeo avatar Mar 23 '22 16:03 jobingeo

Thank You very much @jobingeo and @shwetapurohit :pray:

In fact we still had such machines because of a host failure in the cluster last week.

I cleaned everything and now it works perfectly again! :tada:

HajkWho avatar Mar 23 '22 21:03 HajkWho

closing the issue

kunalpmj avatar Feb 26 '24 07:02 kunalpmj