'Get a Mount instance for the image type
:param image: instance of nova.virt.image.model.Image
:param mountdir: path to mount the image at
:param partition: partition number to mount'

@staticmethod
def instance_for_format(image, mountdir, partition):

    LOG.debug('Instance    for    format    image=%(image)s    mountdir=%(mountdir)s    partition=%(partition)s', {'image': image, 'mountdir': mountdir, 'partition': partition})
    if isinstance(image, imgmodel.LocalFileImage):
        if (image.format == imgmodel.FORMAT_RAW):
            LOG.debug('Using    LoopMount')
            return importutils.import_object('nova.virt.disk.mount.loop.LoopMount', image, mountdir, partition)
        else:
            LOG.debug('Using    NbdMount')
            return importutils.import_object('nova.virt.disk.mount.nbd.NbdMount', image, mountdir, partition)
    elif isinstance(image, imgmodel.LocalBlockImage):
        LOG.debug('Using    BlockMount')
        return importutils.import_object('nova.virt.disk.mount.block.BlockMount', image, mountdir, partition)
    else:
        raise exception.UnsupportedImageModel(image.__class__.__name__)
