Skip to content

Commit

Permalink
Warn when a VM is being deleted because the build timeout expired.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardomurri committed Apr 2, 2020
1 parent ac5d5a9 commit 932da3a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion elasticluster/providers/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def start_instance(self, key_name, public_key_path, private_key_path,
if self.use_anti_affinity_groups:
result['anti_affinity_group_id'] = group_id
break # out of `while retry > 0:`
else: # vm.status == 'ERROR'
elif vm.status == 'ERROR':
if (self.use_anti_affinity_groups
# FIXME: is there a better way to determine the
# cause of the error than parsing the fault message?
Expand All @@ -622,6 +622,12 @@ def start_instance(self, key_name, public_key_path, private_key_path,
vm.name, vm.id, in_group_msg,
self._get_fault_message(vm) or 'unspecified error')
self.nova_client.servers.delete(vm.id)
else: # VM still building?
log.warning(
("VM instance `%s` (%s) not yet ACTIVE after %d-seconds timeout."
" Deleting it."),
vm.name, vm.id, self.build_timeout)
self.nova_client.servers.delete(vm.id)

# allocate and attach a floating IP, if requested
request_floating_ip = kwargs.get(
Expand Down

0 comments on commit 932da3a

Please sign in to comment.