list_nodes on GCE Projects Only Returns 500 Results
Summary
When running list_nodes against a GCE environment that has greater than 500 instances, only the top 500 results will be returned.
Detailed Information
Using libcloud 2.6.0, running list_nodes using the GCE Provider will only return the top 500 results. This is similar to issue #1203 where the list_nodes function is running self.connection.request rather than self.connection.request_aggregated_items.
I believe changing lines 19-23 of the list_nodes function to something like this will fix the issue:
if zone is None:
response = self.connection.request_aggregated_items('instances')
else:
request = '/zones/%s/instances' % (zone.name)
response = self.connection.request(request, method='GET').object
@erjohnso Maybe you have an input on this issue?
request_aggregated_items approach seems reasonable to me, I don't have any account with that many instances to test it, but I guess I could also decrease page size (maxResults) to test that change.
On a related note, I assume we also need to correctly handle pagination when user explicitly specifies a zone to use?
#1409 should fix this issue.