2017-10-06 14:21:49 |
Andriy Kurilin |
description |
Listing of instances returns a limited number of resources. To list all instances, "marker" parameter can be used to list all the pages, i.e to obtain all the servers.
results = []
marker = None
while True:
servers = list_server(marker)
if not servers:
break
results.extend(servers)
marker = results[-1].id
Actually, novaclient implements the same logic for `limit=-1`.
For some reasons, it stopped working. Listing instances starting from X instance returns a list of resources with X instance in it.
Catched by the scenario when 2 VMs are created at almost the same time (<1sec between requests) in the same tenant by the same user, but with different names. |
Listing of instances returns a limited number of resources. To list all instances, "marker" parameter can be used to list all the pages, i.e to obtain all the servers.
# novaclient implements the same logic for `limit=-1`.
results = []
marker = None
while True:
servers = list_server(marker)
if not servers:
break
results.extend(servers)
marker = results[-1].id
For some reasons, it stopped working. Listing instances starting from X instance returns a list of resources with X instance in it.
Caught by the scenario when 2 VMs are created at almost the same time (<1sec between requests) in the same tenant by the same user, but with different names. |
|