apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.1k stars 1.11k forks source link

When deploying node to Kubernetes it times out #8975

Closed PaX101 closed 5 months ago

PaX101 commented 6 months ago

When deploying a node on Kubernetes in Cloudstack 4.19.0.0 it times out when it tries to list the VM's:

Error syncing load balancer: failed to ensure load balancer: error retrieving list of hosts: Get https://my.url.com/client/api?apiKey=myapikeyhere&command=listVirtualMachines&listall=true&response=json&signature=mysignature: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Kub

When i try and load the page myself if takes around 5-10 minutes to load the VM list similar to the bug in 4.18 when trying to list VM's. If i change the command to: listVirtualMachinesMetrics in my broswer it loads instantly.

rohityadavcloud commented 6 months ago

@PaX101 yes because you're listing the listVirtualMachinesMetrics API which by default returns VM stats (which slows down the API request). If you don't need all the details, you can pass details=min to the API response (or specific details you'd expect).

If you're not able to control this API request, one way to address this could be to change the default behaviour that's change-able via global setting.

rohityadavcloud commented 6 months ago

@PaX101 I've proposed a PR here which might help your case - https://github.com/apache/cloudstack/pull/8985 Can you try to disable vm.stats.increment.metrics global setting in your environment and see if it helps speed you listVIrtualMachines API calls?

weizhouapache commented 6 months ago

@PaX101 yes because you're listing the listVirtualMachinesMetrics API which by default returns VM stats (which slows down the API request). If you don't need all the details, you can pass details=min to the API response (or specific details you'd expect).

If you're not able to control this API request, one way to address this could be to change the default behaviour that's change-able via global setting.

good idea to list virtualmachine with details parameters I created a PR to address it in ccm: https://github.com/apache/cloudstack-kubernetes-provider/pull/60

rohityadavcloud commented 5 months ago

Additionally fixed in https://github.com/apache/cloudstack/pull/9177 To make the listing faster, the new global setting will need to be set to false.