'Get storage state and bind ld.
volume: ld information
capacity: capacity in GB
validator: validate method(volume, xml)
nameselector: select ld name method(volume)
poolselector: select ld location method(volume, pools)
diskarray_name: target diskarray name
option: optional info'

@coordination.synchronized('mstorage_bind_execute_{diskarray_name}')
def _sync_bind_ld(self, volume, capacity, validator, nameselector, poolselector, diskarray_name, option=None):

    LOG.debug('_bind_ld    Start.')
    xml = self._cli.view_all(self._properties['ismview_path'])
    (pools, lds, ldsets, used_ldns, hostports, max_ld_count) = self.configs(xml)
    if (validator is not None):
        result = validator(volume, xml)
        if (result is False):
            msg = _('Invalid    bind    Logical    Disk    info.')
            raise exception.VolumeBackendAPIException(data=msg)
    ldname = nameselector(volume)
    selected_pool = poolselector(volume, pools, xml, option)
    selected_ldn = self._select_ldnumber(used_ldns, max_ld_count)
    if ((selected_pool < 0) or (selected_ldn < 0)):
        LOG.debug('NOT    necessary    LD    bind.    Name=%(name)s    Size=%(size)dGB    LDN=%(ldn)04xh    Pool=%(pool)04xh.', {'name': ldname, 'size': capacity, 'ldn': selected_ldn, 'pool': selected_pool})
        return (ldname, selected_ldn, selected_pool)
    (retnum, errnum) = self._cli.ldbind(ldname, selected_pool, selected_ldn, capacity)
    if (retnum is False):
        if ('iSM31077' in errnum):
            msg = (_('Logical    Disk    number    is    duplicated    (%s).') % errnum)
            raise exception.VolumeBackendAPIException(data=msg)
        else:
            msg = (_('Failed    to    bind    Logical    Disk    (%s).') % errnum)
            raise exception.VolumeBackendAPIException(data=msg)
    LOG.debug('LD    bound.    Name=%(name)s    Size=%(size)dGB    LDN=%(ldn)04xh    Pool=%(pool)04xh.', {'name': ldname, 'size': capacity, 'ldn': selected_ldn, 'pool': selected_pool})
    return (ldname, selected_ldn, selected_pool)
