code: 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_if 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
docs: Return datacenter ID from provider configuration