def _wait_for_ip(name, session):
    '''
    Wait for IP  to be available during create()
    '''
    start_time = datetime.now()
    status = None
    while status is None:
        status = get_vm_ip(name, session)
        if status is not None:
            # ignore APIPA address
            if status.startswith('169'):
                status = None
        check_time = datetime.now()
        delta = check_time - start_time
        log.debug(
            'Waited %s seconds for %s to report ip address...',
            delta.seconds, name
        )
        if delta.seconds > 180:
            log.warning('Timeout getting IP address')
            break
        time.sleep(5)