'Download image as an individual file to host via HTTP PUT.'

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

    session = self._session
    LOG.debug('Downloading    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)
    try:
        dc_path = 'ha-datacenter'
        (host, cookies) = self._get_esx_host_and_cookies(vi.datastore, dc_path, image_ds_loc.rel_path)
    except Exception as e:
        LOG.warning('Get    esx    cookies    failed:    %s', e, instance=vi.instance)
        dc_path = vutil.get_inventory_path(session.vim, vi.dc_info.ref)
        host = self._session._host
        cookies = session.vim.client.options.transport.cookiejar
    images.fetch_image(context, vi.instance, host, session._port, dc_path, vi.datastore.name, image_ds_loc.rel_path, cookies=cookies)
