'Wait for the node to be marked as ACTIVE in Ironic.'

def _wait_for_active(self, instance):

    instance.refresh()
    if ((instance.task_state == task_states.DELETING) or (instance.vm_state in (vm_states.ERROR, vm_states.DELETED))):
        raise exception.InstanceDeployFailure((_('Instance    %s    provisioning    was    aborted') % instance.uuid))
    node = self._validate_instance_and_node(instance)
    if (node.provision_state == ironic_states.ACTIVE):
        LOG.debug('Ironic    node    %(node)s    is    now    ACTIVE', dict(node=node.uuid), instance=instance)
        raise loopingcall.LoopingCallDone()
    if (node.target_provision_state in (ironic_states.DELETED, ironic_states.AVAILABLE)):
        raise exception.InstanceNotFound(instance_id=instance.uuid)
    if (node.provision_state in (ironic_states.NOSTATE, ironic_states.AVAILABLE)):
        raise exception.InstanceNotFound(instance_id=instance.uuid)
    if (node.provision_state == ironic_states.DEPLOYFAIL):
        msg = (_('Failed    to    provision    instance    %(inst)s:    %(reason)s') % {'inst': instance.uuid, 'reason': node.last_error})
        raise exception.InstanceDeployFailure(msg)
    _log_ironic_polling('become    ACTIVE', node, instance)
