'Returns VMwareImage, the subset of properties the driver uses.
:param context - context
:param image_id - image id of image
:param image_meta - image metadata object we are working with
:return: vmware image object
:rtype: nova.virt.vmwareapi.images.VmwareImage'

@classmethod
def from_image(cls, context, image_id, image_meta):

    properties = image_meta.properties
    image_linked_clone = properties.get('img_linked_clone', CONF.vmware.use_linked_clone)
    linked_clone = strutils.bool_from_string(image_linked_clone)
    if image_meta.obj_attr_is_set('container_format'):
        container_format = image_meta.container_format
    else:
        container_format = None
    props = {'image_id': image_id, 'linked_clone': linked_clone, 'container_format': container_format, 'vsphere_location': get_vsphere_location(context, image_id)}
    if image_meta.obj_attr_is_set('size'):
        props['file_size'] = image_meta.size
    if image_meta.obj_attr_is_set('disk_format'):
        props['file_type'] = image_meta.disk_format
    hw_disk_bus = properties.get('hw_disk_bus')
    if hw_disk_bus:
        mapping = {fields.SCSIModel.LSILOGIC: constants.DEFAULT_ADAPTER_TYPE, fields.SCSIModel.LSISAS1068: constants.ADAPTER_TYPE_LSILOGICSAS, fields.SCSIModel.BUSLOGIC: constants.ADAPTER_TYPE_BUSLOGIC, fields.SCSIModel.VMPVSCSI: constants.ADAPTER_TYPE_PARAVIRTUAL}
        if (hw_disk_bus == fields.DiskBus.IDE):
            props['adapter_type'] = constants.ADAPTER_TYPE_IDE
        elif (hw_disk_bus == fields.DiskBus.SCSI):
            hw_scsi_model = properties.get('hw_scsi_model')
            props['adapter_type'] = mapping.get(hw_scsi_model)
    props_map = {'os_distro': 'os_type', 'hw_disk_type': 'disk_type', 'hw_vif_model': 'vif_model'}
    for (k, v) in props_map.items():
        if properties.obj_attr_is_set(k):
            props[v] = properties.get(k)
    return cls(**props)
