Skip to content

Commit 2142b24

Browse files
committed
nova: Ignore errors for discover_hosts
In some cases there can be a race condition where a compute node is being discovered by the controller at the same instant that the node is trying to register itself with `nova-manage cell_v2 discover_hosts`, which results in an error like this: DBDuplicateEntry: (pymysql.err.IntegrityError) (1062, u"Duplicate entry 'd00-25-90-e5-0b-aa' for key 'uniq_host_mappings0host'") In a case like this, it is safe to ignore because the host is already discovered. This patch removes the `set -e` part of the script in order to be more forgiving for errors like this, since we can't use crowbar sync marks to orchestrate node discovery like this.
1 parent 52b065d commit 2142b24

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

chef/cookbooks/nova/recipes/compute_register_cell.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
user node[:nova][:user]
3333
group node[:nova][:group]
3434
code <<-EOH
35-
set -e
3635
tmpfile=$(mktemp /tmp/nova-discover-hosts.XXXXXX.conf)
3736
chmod 600 $tmpfile
3837
echo "[api_database]" >> $tmpfile

0 commit comments

Comments
 (0)