Skip to content

oVirt plugin: fix restore problem to local disk#534

Merged
pstorz merged 1 commit intomasterfrom
dev/pstorz/master/oVirt-restore-bug-fix
May 29, 2020
Merged

oVirt plugin: fix restore problem to local disk#534
pstorz merged 1 commit intomasterfrom
dev/pstorz/master/oVirt-restore-bug-fix

Conversation

@pstorz
Copy link
Member

@pstorz pstorz commented May 28, 2020

Fix local restore problem introduced with commit 1120208.

During local restore, the restore is cancelled with a KeyError:

File "BareosFdWrapper.py", line 66, in create_file
  return bareos_fd_plugin_object.create_file(context, restorepkt)
File "BareosFdPluginOvirt.py", line 268, in create_file
  context, restorepkt.ofname
File "BareosFdPluginOvirt.py", line 1521, in get_ovf_disk_alias_by_basename
  return self.ovf_disks_by_alias_and_fileref[relname]["disk-alias"]

KeyError: ('testvm1_thin_cow-3b0d105b-0803-4964-be21-ede95153761c/524941fd-ef79-494f-9831-1d49cff9ed76',)

The cause is that the disk alias filtering uses information that is not
fetched from the oVirt Server during local install, as it is not
contacted at all.

During local install, no disks are filtered and every disk backed up will be
restored.

Fixes #1246: oVirt plugin fails to restore to local disk with KeyError

Fix local restore problem introduced with commit 1120208.

During local restore, the restore is cancelled with a KeyError:

    File "BareosFdWrapper.py", line 66, in create_file
      return bareos_fd_plugin_object.create_file(context, restorepkt)
    File "BareosFdPluginOvirt.py", line 268, in create_file
      context, restorepkt.ofname
    File "BareosFdPluginOvirt.py", line 1521, in get_ovf_disk_alias_by_basename
      return self.ovf_disks_by_alias_and_fileref[relname]["disk-alias"]
  KeyError: ('testvm1_thin_cow-3b0d105b-0803-4964-be21-ede95153761c/524941fd-ef79-494f-9831-1d49cff9ed76',)

The cause is that the disk alias filtering uses information that is not
fetched from the oVirt Server during local install, as it is not
contacted at all.

During local install, no disks are filtered and every disk backed up will be
restored.

Fixes #1246: oVirt plugin fails to restore to local disk with KeyError
@pstorz pstorz requested a review from sduehr May 28, 2020 16:11
Copy link
Member

@sduehr sduehr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the fix.

@pstorz pstorz merged commit 8e364c2 into master May 29, 2020
@pstorz pstorz deleted the dev/pstorz/master/oVirt-restore-bug-fix branch May 29, 2020 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants