Bug 978906 - host with no unique id can be activated
host with no unique id can be activated
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
Unspecified Unspecified
unspecified Severity low
: ---
: 3.3.0
Assigned To: Alon Bar-Lev
Dušan Kajan
: Reopened, ZStream
Depends On:
Blocks: 998539
  Show dependency treegraph
Reported: 2013-06-27 05:53 EDT by Dušan Kajan
Modified: 2016-02-10 14:06 EST (History)
12 users (show)

See Also:
Fixed In Version: is6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 998539 (view as bug list)
Last Closed: 2013-06-27 06:02:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
log from host-deploy (69.74 KB, text/x-log)
2013-06-27 05:53 EDT, Dušan Kajan
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 16523 None None None Never

  None (edit)
Description Dušan Kajan 2013-06-27 05:53:17 EDT
Created attachment 766029 [details]
log from host-deploy

Description of problem:
Although there is host in cluster, it is possible to add the same host if we use hostname instead of IP address (and vice versa)

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

How reproducible:

Steps to Reproduce:
1. Add host using its hostname
2. Add the same host using its IP adress

Actual results:
The host is added, only status install failed, but it is still possible to activate

Expected results:
The portal should not accept a host that is already in use

Additional info:
log from host-deploy added as attachment
Comment 1 Alon Bar-Lev 2013-06-27 06:02:28 EDT
Just for the record, it is almost impossible to know if host is the same host as host can have multiple interfaces and names.

*** This bug has been marked as a duplicate of bug 964967 ***
Comment 2 Itamar Heim 2013-07-05 03:18:21 EDT
isn't the uuid of the host supposed to fail adding/activating it?
Comment 3 Alon Bar-Lev 2013-07-05 14:41:59 EDT
(In reply to Itamar Heim from comment #2)
> isn't the uuid of the host supposed to fail adding/activating it?

When a host is added we cannot know what it is uuid, as uuid requires a logic within engine which is duplicate to host deploy, including creating vdsm id and so on, this was removed from engine in order to stop maintaining distributed duplicated algorithms throughout the project, and the past requirement to support complex dependency relationship matrix of components/versions. 

The duplicate uuid is discovered during host deploy reported to the engine to allow validation before performing the actual installation. The result is host is added, a message of duplicate uuid in event log and install failed status.

To provide earlier validation we added vdsm command to report uuid (bug#964967), that if found will be used during canDoAction of AddVdsCommand. This method does not resolve all cases, for example if host was added into engine, then completely re-installed, then re-deployed using different address, but the above safe guard will always discover that.

A better implementation compared to performing two ssh sessions (one at canDoAction and the other for host deploy) is to start the host deploy process at the canDoAction, while testing requirements at customization stage, then pass the object with the session to the actual action body. But it was way to complex with current engine design, as we split between AddVdsCommand and InstallVdsCommand, I guess because of the lack of proper development environment which required developers to hack the deploy in order to have a working system.
Comment 4 Alon Bar-Lev 2013-07-05 15:43:46 EDT
OK, it took me a while to understand the problem description.

The problem is not that the host cannot be added, this was expected, the problem is that there is no validation during activation that the host has valid uuid.

My bad.

Thanks for the report!
Comment 5 Alon Bar-Lev 2013-07-05 17:06:55 EDT
commit fcc15aa081631d08162482cf00ff2f3fa0305a9e
Author: Alon Bar-Lev <alonbl@redhat.com>
Date:   Fri Jul 5 23:59:49 2013 +0300

    bll: do not allow host activation with no unique id
    partial installation of host for various of reasons will leave a host
    with no uuid.
    these hosts should not be allowed to be activated.
    for developers, if the InstallVds option is false, this validation will
    be disabled.
    Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=978906
    Change-Id: I9a15416ae21c2371ebfb12cecb1551b73c98d88f
    Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>
Comment 7 Alon Bar-Lev 2013-07-06 06:06:52 EDT
Just for the record, the correct solution would have been to avoid activation if the host is in install failed. However, there were too many cases in the past in which install failed for some reasons which was false positive.

If we are ready for prime time, we should apply this solution.
Comment 8 Dušan Kajan 2013-07-18 07:47:49 EDT
verified on is6
Comment 11 Itamar Heim 2014-01-21 17:23:18 EST
Closing - RHEV 3.3 Released
Comment 12 Itamar Heim 2014-01-21 17:24:27 EST
Closing - RHEV 3.3 Released
Comment 13 Itamar Heim 2014-01-21 17:28:03 EST
Closing - RHEV 3.3 Released

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