'Fetch image which is located on a vSphere datastore.'

def _fetch_vsphere_image(self, context, vi, image_ds_loc):

    location = vi.ii.vsphere_location
    LOG.debug('Using    vSphere    location:    %s', location)
    LOG.debug('Copying    image    file    data    %(image_id)s    to    %(file_path)s    on    the    data    store    %(datastore_name)s', {'image_id': vi.ii.image_id, 'file_path': image_ds_loc, 'datastore_name': vi.datastore.name}, instance=vi.instance)
    location_url = ds_obj.DatastoreURL.urlparse(location)
    datacenter_path = location_url.datacenter_path
    datacenter_moref = ds_util.get_datacenter_ref(self._session, datacenter_path)
    datastore_name = location_url.datastore_name
    src_path = ds_obj.DatastorePath(datastore_name, location_url.path)
    ds_util.file_copy(self._session, str(src_path), datacenter_moref, str(image_ds_loc), vi.dc_info.ref)
    LOG.debug('Copied    image    file    data    %(image_id)s    to    %(file_path)s    on    the    data    store    %(datastore_name)s', {'image_id': vi.ii.image_id, 'file_path': image_ds_loc, 'datastore_name': vi.datastore.name}, instance=vi.instance)
