'API entry to create a volume on the cluster as a HGST space.
Creates a volume, adjusting for GiB/GB sizing.  Locked to ensure we
don\'t have race conditions on the name we pick to use for the space.'

@lockutils.synchronized('devices', 'cinder-hgst-')
def create_volume(self, volume):

    volname = self._make_space_name((volume['display_name'] or volume['name']))
    volnet = self.configuration.safe_get('hgst_net')
    volbytes = (volume['size'] * units.Gi)
    volsize_gb_cinder = int(math.ceil((float(volbytes) / float(self.SPACEGB))))
    volsize_g = self._adjust_size_g(volsize_gb_cinder)
    params = [self.VGCCLUSTER, 'space-create']
    params += ['-n', six.text_type(volname)]
    params += ['-N', six.text_type(volnet)]
    params += ['-s', six.text_type(volsize_g)]
    params += ['--redundancy', six.text_type(self.configuration.safe_get('hgst_redundancy'))]
    params += ['--user', six.text_type(self.configuration.safe_get('hgst_space_user'))]
    params += ['--group', six.text_type(self.configuration.safe_get('hgst_space_group'))]
    params += ['--mode', six.text_type(self.configuration.safe_get('hgst_space_mode'))]
    params += self._make_server_list()
    params += ['-A', self._hostname()]
    try:
        self._execute(run_as_root=True, *params)
    except processutils.ProcessExecutionError as err:
        msg = (_('Error    in    space-create    for    %(space)s    of    size    %(size)d    GB') % {'space': volname, 'size': int(volsize_g)})
        self._handle_blocked(err, msg)
    provider = {}
    provider['provider_id'] = volname
    return provider
