Fix prepare_for_replace/restore_prev_rsrc handing for server
Now, we set 'fixed_ips' to [] for server ports when prepare
for server replacement, but the ports are still in-use if only
set 'fixed_ips' to []. So this patch will to detach the ports from
nova server to make sure same ports can be attached to new one in
prepare_for_replace(). Also, when restoring server, we need to detach
ports from existing server, and then to attach them to previous
server.
We check the interface attach/detach complete by list the
server.interfaces, this change will use 'retry' wrapper to re-poll
the server interfaces for several times (by new config option
'max_interface_check_attempts', default is 10), then will raise
exception if the attach/detach still not complete.
Reviewed: https:/ /review. openstack. org/274976 /git.openstack. org/cgit/ openstack/ heat/commit/ ?id=163d46bdc8b bfa2e7da2989f5a 5d608826de2dcc
Committed: https:/
Submitter: Jenkins
Branch: master
commit 163d46bdc8bbfa2 e7da2989f5a5d60 8826de2dcc
Author: huangtianhua <email address hidden>
Date: Wed Jan 13 14:17:57 2016 +0800
Fix prepare_ for_replace/ restore_ prev_rsrc handing for server
Now, we set 'fixed_ips' to [] for server ports when prepare for_replace( ). Also, when restoring server, we need to detach
for server replacement, but the ports are still in-use if only
set 'fixed_ips' to []. So this patch will to detach the ports from
nova server to make sure same ports can be attached to new one in
prepare_
ports from existing server, and then to attach them to previous
server.
We check the interface attach/detach complete by list the interfaces, this change will use 'retry' wrapper to re-poll interface_ check_attempts' , default is 10), then will raise
server.
the server interfaces for several times (by new config option
'max_
exception if the attach/detach still not complete.
Closes-Bug: #1533076 0dcd0365bc3091c 289f00f0548
Change-Id: I7b322f9cf16c10