Bug 1396193

Summary: Hosted Engine upgrade is failing during engine-setup if the db backup file is not in /root/
Product: [oVirt] ovirt-hosted-engine-setup Reporter: sefi litmanovich <slitmano>
Component: Plugins.GeneralAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED CURRENTRELEASE QA Contact: sefi litmanovich <slitmano>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.0.3.1CC: bugs, dfediuck, ylavi
Target Milestone: ovirt-4.0.6Flags: rule-engine: ovirt-4.0.z?
rule-engine: devel_ack+
rule-engine: testing_ack+
Target Release: 2.0.4.1   
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: 2017-01-18 07:26:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1394740, 1396051    

Description sefi litmanovich 2016-11-17 17:25:12 UTC
Description of problem:
When running hosted-engine --upgrade-appliance a backup is created by the user and copied to the host in order to later copy it back to the new appliance instance. The path to the backup file in the host that is given by the user in the dialog is later used when running the restore cmd in the new appliance.
But when copying the backup file from the host to the appliance it is always copied to /root/{file_name} therefore failing the restore cmd that doesn't find the backup file. 

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-2.0.3-2.el7ev.noarch

How reproducible:
always

Steps to Reproduce:
1. have a HE 3.6 running.
2. Update the host's repos for 4.0
3. Put HE to global maintenance mode
4. install latest 4.0 appliance on the host
5. run hosted-engine --upgrade-appliance
6. During the process ssh to the engine and create a backup using engine-backup tool.
7. copy the backup file to some path in the host (different than /root/)
8. proceed with upgrade flow and when asked give the path to the backup file on the host.

Actual results:
At the engine-backup --mode=restore phase, the upgrade will fail in the setup log we get:

2016-11-17 12:38:57 INFO otopi.plugins.gr_he_common.engine.health health._closeup:130 Running engine-setup on the appliance
2016-11-17 12:39:17 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                 |- FATAL: /var/tmp/engine_backup.tar.gz does not exist
2016-11-17 12:39:17 DEBUG otopi.plugins.otopi.dialog.human dialog.__logString:204 DIALOG:SEND                 |- HE_APPLIANCE_ENGINE_RESTORE_FAIL
2016-11-17 12:39:17 ERROR otopi.plugins.gr_he_common.engine.health health._closeup:157 Engine backup restore failed on the appliance
2016-11-17 12:39:17 DEBUG otopi.context context._executeMethod:142 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/gr-he-common/engine/health.py", line 161, in _closeup
    'engine-backup failed restoring the engine backup '
RuntimeError: engine-backup failed restoring the engine backup on the appliance
Please check its log on the appliance.

2016-11-17 12:39:17 ERROR otopi.context context._executeMethod:151 Failed to execute stage 'Closing up': engine-backup failed restoring the engine backup on the appliance
Please check its log on the appliance.


Expected results:
The backup file is created in the same path that was given in the host.
Another option is to make sure the restore cmd always look for the path /root/{file_name}

Additional info:

Comment 1 sefi litmanovich 2016-12-06 14:28:34 UTC
Verified on ovirt-hosted-engine-setup-2.0.4.1-2.el7ev.noarch.