Creates a virtual datacenter based on supplied parameters.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f create_datacenter profitbricks name=mydatacenter
        location=us/las description="my description"

def create_datacenter(call=None, kwargs=None):
    '''
    Creates a virtual datacenter based on supplied parameters.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f create_datacenter profitbricks name=mydatacenter
        location=us/las description="my description"
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The create_address function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    if kwargs.get('name') is None:
        raise SaltCloudExecutionFailure('The "name" parameter is required')

    if kwargs.get('location') is None:
        raise SaltCloudExecutionFailure('The "location" parameter is required')

    conn = get_conn()
    datacenter = Datacenter(name=kwargs['name'],
                            location=kwargs['location'],
                            description=kwargs.get('description'))

    response = conn.create_datacenter(datacenter)
    _wait_for_completion(conn, response, 60, 'create_datacenter')

    return response