Bug 1213930 - [RFE] ovirt-node-upgrade should check the iso before running the upgrade
Summary: [RFE] ovirt-node-upgrade should check the iso before running the upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-node
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ovirt-3.6.0-rc
: 3.6.0
Assignee: Douglas Schilling Landgraf
QA Contact: wanghui
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-21 14:57 UTC by Fabian Deutsch
Modified: 2016-03-09 14:27 UTC (History)
9 users (show)

Fixed In Version: ovirt-node-3.3.0-0.4.20150906git14a6024.el7ev
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-09 14:27:25 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0378 0 normal SHIPPED_LIVE ovirt-node bug fix and enhancement update for RHEV 3.6 2016-03-09 19:06:36 UTC
oVirt gerrit 40375 0 master MERGED upgrade: add step to execute checkisomd5 Never

Description Fabian Deutsch 2015-04-21 14:57:42 UTC
Description of problem:
ovirt-node-upgrade is used when RHEV-M is used for upgrading a RHEV-H.

It works by copying an iso to the rhevh host and the passing it to ovirt-node-upgrade.

To catch the case where the iso get's corrupted while beeing copied from rhevm to rhevh, checkisomd5 should be run as part of the upgrade process.

Version-Release number of selected component (if applicable):
3.5

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Fabian Deutsch 2015-04-28 08:05:15 UTC
The reason for this RFE is that we had cases where the ISO used for upgrading got corrupted while being copied from RHEV-M to RHEV-H, possibly due to network problems.

This RFE can be tested by:

1. Install rhevh iso rpm on Engine
1.a Corrupt the iso on the engine using: dd if=/dev/urandom bs=1c count=1 conv=notrunc seek=$RANDOM of=<rhevh-iso-filename>
1.b Verify that the iso is corrupted by running: checkisomd5 <rhevh-iso-filename> (it should FAIL)
2. Start the upgrade
3. The upgrade should fail, noting that the iso is corrupted

Comment 2 Douglas Schilling Landgraf 2015-04-28 18:23:50 UTC
Hi QE,

Below the sanity test from the patch testing, please also trigger the upgrade from RHEV-M during the official tests, it should go without any issue as it calls the ovirt-node-upgrade tool.

# cat /etc/redhat-release 
oVirt Node Hypervisor 3.5 (0.999.201504271901.el6)

Generating bad iso as Fabian pointed in comment#1
===================================================
dd if=/dev/urandom bs=1c count=1 conv=notrunc seek=12345 of=ovirt-node-bad.iso 

Scenario 1 - failing in the upgrade
============================================
# ovirt-node-upgrade.py --reboot=0 --iso=./ovirt-node-bad.iso 
ovirt-node-upgrade.UpgradeTool: INFO     Temporary Directory is: /data/tmp9sPdaD
ovirt-node-upgrade.LockFile: INFO     Acquiring Lock
ovirt-node-upgrade.UpgradeTool: INFO     Checking iso md5
ovirt-node-upgrade.UpgradeTool: ERROR    Error: Upgrade Failed: Command Failed: '('checkisomd5', './1ovirt-node-apr23.iso')' [u'Press [Esc] to abort check.']
Traceback (most recent call last):
  File "./ovirt-node-upgrade.py", line 368, in run
    self._checkisomd5(self._options.iso_file)
  File "./ovirt-node-upgrade.py", line 323, in _checkisomd5
    self._system("checkisomd5", isofile)
  File "./ovirt-node-upgrade.py", line 145, in _system
    raise RuntimeError("Command Failed: '%s' %s" % (command, output))
RuntimeError: Command Failed: '('checkisomd5', './1ovirt-node-apr23.iso')' [u'Press [Esc] to abort check.']
ovirt-node-upgrade.UpgradeTool: INFO     Running rollback hooks
ovirt-node-upgrade.UpgradeTool: INFO     rollback hooks completed
ovirt-node-upgrade.UpgradeTool: INFO     Warning: /data/tmp9sPdaD/rootfs/usr/libexec/ovirt-node/hooks/rollback does not exist
ovirt-node-upgrade.UpgradeTool: INFO     Upgrade Failed, Rollback Completed
ovirt-node-upgrade.UpgradeTool: INFO     Cleaning up temporary directory
ovirt-node-upgrade.UpgradeTool: WARNING  Cleanup Failed

