<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def get_datacenter_id():
    '''
    Return datacenter ID from provider configuration
    '''
    datacenter_id = config.get_cloud_config_value(
        'datacenter_id',
        get_configured_provider(),
        __opts__,
        search_global=False
    )

    conn = get_conn()

    try:
        conn.get_datacenter(datacenter_id=datacenter_id)
    except PBNotFoundError:
        log.error('Failed to get datacenter: %s', datacenter_id)
        raise

    return datacenter_id