Overwrite node field by wrong value after ironic instance rebuild
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
When I rebuild ironic instance via nova, after the first rebuild the node for the instance's overwritten by wrong value, thus next rebuild is not possible.
Steps to reproduce
==================
1. Spawn new ironic instance
2. Rebuild the instance
After this step you can see that hypervisor_hostname for the instance is totally different than before. (I use "nova show uuid" command to display information). When you display information for instance in ironic (ironic node-show --instance uuid) you can see that UUID of node is different than node in nova.
3. Second rebuild and we can see error as below.
http://
Environment
===========
Mitaka release and Ubuntu 16
My workaround
=============
After debugging I've found where is bug(?).
https:/
2795: compute_node = self._get_
2796: scheduled_node = compute_
[...]
5118: def _get_compute_
5119: return objects.
5120: context, host)
OK, let's dive deep
https:/
274: def get_first_
275: use_slave=False):
276: computes = ComputeNodeList
277: # FIXME(sbauza): Some hypervisors (VMware, Ironic) can return multiple
278: # nodes per host, we should return all the nodes and modify the callers
279: # instead.
280: # Arbitrarily returning the first node.
281: return computes[0]
It's looks the method return the first node for the given host. In case when we've hypervisor for ironic there is multiple nodes and the first node which is return is random.
My workaround, nothing sophisticated but works for me:
--- manager.py_org 2016-09-14 13:50:37.807379651 +0200
+++ manager.py 2016-09-14 13:51:40.275126034 +0200
@@ -2793,7 +2793,11 @@
if not scheduled_node:
try:
- scheduled_node = compute_
+ #workaround for ironic
+ if compute_
+ scheduled_node = instance.node
+ else:
+ scheduled_node = compute_
except exception.
I've tested this issue on Mitaka release, but it seems the code is the same in master branch.
That's all.
Regards
description: | updated |
It seems this bug is the same as issue described in https:/ /bugs.launchpad .net/nova/ +bug/1564921