if (instance.vm_state == vm_states.SOFT_DELETED or (instance.vm_state == vm_states.ERROR and instance.task_state != task_states.RESIZE_MIGRATING)): LOG.debug(_("Instance is in %s state."), instance.vm_state, instance=instance)
is the one that fails to delete these on startup - because they are in ERROR + != RESIZE_MIGRATING
And this if block -
if (instance.vm_state == vm_states. SOFT_DELETED or
(instance. vm_state == vm_states.ERROR and
instance. task_state != task_states. RESIZE_ MIGRATING) ):
LOG. debug(_ ("Instance is in %s state."),
instance. vm_state, instance=instance)
is the one that fails to delete these on startup - because they are in ERROR + != RESIZE_MIGRATING