Bug 1881250 - [RFE] validate engine FQDN if --restore-from-file
Summary: [RFE] validate engine FQDN if --restore-from-file
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-hosted-engine-setup
Version: 4.3.10
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-4.4.4
: 4.4.4
Assignee: Asaf Rachmani
QA Contact: Nikolai Sednev
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-22 00:26 UTC by Germano Veit Michel
Modified: 2023-12-15 19:27 UTC (History)
6 users (show)

Fixed In Version: ovirt-hosted-engine-setup-2.4.8
Doc Type: Enhancement
Doc Text:
Before this update, when restoring a self-hosted engine you needed to enter the same FQDN that you used in the backup. With this update, when you run `hosted-engine --deploy --restore-from-file=backup_file` deploy script fetches the FQDN from the backup file and you don't need to enter it.
Clone Of:
Environment:
Last Closed: 2021-02-02 13:59:36 UTC
oVirt Team: Integration
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
backup file from engine (968.84 KB, application/gzip)
2020-11-18 09:09 UTC, Nikolai Sednev
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5420441 0 None None None 2020-09-22 00:27:33 UTC
Red Hat Product Errata RHBA-2021:0382 0 None None None 2021-02-02 13:59:55 UTC
oVirt gerrit 111810 0 master MERGED plugins: cloud_init: Fetch FQDN from the backup file 2021-02-02 07:04:09 UTC

Description Germano Veit Michel 2020-09-22 00:26:47 UTC
Description of problem:

ovirt-hosted-engine-setup asks for engine FQDN during --restore-from-file too :

            prompttext=_(
                'Please provide the FQDN for the engine '
                'you would like to use.\nThis needs to match '
                'the FQDN that you will use for the engine '
                'installation within the VM.\n'
                'Note: This will be the FQDN of the VM '
                'you are now going to create,\nit should not '
                'point to the base host or to any other '
                'existing machine.\nEngine FQDN: '
            ),

If the user does not enter the same FQDN as it is in the backup file, the deployment fails:

2020-09-17 15:22:24,268-0300 ERROR otopi.ovirt_hosted_engine_setup.ansible_utils ansible_utils._process_output:107 AuthError: Error during SSO authentication access_denied : Cannot authenticate user 'None@N/A': No valid profile found in credentials..

Because of this:

2020-09-17 15:22:23,969-03 ERROR [org.ovirt.engine.core.aaa.filters.SsoRestApiAuthFilter] (default task-1) [] Cannot authenticate using authentication Headers: server_error: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@78611b42; line: 1, column: 2]
2020-09-17 15:22:23,986-03 ERROR [org.ovirt.engine.core.sso.utils.SsoUtils] (default task-1) [] OAuthException access_denied: Cannot authenticate user 'None@N/A': No valid profile found in credentials.

This is due to the FQDN mismatch on the restored configuration with what is configured on the new SHE VM. Could you please investigate if it is possible to use the FQDN from the backup file and not even ask this, or validate the FQDN against the value on the backup file. If not possible, maybe improve the dialog text to explain that SHE restore from backup is not the time to change FQDN.

Although the documentation states the same FQDN needs to be used, a proper check on during deployment can help customers to avoid customers hitting problems during restore and move to SHE.

Comment 1 Nikolai Sednev 2020-10-28 13:40:04 UTC
What should be exact steps for reproduction?
What the patch is fixing?

