Update instance node on rebuild only when it is recreate
When using ironic virt driver, if scheduled_node is not specified
in rebuild_instance compute manager method (as it happens in case
of instance rebuild), the first ironic node is selected:
After the first rebuild, instance.node is updated to be this first
ironic node, which causes subsequent rebuilds to fail, as virt driver
tries to set instance_uuid on a newly selected ironic node and fails.
Closes-bug: #1564921
Change-Id: I2fe6e439135ba6aa4120735d030ced31081ef202
(cherry picked from commit 54b122caec1ae2418fc3e296be604d072cb5815a)
Reviewed: https:/ /review. openstack. org/375715 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=97d784b454b af3289ce2f3e181 2fb94c8469b136
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 97d784b454baf32 89ce2f3e1812fb9 4c8469b136
Author: Vladyslav Drok <email address hidden>
Date: Thu Apr 14 21:15:10 2016 +0300
Update instance node on rebuild only when it is recreate
When using ironic virt driver, if scheduled_node is not specified
in rebuild_instance compute manager method (as it happens in case
of instance rebuild), the first ironic node is selected:
computes = ComputeNodeList .get_all_ by_host( context, host, use_slave)
return computes[0]
After the first rebuild, instance.node is updated to be this first
ironic node, which causes subsequent rebuilds to fail, as virt driver
tries to set instance_uuid on a newly selected ironic node and fails.
Closes-bug: #1564921 aa4120735d030ce d31081ef202 18fc3e296be604d 072cb5815a)
Change-Id: I2fe6e439135ba6
(cherry picked from commit 54b122caec1ae24