'Delete the given backup from TSM server.
:param backup: backup information for volume
:raises: InvalidBackup'

def delete_backup(self, backup):

    delete_attrs = {'Total    number    of    objects    deleted': '1'}
    (delete_path, backup_mode) = _get_backup_metadata(backup, 'restore')
    LOG.debug('Delete    started    for    backup:    %(backup)s,    mode:    %(mode)s.', {'backup': backup.id, 'mode': backup_mode})
    try:
        (out, err) = utils.execute('dsmc', 'delete', 'backup', '-quiet', '-noprompt', ('-objtype=%s' % backup_mode), ('-password=%s' % self.tsm_password), delete_path, run_as_root=True, check_exit_code=False)
    except processutils.ProcessExecutionError as exc:
        err = (_('delete:    %(vol_id)s    failed    to    run    dsmc    with    stdout:    %(out)s\n    stderr:    %(err)s') % {'vol_id': backup.volume_id, 'out': exc.stdout, 'err': exc.stderr})
        LOG.error(err)
        raise exception.InvalidBackup(reason=err)
    except exception.Error as exc:
        err = (_('delete:    %(vol_id)s    failed    to    run    dsmc    due    to    invalid    arguments    with    stdout:    %(out)s\n    stderr:    %(err)s') % {'vol_id': backup.volume_id, 'out': exc.stdout, 'err': exc.stderr})
        LOG.error(err)
        raise exception.InvalidBackup(reason=err)
    success = _check_dsmc_output(out, delete_attrs)
    if (not success):
        LOG.error('delete:    %(vol_id)s    failed    with    stdout:    %(out)s\n    stderr:    %(err)s', {'vol_id': backup.volume_id, 'out': out, 'err': err})
    LOG.debug('Delete    %s    finished.', backup['id'])