Comment 2 Asaf Rachmani 2020-10-29 12:44:18 UTC
(In reply to Nikolai Sednev from comment #1)
> What should be exact steps for reproduction?
> What the patch is fixing?

1. Backup the engine
2. On a new host run hosted-engine --deploy --restore-from-file=backup_file

Before this patch, you have to enter the same FQDN as you used in the backup.
This patch fetches the FQDN from the backup file and you don't need to enter it during the deployment.

Look at the steps from https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.3/html/migrating_from_a_standalone_manager_to_a_self-hosted_engine/restoring_the_backup_on_a_new_self-hosted_engine_migrating_to_she
With the patch, we don't need step 8.

Comment 3 Steve Goodman 2020-10-29 13:21:29 UTC
Asaf, how's this for a release note?

Before this update, when restoring a self-hosted engine you needed to enter the same FQDN that you used in the backup. With this update, when you run `hosted-engine --deploy --restore-from-file=backup_file` deploy script fetches the FQDN from the backup file and you don't need to enter it.

Comment 8 Nikolai Sednev 2020-11-17 15:19:43 UTC
The FQDN is inherited properly from backup file, but then comes question:
[ INFO  ] Using Engine VM FQDN nsednev-he-2.qa.lab.tlv.redhat.com from backup file.
          Please provide the domain name you would like to use for the engine appliance.
          Engine VM domain: [qa.lab.tlv.redhat.com]
Why do I need to confirm an obvious "Engine VM domain" if it exists in backup file?

Tested on:
ovirt-ansible-collection-1.2.2-1.el8ev.noarch
ansible-2.9.14-1.el8ae.noarch
ovirt-hosted-engine-setup-2.4.8-1.el8ev.noarch
ovirt-hosted-engine-ha-2.4.5-1.el8ev.noarch
rhvm-appliance-4.4-20201111.0.el8ev.x86_64
Linux 4.18.0-240.4.1.el8_3.x86_64 #1 SMP Wed Nov 11 08:19:41 EST 2020 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux release 8.3 (Ootpa)

Please refine also "Engine VM domain".

Comment 9 Asaf Rachmani 2020-11-18 08:15:35 UTC
(In reply to Nikolai Sednev from comment #8)
> The FQDN is inherited properly from backup file, but then comes question:
> [ INFO  ] Using Engine VM FQDN nsednev-he-2.qa.lab.tlv.redhat.com from
> backup file.
>           Please provide the domain name you would like to use for the
> engine appliance.
>           Engine VM domain: [qa.lab.tlv.redhat.com]
> Why do I need to confirm an obvious "Engine VM domain" if it exists in
> backup file?

Can you please point me to where the "Engine VM domain" shows in the backup file? 

> 
> Tested on:
> ovirt-ansible-collection-1.2.2-1.el8ev.noarch
> ansible-2.9.14-1.el8ae.noarch
> ovirt-hosted-engine-setup-2.4.8-1.el8ev.noarch
> ovirt-hosted-engine-ha-2.4.5-1.el8ev.noarch
> rhvm-appliance-4.4-20201111.0.el8ev.x86_64
> Linux 4.18.0-240.4.1.el8_3.x86_64 #1 SMP Wed Nov 11 08:19:41 EST 2020 x86_64
> x86_64 x86_64 GNU/Linux
> Red Hat Enterprise Linux release 8.3 (Ootpa)
> 
> Please refine also "Engine VM domain".

Comment 10 Nikolai Sednev 2020-11-18 09:07:52 UTC
(In reply to Asaf Rachmani from comment #9)
> (In reply to Nikolai Sednev from comment #8)
> > The FQDN is inherited properly from backup file, but then comes question:
> > [ INFO  ] Using Engine VM FQDN nsednev-he-2.qa.lab.tlv.redhat.com from
> > backup file.
> >           Please provide the domain name you would like to use for the
> > engine appliance.
> >           Engine VM domain: [qa.lab.tlv.redhat.com]
> > Why do I need to confirm an obvious "Engine VM domain" if it exists in
> > backup file?
> 
> Can you please point me to where the "Engine VM domain" shows in the backup
> file? 
> 
> > 
> > Tested on:
> > ovirt-ansible-collection-1.2.2-1.el8ev.noarch
> > ansible-2.9.14-1.el8ae.noarch
> > ovirt-hosted-engine-setup-2.4.8-1.el8ev.noarch
> > ovirt-hosted-engine-ha-2.4.5-1.el8ev.noarch
> > rhvm-appliance-4.4-20201111.0.el8ev.x86_64
> > Linux 4.18.0-240.4.1.el8_3.x86_64 #1 SMP Wed Nov 11 08:19:41 EST 2020 x86_64
> > x86_64 x86_64 GNU/Linux
> > Red Hat Enterprise Linux release 8.3 (Ootpa)
> > 
> > Please refine also "Engine VM domain".

I'm not aware of the direct place, the question comes right after FQDN being provided, the "Engine VM domain" is the qa.lab.tlv.redhat.com, while FQDN is nsednev-he-2.qa.lab.tlv.redhat.com, which means that even if "Engine VM domain" does not exists in the backup, we can get it from FQDN.

Comment 11 Nikolai Sednev 2020-11-18 09:09:00 UTC
Created attachment 1730495 [details]
backup file from engine

Comment 12 Asaf Rachmani 2020-11-18 10:10:18 UTC
(In reply to Nikolai Sednev from comment #10)
> (In reply to Asaf Rachmani from comment #9)
> > (In reply to Nikolai Sednev from comment #8)
> > > The FQDN is inherited properly from backup file, but then comes question:
> > > [ INFO  ] Using Engine VM FQDN nsednev-he-2.qa.lab.tlv.redhat.com from
> > > backup file.
> > >           Please provide the domain name you would like to use for the
> > > engine appliance.
> > >           Engine VM domain: [qa.lab.tlv.redhat.com]
> > > Why do I need to confirm an obvious "Engine VM domain" if it exists in
> > > backup file?
> > 
> > Can you please point me to where the "Engine VM domain" shows in the backup
> > file? 
> > 
> > > 
> > > Tested on:
> > > ovirt-ansible-collection-1.2.2-1.el8ev.noarch
> > > ansible-2.9.14-1.el8ae.noarch
> > > ovirt-hosted-engine-setup-2.4.8-1.el8ev.noarch
> > > ovirt-hosted-engine-ha-2.4.5-1.el8ev.noarch
> > > rhvm-appliance-4.4-20201111.0.el8ev.x86_64
> > > Linux 4.18.0-240.4.1.el8_3.x86_64 #1 SMP Wed Nov 11 08:19:41 EST 2020 x86_64
> > > x86_64 x86_64 GNU/Linux
> > > Red Hat Enterprise Linux release 8.3 (Ootpa)
> > > 
> > > Please refine also "Engine VM domain".
> 
> I'm not aware of the direct place, the question comes right after FQDN being
> provided, the "Engine VM domain" is the qa.lab.tlv.redhat.com, while FQDN is
> nsednev-he-2.qa.lab.tlv.redhat.com, which means that even if "Engine VM
> domain" does not exists in the backup, we can get it from FQDN.

AFAIK the hostname in FQDN might contain a dot (.), so we cannot be sure what is the correct domain name.
If you think the host cannot contain a dot, please open another RFE to remove the question about the domain name.
Please note that we have the same question during the normal HE deployment (not restore from file).

Comment 13 Nikolai Sednev 2020-11-18 11:41:12 UTC
(In reply to Asaf Rachmani from comment #12)
> (In reply to Nikolai Sednev from comment #10)
> > (In reply to Asaf Rachmani from comment #9)
> > > (In reply to Nikolai Sednev from comment #8)
> > > > The FQDN is inherited properly from backup file, but then comes question:
> > > > [ INFO  ] Using Engine VM FQDN nsednev-he-2.qa.lab.tlv.redhat.com from
> > > > backup file.
> > > >           Please provide the domain name you would like to use for the
> > > > engine appliance.
> > > >           Engine VM domain: [qa.lab.tlv.redhat.com]
> > > > Why do I need to confirm an obvious "Engine VM domain" if it exists in
> > > > backup file?
> > > 
> > > Can you please point me to where the "Engine VM domain" shows in the backup
> > > file? 
> > > 
> > > > 
> > > > Tested on:
> > > > ovirt-ansible-collection-1.2.2-1.el8ev.noarch
> > > > ansible-2.9.14-1.el8ae.noarch
> > > > ovirt-hosted-engine-setup-2.4.8-1.el8ev.noarch
> > > > ovirt-hosted-engine-ha-2.4.5-1.el8ev.noarch
> > > > rhvm-appliance-4.4-20201111.0.el8ev.x86_64
> > > > Linux 4.18.0-240.4.1.el8_3.x86_64 #1 SMP Wed Nov 11 08:19:41 EST 2020 x86_64
> > > > x86_64 x86_64 GNU/Linux
> > > > Red Hat Enterprise Linux release 8.3 (Ootpa)
> > > > 
> > > > Please refine also "Engine VM domain".
> > 
> > I'm not aware of the direct place, the question comes right after FQDN being
> > provided, the "Engine VM domain" is the qa.lab.tlv.redhat.com, while FQDN is
> > nsednev-he-2.qa.lab.tlv.redhat.com, which means that even if "Engine VM
> > domain" does not exists in the backup, we can get it from FQDN.
> 
> AFAIK the hostname in FQDN might contain a dot (.), so we cannot be sure
> what is the correct domain name.
> If you think the host cannot contain a dot, please open another RFE to
> remove the question about the domain name.
> Please note that we have the same question during the normal HE deployment
> (not restore from file).

So if we have the same question during initial deployment, the this value have to be saved to backup file. Can you check if it is there? Please see the attached backup file.

Comment 14 Asaf Rachmani 2020-11-22 15:38:56 UTC
(In reply to Nikolai Sednev from comment #13) 
> So if we have the same question during initial deployment, the this value
> have to be saved to backup file. Can you check if it is there? Please see
> the attached backup file.

We have it in the backup file.
Please open another RFE/bug for that.

Comment 15 Nikolai Sednev 2020-11-23 11:30:55 UTC
Opened as required https://bugzilla.redhat.com/show_bug.cgi?id=1900551

Comment 19 errata-xmlrpc 2021-02-02 13:59:36 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 (RHV RHEL Host (ovirt-host) 4.4.z [ovirt-4.4.4]), 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://access.redhat.com/errata/RHBA-2021:0382

Comment 20 meital avital 2022-08-07 12:53:23 UTC
Due to QE capacity, we are not going to cover this issue in our automation


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