docs: def create_erasure_profile(service, profile_name, erasure_plugin_name='jerasure',
                             failure_domain='host',
                             data_chunks=2, coding_chunks=1,
                             locality=None, durability_estimator=None,
                             device_class=None):
      """
      Create a new erasure code profile if one does not already exist for it.  Updates
      the profile if it exists. Please see http://docs.ceph.com/docs/master/rados/operations/erasure-code-profile/
      for more details
      :param service: six.string_types. The Ceph user name to run the command under
      :param profile_name: six.string_types
      :param erasure_plugin_name: six.string_types
      :param failure_domain: six.string_types.  One of ['chassis', 'datacenter', 'host', 'osd', 'pdu', 'pod', 'rack', 'region',
          'room', 'root', 'row'])
      :param data_chunks: int
      :param coding_chunks: int
      :param locality: int
      :param durability_estimator: int
      :param device_class: six.string_types
      :return: None.  Can raise CalledProcessError
      """
      # Ensure this failure_domain is allowed by Ceph
      validator(failure_domain, six.string_types,
                ['chassis', 'datacenter', 'host', 'osd', 'pdu', 'pod', 'rack', 'region', 'room', 'root', 'row'])
  
      cmd = ['ceph', '--id', service, 'osd', 'erasure-code-profile', 'set', profile_name,
             'plugin=' + erasure_plugin_name, 'k=' + str(data_chunks), 'm=' + str(coding_chunks)
             ]
      if locality is not None and durability_estimator is not None:
          raise ValueError("create_erasure_profile should be called with k, m and one of l or c but not both.")
  
      luminous_or_later = cmp_pkgrevno('ceph-common', '12.0.0') >= 0
      # failure_domain changed in luminous
      if luminous_or_later:
          cmd.append('crush-failure-domain=' + failure_domain)
      else:
          cmd.append('ruleset-failure-domain=' + failure_domain)
  
      # device class new in luminous
      if luminous_or_later and device_class:
          cmd.append('crush-device-class={}'.format(device_class))
      else:
          log('Skipping device class configuration (ceph < 12.0.0)',
              level=DEBUG)
  
      # Add plugin specific information
      if locality is not None:
          # For local erasure codes
          cmd.append('l=' + str(locality))
      if durability_estimator is not None:
          # For Shec erasure codes
          cmd.append('c=' + str(durability_estimator))
  
      if erasure_profile_exists(service, profile_name):
          cmd.append('--force')
  
      try:
          check_call(cmd)
      except CalledProcessError:
          raise