Scenario 2 - ISO OK
=========================
# python ./ovirt-node-upgrade.py --reboot=0 --iso=./ovirt-node.iso 
ovirt-node-upgrade.UpgradeTool: INFO     Temporary Directory is: /data/tmpSK3qZw
ovirt-node-upgrade.LockFile: INFO     Acquiring Lock
ovirt-node-upgrade.UpgradeTool: INFO     Checking iso md5
                                        ^^^^^ <--- new item
ovirt-node-upgrade.UpgradeTool: INFO     Running pre-upgrade hooks
ovirt-node-upgrade.UpgradeTool: INFO     pre-upgrade hooks completed
ovirt-node-upgrade.UpgradeTool: INFO     Running pre-upgrade hooks
ovirt-node-upgrade.UpgradeTool: INFO     pre-upgrade hooks completed
ovirt-node-upgrade.UpgradeTool: INFO     hooks: False
ovirt-node-upgrade.UpgradeTool: INFO     Installing Bootloader
ovirt-node-upgrade.UpgradeTool: INFO     Running post-upgrade hooks
ovirt-node-upgrade.UpgradeTool: INFO     post-upgrade hooks completed
ovirt-node-upgrade.UpgradeTool: INFO     Running post-upgrade hooks
ovirt-node-upgrade.UpgradeTool: INFO     post-upgrade hooks completed
ovirt-node-upgrade.UpgradeTool: INFO     Upgrade Completed
ovirt-node-upgrade.UpgradeTool: INFO     Cleaning up temporary directory

Comment 3 wanghui 2015-10-29 07:49:09 UTC
Test version:
rhev-hypervisor7-7.2-20151025.0.el7ev
ovirt-node-3.3.0-0.18.20151022git82dc52c.el7ev.noarch

Test steps:
Scenario1:
1. Clean install rhev-hypervisor7-7.2-20151025.0.el7ev
2. Drop to shell and run
   #dd if=/dev/urandom bs=1c count=1 conv=notrunc seek=12345 of=ovirt-node-bad.iso
   # ovirt-node-upgrade --reboot=0 --iso=ovirt-node-bad.iso 

Test result:
1. # ovirt-node-upgrade --reboot=0 --iso=ovirt-node-bad.iso
ovirt-node-upgrade.UpgradeTool: INFO     Temporary Directory is: /data/tmp0hDi82
ovirt-node-upgrade.LockFile: INFO     Acquiring Lock
ovirt-node-upgrade.UpgradeTool: INFO     Checking iso md5
ovirt-node-upgrade.UpgradeTool: ERROR    Error: Upgrade Failed: Command Failed: '('checkisomd5', 'ovirt-node-bad.iso')' [u'Press [Esc] to abort check.']
Traceback (most recent call last):
  File "/sbin/ovirt-node-upgrade", line 368, in run
    self._checkisomd5(self._options.iso_file)
  File "/sbin/ovirt-node-upgrade", line 323, in _checkisomd5
    self._system("checkisomd5", isofile)
  File "/sbin/ovirt-node-upgrade", line 145, in _system
    raise RuntimeError("Command Failed: '%s' %s" % (command, output))
RuntimeError: Command Failed: '('checkisomd5', 'ovirt-node-bad.iso')' [u'Press [Esc] to abort check.']
ovirt-node-upgrade.UpgradeTool: INFO     Running rollback hooks
ovirt-node-upgrade.UpgradeTool: INFO     rollback hooks completed
ovirt-node-upgrade.UpgradeTool: INFO     Warning: /data/tmp0hDi82/rootfs/usr/libexec/ovirt-node/hooks/rollback does not exist
ovirt-node-upgrade.UpgradeTool: INFO     Upgrade Failed, Rollback Completed
ovirt-node-upgrade.UpgradeTool: INFO     Cleaning up temporary directory
ovirt-node-upgrade.UpgradeTool: WARNING  Cleanup Failed

Scenario2:
1. Copy a create iso to rhevh first
2. # ovirt-node-upgrade --reboot=0 --iso=rhevh-7.2-20151025.0.el7ev.iso 

Test result:
1. Upgrade succeed.


So this issue is fixed in ovirt-node-3.3.0-0.18.20151022git82dc52c.el7ev.noarch. Change the status to verified.

Comment 5 errata-xmlrpc 2016-03-09 14:27:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0378.html


Note You need to log in before you can comment on or make changes to this bug.