示例#1
0
    def _dry_run(self, volume, snapshot, datadir):
        """Implement dry-run for LVM snapshots.
        """
        LOG.info("* Would snapshot source volume %s/%s as %s/%s (size=%s)",
                 volume.vg_name, volume.lv_name, volume.vg_name, snapshot.name,
                 format_bytes(snapshot.size * int(volume.vg_extent_size)))
        LOG.info("* Would mount on %s", snapshot.mountpoint
                 or 'generated temporary directory')

        if getmount(self.target_directory) == getmount(datadir):
            LOG.error(
                "Backup directory %s is on the same filesystem as "
                "the source logical volume %s.", self.target_directory,
                volume.device_name())
            LOG.error("This will result in very poor performance and "
                      "has a high potential for failed backups.")
            raise BackupError("Improper backup configuration for LVM.")
示例#2
0
    def _dry_run(self, volume, snapshot, datadir):
        """Implement dry-run for LVM snapshots.
        """
        LOG.info("* Would snapshot source volume %s/%s as %s/%s (size=%s)",
             volume.vg_name,
             volume.lv_name,
             volume.vg_name,
             snapshot.name,
             format_bytes(snapshot.size*int(volume.vg_extent_size)))
        LOG.info("* Would mount on %s",
             snapshot.mountpoint or 'generated temporary directory')

        snapshot_mountpoint = snapshot.mountpoint or tempfile.gettempdir()
        if getmount(self.target_directory) == getmount(datadir):
            LOG.error("Backup directory %s is on the same filesystem as "
                      "the source logical volume %s.",
                      self.target_directory, volume.device_name())
            LOG.error("This will result in very poor performance and "
                      "has a high potential for failed backups.")
            raise BackupError("Improper backup configuration for LVM.")