'Driver entry point for creating a new volume (Data ONTAP LUN).'

def create_volume(self, volume):

    LOG.debug('create_volume    on    %s', volume['host'])
    pool_name = volume_utils.extract_host(volume['host'], level='pool')
    if (pool_name is None):
        msg = _('Pool    is    not    available    in    the    volume    host    field.')
        raise exception.InvalidHost(reason=msg)
    extra_specs = na_utils.get_volume_extra_specs(volume)
    lun_name = volume['name']
    size = (int(volume['size']) * units.Gi)
    metadata = {'OsType': self.lun_ostype, 'SpaceReserved': self.lun_space_reservation, 'Path': ('/vol/%s/%s' % (pool_name, lun_name))}
    qos_policy_group_info = self._setup_qos_for_volume(volume, extra_specs)
    qos_policy_group_name = na_utils.get_qos_policy_group_name_from_info(qos_policy_group_info)
    try:
        self._create_lun(pool_name, lun_name, size, metadata, qos_policy_group_name)
    except Exception:
        LOG.exception('Exception    creating    LUN    %(name)s    in    pool    %(pool)s.', {'name': lun_name, 'pool': pool_name})
        self._mark_qos_policy_group_for_deletion(qos_policy_group_info)
        msg = _('Volume    %s    could    not    be    created.')
        raise exception.VolumeBackendAPIException(data=(msg % volume['name']))
    LOG.debug('Created    LUN    with    name    %(name)s    and    QoS    info    %(qos)s', {'name': lun_name, 'qos': qos_policy_group_info})
    metadata['Path'] = ('/vol/%s/%s' % (pool_name, lun_name))
    metadata['Volume'] = pool_name
    metadata['Qtree'] = None
    handle = self._create_lun_handle(metadata)
    self._add_lun_to_table(NetAppLun(handle, lun_name, size, metadata))
    model_update = self._get_volume_model_update(volume)
    return model_update
