client sometimes responds with 400 when trying to get status of server very soon after boot.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Expired
|
Undecided
|
Unassigned |
Bug Description
I suspect that this is a race hazard as it doesn't always occur, although some versions of OpenStack trigger it more that others (e.g. Ocata).
Essentially, what happens is:
1. We use the python-novaclient to start a server (NOT using the wait parameter).
2. As soon as that function returns, we try and list the instances, so we can find out if our has reached the ACTIVE stage. Note that it is usually the only instance.
3. Sometimes nova_client.
Relevant code:
instance = nova_client.
..
instance = nova_client.
^^^ where 400 is raised.
Note that we use the slightly odd find_all() as:
# In pike+ servers.find throws a novaclient.
# exception. Subsequent calls work for some reason. Either way just
# use the first element reduced by servers.findall
An example of the backtrace is:
2018-05-22 11:44:26 [INFO] Creating m1.small trusty [{'net-id': u'32518ef5-
2018-05-22 11:44:35 [INFO] Issued boot
2018-05-22 11:44:35 [INFO] Launched <Server: 20180522114426>
2018-05-22 11:44:35 [INFO] Waiting for boot
2018-05-22 11:44:35 [INFO] Waiting 180s for 20180522114426 to reach ACTIVE state
Traceback (most recent call last):
File "/srv/mojo/
sys.
File "/srv/mojo/
ping_
File "/home/
cloudinit_wait)
File "/home/
if not wait_for_
File "/home/
instance = nova_client.
File "/home/
listing = self.list(
File "/home/
"servers")
File "/home/
resp, body = self.api.
File "/home/
return self.request(url, 'GET', **kwargs)
File "/home/
raise exceptions.
novaclient.
Which version of python-novaclient did you use?
Was it 7.1.2?