Bug 1377758

Summary: engine-setup and ovirt-engine-rename fail if fqdn is empty string
Product: [oVirt] ovirt-engine Reporter: Tareq Alayan <talayan>
Component: Tools.RenameAssignee: Yedidyah Bar David <didi>
Status: CLOSED WONTFIX QA Contact: Pavel Stehlik <pstehlik>
Severity: low Docs Contact:
Priority: low    
Version: 4.0.4.3CC: bugs, jbelka, talayan, ylavi
Target Milestone: ---   
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: 2018-06-25 07:30:06 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:
Bug Depends On: 1378352    
Bug Blocks:    
Attachments:
Description Flags
logs none

Description Tareq Alayan 2016-09-20 14:35:19 UTC
Created attachment 1202933 [details]
logs

Description of problem:
We had to move the virtual machine that hosts the engine to a different host which causes to have an IP change.
So we run the utility ovirt-engine-rename and didn't work

Version-Release number of selected component (if applicable):
rhevm-4.0.4.3-0.1.el7ev.noarch
ovirt-engine-setup-base-4.0.4.3-0.1.el7ev.noarch

How reproducible:
always

Steps to Reproduce:
simply run the command as appears in https://www.ovirt.org/documentation/how-to/networking/changing-engine-hostname/


/usr/share/ovirt-engine/setup/bin/ovirt-engine-rename --newname=jenkins-vm-14.qa.lab.tlv.redhat.com --otopi-environment="OSETUP_RENAME/forceIgnoreAIAInCA=bool:'True' OVESETUP_CORE/engineStop=bool:'True' OSETUP_RENAME/confirmForceOverwrite=bool:'False'"
[ INFO  ] Stage: Initializing
         
          Welcome to the ovirt-engine-rename utility
         
          More details about the operation and possible implications
          of running this utility can be found here:
          http://www.ovirt.org/Changing_Engine_Hostname
         
[ INFO  ] Stage: Environment setup
          Configuration files: ['/etc/ovirt-engine-setup.conf.d/10-packaging-wsp.conf', '/etc/ovirt-engine-setup.conf.d/10-packaging.conf', '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf']
          Log file: /var/log/ovirt-engine/setup/ovirt-engine-rename-20160920164759-81l1or.log
          Version: otopi-1.5.2 (otopi-1.5.2-1.el7ev)
[ INFO  ] Stage: Environment packages setup
[ INFO  ] Stage: Programs detection
[ INFO  ] Stage: Environment setup
[ INFO  ] Stage: Environment customization
[ ERROR ] Host name is not valid: Please specify host FQDN
[ ERROR ] Failed to execute stage 'Environment customization': Host name is not valid: Please specify host FQDN
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-rename-20160920164759-81l1or.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20160920164801-rename.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of rename failed

Actual results:


Expected results:


Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-09-21 08:57:10 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Jiri Belka 2016-09-21 09:01:27 UTC
> /usr/share/ovirt-engine/setup/bin/ovirt-engine-rename
> --newname=jenkins-vm-14.qa.lab.tlv.redhat.com
> --otopi-environment="OSETUP_RENAME/forceIgnoreAIAInCA=bool:'True'
> OVESETUP_CORE/engineStop=bool:'True'
> OSETUP_RENAME/confirmForceOverwrite=bool:'False'"

RHVM Upgrade Guide doesn't mention to use '--otopi-environment' options, see https://access.redhat.com/documentation/en/red-hat-virtualization/4.0/paged/upgrade-guide/32-upgrading-to-red-hat-virtualization-manager-40 Thus maybe it is not necessary.

Comment 3 Yedidyah Bar David 2016-09-21 11:56:55 UTC
I looked at the machine on which you ran this, and I see in ovirt-engine-rename-20160920150315-j1klg5.log:

2016-09-20 15:03:15 DEBUG otopi.context context.dumpEnvironment:770 ENV OSETUP_RENAME/fqdn=str:''

This appears at a very early stage, before any interaction.

Any chance you ran there something like:

/usr/share/ovirt-engine/setup/bin/ovirt-engine-rename --newname=

?

That is, with an empty newname?

The sequence of events I see there is:

1. Several runs of engine-setup, all successful and ok
2. Above run of ovirt-engine-rename to an empty fqdn, also finished successfully and set fqdn to be the empty string (can be seen also in /etc/ovirt-engine/engine.conf.d/10-setup-protocols.conf.20160920165447 )
3. Several runs of setup and rename, all failing with a similar error message.
4. Two successful runs of rename, probably done after manually changing /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf .
5. I now manually ran there '/usr/share/ovirt-engine/setup/bin/ovirt-engine-rename --newname=' and it succeeded too.

So current bug is something like:

Running setup or rename after renaming the engine to '' fails

A different bug you might consider is:

rename allows setting an empty new name using the command line option --newname= .

I'd not consider any of them severe. Both probably affect at least 3.6, perhaps even 3.3, didn't check, and this is the first report I received about them.

Tareq: Any idea what exact command you used for this log (created at 2016-09-20-15:03:15)?

Comment 4 Tareq Alayan 2016-09-21 13:14:43 UTC
I am not sure what i ran that time. 
But what i know is that i also ran ./ovirt-engine-rename --newname=jenkins-vm-14.qa.lab.tlv.redhat.com --otopi-environment="OSETUP_RENAME/forceIgnoreAIAInCA=bool:'True' OVESETUP_CORE/engineStop=bool:'True' OSETUP_RENAME/confirmForceOverwrite=bool:'False' OVESETUP_CONFIG/fqdn=str:jenkins-vm-14.qa.lab.tlv.redhat.com"

because it was complaining about missing fqdn.

Comment 5 Yedidyah Bar David 2016-09-21 13:24:19 UTC
(In reply to Tareq Alayan from comment #4)
> I am not sure what i ran that time. 

OK

> But what i know is that i also ran ./ovirt-engine-rename
> --newname=jenkins-vm-14.qa.lab.tlv.redhat.com
> --otopi-environment="OSETUP_RENAME/forceIgnoreAIAInCA=bool:'True'
> OVESETUP_CORE/engineStop=bool:'True'
> OSETUP_RENAME/confirmForceOverwrite=bool:'False'
> OVESETUP_CONFIG/fqdn=str:jenkins-vm-14.qa.lab.tlv.redhat.com"
> 
> because it was complaining about missing fqdn.

Indeed, as explained in comment 3.

Comment 6 Yedidyah Bar David 2016-09-22 08:23:38 UTC
Do we want to have a different bz for 'rename allows setting an empty new name using the command line option --newname='? Might be a little more important than current. Once we fix that one, current is really not important.

Comment 7 Tareq Alayan 2016-09-22 08:52:25 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1378352

Comment 8 Yedidyah Bar David 2016-09-22 09:00:19 UTC
Changing summary following comment 3. Still didn't check what component will need to be fixed, might be both setup and rename.

Comment 9 Yedidyah Bar David 2017-09-24 06:33:06 UTC
*** Bug 1493971 has been marked as a duplicate of this bug. ***

Comment 10 Yaniv Lavi 2018-06-25 07:30:06 UTC
Closing old bugs.
Please reopen if still relevant.
Patches are welcomed.