'Creates a volume on array with the configured attributes
Note: if read_cache, write_cache, flash_cache, or data_assurance
are not provided, the default will be utilized by the Webservice.
:param pool: The pool unique identifier
:param label: The unqiue label for the volume
:param size: The capacity in units
:param unit: The unit for capacity
:param seg_size: The segment size for the volume, expressed in KB.
Default will allow the Webservice to choose.
:param read_cache: If true, enable read caching, if false,
explicitly disable it.
:param write_cache: If true, enable write caching, if false,
explicitly disable it.
:param flash_cache: If true, add the volume to a Flash Cache
:param data_assurance: If true, enable the Data Assurance capability
:returns: The created volume'

def create_volume(self, pool, label, size, unit='gb', seg_size=0, read_cache=None, write_cache=None, flash_cache=None, data_assurance=None, thin_provision=False):

    if self.features.SSC_API_V2:
        path = '/storage-systems/{system-id}/ssc/volumes'
        data = {'poolId': pool, 'name': label, 'sizeUnit': unit, 'size': int(size), 'dataAssuranceEnable': data_assurance, 'flashCacheEnable': flash_cache, 'readCacheEnable': read_cache, 'writeCacheEnable': write_cache, 'thinProvision': thin_provision}
    else:
        extra_specs = [read_cache, write_cache]
        unsupported_spec = any([(spec is not None) for spec in extra_specs])
        if unsupported_spec:
            msg = _('E-series    proxy    API    version    %(current_version)s    does    not    support    full    set    of    SSC    extra    specs.    The    proxy    version    must    be    at    at    least    %(min_version)s.')
            min_version = self.features.SSC_API_V2.minimum_version
            raise exception.NetAppDriverException((msg % {'current_version': self.api_version, 'min_version': min_version}))
        path = '/storage-systems/{system-id}/volumes'
        data = {'poolId': pool, 'name': label, 'sizeUnit': unit, 'size': int(size), 'segSize': seg_size}
    return self._invoke('POST', path, data)
