'Helper function for manage volume to get array name and device ID.
:param volume: volume object from API
:param external_ref: the existing volume object to be manged
:returns: string value of the array name and device ID'

@staticmethod
def get_array_and_device_id(volume, external_ref):

    device_id = external_ref.get(u'source-name', None)
    LOG.debug('External_ref:    %(er)s', {'er': external_ref})
    if (not device_id):
        device_id = external_ref.get(u'source-id', None)
    host = volume.host
    host_list = host.split('+')
    array = host_list[(len(host_list) - 1)]
    if device_id:
        LOG.debug('Get    device    ID    of    existing    volume    -    device    ID:    %(device_id)s,    Array:    %(array)s.', {'device_id': device_id, 'array': array})
    else:
        exception_message = _('Source    volume    device    ID    is    required.')
        raise exception.VolumeBackendAPIException(data=exception_message)
    return (array, device_id)
