'Download stream optimized image to host as a vApp.'

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

    vm_name = image_ds_loc.parent.basename
    LOG.debug('Downloading    stream    optimized    image    %(image_id)s    to    %(file_path)s    on    the    data    store    %(datastore_name)s    as    vApp', {'image_id': vi.ii.image_id, 'file_path': image_ds_loc, 'datastore_name': vi.datastore.name}, instance=vi.instance)
    image_size = images.fetch_image_stream_optimized(context, vi.instance, self._session, vm_name, vi.datastore.name, vi.dc_info.vmFolder, self._root_resource_pool)
    vi.ii.file_size = image_size
