xenserver / host-installer

XenServer Installer
Other
4 stars 18 forks source link

[xs8] "restore" with UEFI is broken #150

Open ydirson opened 2 days ago

ydirson commented 2 days ago

In https://github.com/xenserver/host-installer/blob/release/xs8/restore.py#L196-L212 we see backup_fs being unmounted and then used, resulting in the crash shown below.

Problem was introduced in v10.10.14 with https://github.com/xenserver/host-installer/commit/e9d686ae17bfcad5383f2d89d6bf848c3abd9a3b#diff-2f9ea690c2cdc310e67485fde6a0d74fd91f25e9ac5f5bc6054961b742de74a8R193 (with a commit that does not exist on master)

INFO     [2024-07-03 08:01:07] Data restoration complete.  About to re-install bootloader.
INFO     [2024-07-03 08:01:07] Unmounting /tmp/restore-backup-cRo2Wv (force = False)
INFO     [2024-07-03 08:01:07] ran ['/bin/umount', '-d', '/tmp/restore-backup-cRo2Wv']; rc 0
...
INFO     [2024-07-03 08:01:08] INSTALL FAILED.
INFO     [2024-07-03 08:01:08] A fatal exception occurred:
INFO     [2024-07-03 08:01:08] Traceback (most recent call last):
  File "/opt/xensource/installer/install.py", line 269, in go
    restore.restoreFromBackup(backup, progress)
  File "/opt/xensource/installer/restore.py", line 212, in restoreFromBackup
    branding = util.readKeyValueFile(os.path.join(backup_fs.mount_point, constants.INVENTORY_FILE))
  File "/opt/xensource/installer/util.py", line 322, in readKeyValueFile
    f = open(filename, "r")
IOError: [Errno 2] No such file or directory: '/tmp/restore-backup-cRo2Wv/etc/xensource-inventory'
freddy77 commented 2 days ago

Yes, we should probably get the "branding" before unmounting the backup file system.

ydirson commented 2 days ago

As noted in #151 this is not the only problem in the UEFI code path.