Use limit -1 for nova servers list
By default nova has a limit for returned items in a single response [1]. We should pass limit=-1 to get all items. [1] https://docs.openstack.org/nova/rocky/configuration/config.html Change-Id: I1fabd909c4c0356ef5fcb7c51718fb4513e6befa
This commit is contained in:
committed by
Alexander Chadin
parent
d99e8f33da
commit
f517cc662a
@@ -74,7 +74,8 @@ class NovaHelper(object):
|
|||||||
raise exception.ComputeNodeNotFound(name=node_hostname)
|
raise exception.ComputeNodeNotFound(name=node_hostname)
|
||||||
|
|
||||||
def get_instance_list(self):
|
def get_instance_list(self):
|
||||||
return self.nova.servers.list(search_opts={'all_tenants': True})
|
return self.nova.servers.list(search_opts={'all_tenants': True},
|
||||||
|
limit=-1)
|
||||||
|
|
||||||
def get_flavor_list(self):
|
def get_flavor_list(self):
|
||||||
return self.nova.flavors.list(**{'is_public': None})
|
return self.nova.flavors.list(**{'is_public': None})
|
||||||
@@ -704,7 +705,8 @@ class NovaHelper(object):
|
|||||||
|
|
||||||
def get_instances_by_node(self, host):
|
def get_instances_by_node(self, host):
|
||||||
return [instance for instance in
|
return [instance for instance in
|
||||||
self.nova.servers.list(search_opts={"all_tenants": True})
|
self.nova.servers.list(search_opts={"all_tenants": True},
|
||||||
|
limit=-1)
|
||||||
if self.get_hostname(instance) == host]
|
if self.get_hostname(instance) == host]
|
||||||
|
|
||||||
def get_hostname(self, instance):
|
def get_hostname(self, instance):
|
||||||
|
|||||||
Reference in New Issue
Block a user