diff options
author | John Garbutt <john@johngarbutt.com> | 2017-09-29 15:48:54 +0100 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2017-12-11 16:23:49 -0500 |
commit | e3c5e22d1fde7ca916a8cc364f335fba8a3a798f (patch) | |
tree | 7e6379e33a336580d5c8a371ddbca218d0ffdb8e /nova/virt/driver.py | |
parent | 3cec0cb584ac82a5a57400b94d25f8ac73bb0950 (diff) | |
download | nova-e3c5e22d1fde7ca916a8cc364f335fba8a3a798f.tar.gz |
Re-use existing ComputeNode on ironic rebalance
When a nova-compute service dies that is one of several ironic based
nova-compute services running, a node rebalance occurs to ensure there
is still an active nova-compute service dealing with requests for the
given instance that is running.
Today, when this occurs, we create a new ComputeNode entry. This change
alters that logic to detect the case of the ironic node rebalance and in
that case we re-use the existing ComputeNode entry, simply updating the
host field to match the new host it has been rebalanced onto.
Previously we hit problems with placement when we get a new
ComputeNode.uuid for the same ironic_node.uuid. This reusing of the
existing entry keeps the ComputeNode.uuid the same when the rebalance of
the ComputeNode occurs.
Without keeping the same ComputeNode.uuid placement errors out with a 409
because we attempt to create a ResourceProvider that has the same name
as an existing ResourceProvdier. Had that worked, we would have noticed
the race that occurs after we create the ResourceProvider but before we
add back the existing allocations for existing instances. Keeping the
ComputeNode.uuid the same means we simply look up the existing
ResourceProvider in placement, avoiding all this pain and tears.
Closes-Bug: #1714248
Co-Authored-By: Dmitry Tantsur <dtantsur@redhat.com>
Change-Id: I4253cffca3dbf558c875eed7e77711a31e9e3406
Diffstat (limited to 'nova/virt/driver.py')
-rw-r--r-- | nova/virt/driver.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/virt/driver.py b/nova/virt/driver.py index d4c4d04881..c7f96eabde 100644 --- a/nova/virt/driver.py +++ b/nova/virt/driver.py @@ -134,6 +134,11 @@ class ComputeDriver(object): requires_allocation_refresh = False + # Indicates if this driver will rebalance nodes among compute service + # hosts. This is really here for ironic and should not be used by any + # other driver. + rebalances_nodes = False + def __init__(self, virtapi): self.virtapi = virtapi self._compute_event_callback = None |