Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1766461

Summary: Run the "imgbase rollback" command after upgrading, the default boot entry is not on the previous layer
Product: Red Hat Enterprise Virtualization Manager Reporter: peyu
Component: redhat-virtualization-hostAssignee: Nir Levy <nlevy>
Status: CLOSED DUPLICATE QA Contact: peyu
Severity: high Docs Contact:
Priority: high    
Version: 4.3.7CC: cshao, lsvaty, mavital, nlevy, peyu, qiyuan, sbonazzo, weiwang, yaniwang, yturgema
Target Milestone: ovirt-4.3.7   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-04 06:55:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Node RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
boot_entry_after_rollback none

Description peyu 2019-10-29 06:43:35 UTC
Description of problem:
1. After the upgrade is complete, run the "imgbase rollback" command. After rebooting, the default boot entry is not on the previous layer.
2. Run the "nodectl rollback" command, an error occurred.

Version-Release number of selected component (if applicable):
rhvh-4.3.7.0-0.20191024.0

How reproducible:
100%

Steps to Reproduce:
1. Install rhvh-4.1-0.20180420.0
2. Setup local repo in RHVH, pointing to "redhat-virtualization-host-image-update-4.3.7-20191024.0.el7_7.noarch.rpm"
3. Upgrade to the latest build rhvh-4.3.7.0-0.20191024.0
   # yum update
4. Reboot, login to the default boot entry and check:
   # imgbase w
   # imgbase layout
   # nodectl info
5. Rollback to previous layer
   # imgbase rollback
6. Reboot and focus on boot entry and check:
   # imgbase w   
   # imgbase layout
   # nodectl info
7. Run command
   # nodectl rollback

Actual results:
1. The results of step 1 to step 4 are correct.

2. The result of step 5 and step 6: 
1) The default boot entry is not on the previous layer(rhvh-4.1-0.20180420.0), but still on the latest layer(rhvh-4.3.7.0-0.20191024.0). 
Please refer to the attached screen-shot "boot_entry_after_rollback.png"

2)# imgbase w
You are on rhvh-4.3.7.0-0.20191024.0+1

# imgbase layout
rhvh-4.1-0.20180420.0
 +- rhvh-4.1-0.20180420.0+1
rhvh-4.3.7.0-0.20191024.0
 +- rhvh-4.3.7.0-0.20191024.0+1

# nodectl info
layers: 
  rhvh-4.3.7.0-0.20191024.0: 
    rhvh-4.3.7.0-0.20191024.0+1
  rhvh-4.1-0.20180420.0: 
    rhvh-4.1-0.20180420.0+1
bootloader: 
  default: rhvh-4.3.7.0-0.20191024.0 (3.10.0-1062.5.1.el7.x86_64)
  entries: 
    rhvh-4.3.7.0-0.20191024.0 (3.10.0-1062.5.1.el7.x86_64): 
      index: 0
      title: rhvh-4.3.7.0-0.20191024.0 (3.10.0-1062.5.1.el7.x86_64)
      kernel: /boot/rhvh-4.3.7.0-0.20191024.0+1/vmlinuz-3.10.0-1062.5.1.el7.x86_64
      args: "ro crashkernel=auto rd.lvm.lv=rhvh_hp-dl380g10-05/swap rd.lvm.lv=rhvh_hp-dl380g10-05/rhvh-4.3.7.0-0.20191024.0+1 rhgb quiet LANG=en_US.UTF-8 img.bootid=rhvh-4.3.7.0-0.20191024.0+1"
      initrd: /boot/rhvh-4.3.7.0-0.20191024.0+1/initramfs-3.10.0-1062.5.1.el7.x86_64.img
      root: /dev/rhvh_hp-dl380g10-05/rhvh-4.3.7.0-0.20191024.0+1
    rhvh-4.1-0.20180420.0: 
      index: 1
      title: rhvh-4.1-0.20180420.0
      kernel: /boot/rhvh-4.1-0.20180420.0+1/vmlinuz-3.10.0-862.el7.x86_64
      args: "ro crashkernel=auto rd.lvm.lv=rhvh_hp-dl380g10-05/swap rd.lvm.lv=rhvh_hp-dl380g10-05/rhvh-4.1-0.20180420.0+1 rhgb quiet LANG=en_US.UTF-8 img.bootid=rhvh-4.1-0.20180420.0+1"
      initrd: /boot/rhvh-4.1-0.20180420.0+1/initramfs-3.10.0-862.el7.x86_64.img
      root: /dev/rhvh_hp-dl380g10-05/rhvh-4.1-0.20180420.0+1
current_layer: rhvh-4.3.7.0-0.20191024.0+1


3. The result of step 7 is as follows:
# nodectl rollback
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 171
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 172
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 180
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 872, in emit
    stream.write(fs % msg)
TypeError: unicode argument expected, got 'str'
Logged from file update.py, line 181
Status: Success
  New layer: rhvh-4.1-0.20180420.0+1



Expected results:
1. After rollback, the default boot entry is on the previous layer(rhvh-4.1-0.20180420.0)

2. The "nodectl rollback" command can be executed correctly.




Additional info:

Comment 1 peyu 2019-10-29 06:52:48 UTC
Created attachment 1630022 [details]
boot_entry_after_rollback

Comment 2 peyu 2019-10-30 08:59:23 UTC
I tried to reproduce this bug again today. The results are different. The current situation is as follows:

Steps to Reproduce:
1. The steps to reproduce the bug are the same as the steps above.

Actual results:
1. After the upgrade is complete, enter rhvh-4.3.7.0-0.20191024.0 and run "imgbase rollback", this can be successful. It rolled back to rhvh-4.1-0.20180420.0.
2. Reboot and enter rhvh-4.1-0.20180420.0, run "imgbase rollback" to roll back to rhvh-4.3.7.0-0.20191024.0, it can not work.

Expected results:
1. rhvh-4.3.7.0-0.20191024.0 can roll back to rhvh-4.1-0.20180420.0, rhvh-4.1-0.20180420.0 can also roll back to rhvh-4.3.7.0-0.20191024.0

Comment 4 Nir Levy 2019-11-04 06:55:13 UTC

*** This bug has been marked as a duplicate of bug 1764534 ***