'Creates a volume via copying a Unity snapshot.
It attaches the `volume` and `snap`, then use `dd` to copy the
data from the Unity snapshot to the `volume`.'

def _dd_copy(self, vol_params, src_snap, src_lun=None):

    dest_lun = self.client.create_lun(name=vol_params.name, size=vol_params.size, pool=vol_params.pool, description=vol_params.description, io_limit_policy=vol_params.io_limit_policy)
    src_id = src_snap.get_id()
    try:
        conn_props = cinder_utils.brick_get_connector_properties()
        with self._connect_resource(dest_lun, conn_props, vol_params.volume_id) as dest_info:
            with self._connect_resource(src_snap, conn_props, src_id) as src_info:
                if (src_lun is None):
                    lun = self.client.get_lun(lun_id=src_snap.storage_resource.get_id())
                    size_in_m = utils.byte_to_mib(lun.size_total)
                else:
                    size_in_m = utils.byte_to_mib(src_lun.size_total)
                vol_utils.copy_volume(src_info['device']['path'], dest_info['device']['path'], size_in_m, self.driver.configuration.volume_dd_blocksize, sparse=True)
    except Exception:
        with excutils.save_and_reraise_exception():
            utils.ignore_exception(self.client.delete_lun, dest_lun.get_id())
            LOG.error('Failed    to    create    cloned    volume:    %(vol_id)s,    from    source    unity    snapshot:    %(snap_name)s.', {'vol_id': vol_params.volume_id, 'snap_name': src_snap.name})
    return dest_lun
