'Set up the block device for an instance with error logging.'

def _prep_block_device(self, context, instance, bdms):

    try:
        self._add_missing_dev_names(bdms, instance)
        block_device_info = driver.get_block_device_info(instance, bdms)
        mapping = driver.block_device_info_get_mapping(block_device_info)
        driver_block_device.attach_block_devices(mapping, context, instance, self.volume_api, self.driver, wait_func=self._await_block_device_map_created)
        self._block_device_info_to_legacy(block_device_info)
        return block_device_info
    except exception.OverQuota as e:
        LOG.warning('Failed    to    create    block    device    for    instance    due    to    exceeding    volume    related    resource    quota.    Error:    %s', e.message, instance=instance)
        raise
    except Exception as ex:
        LOG.exception('Instance    failed    block    device    setup', instance=instance)
        raise exception.InvalidBDM(six.text_type(ex))
