Bug 875526 - 3.2 - bootstrap: do not get unique id at canDoAction
Summary: 3.2 - bootstrap: do not get unique id at canDoAction
Keywords:
Status: CLOSED DUPLICATE of bug 875527
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-11 22:25 UTC by Alon Bar-Lev
Modified: 2012-11-12 16:49 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-12 16:49:32 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Alon Bar-Lev 2012-11-11 22:25:00 UTC
commit bd3054dc68a2bc5817e47fc894321f0a4a714c7e
Author: Alon Bar-Lev <alonbl>
Date:   Tue Nov 6 00:48:58 2012 +0200

    bootstrap: do not get unique id at canDoAction
    
    CURRENT IMPLEMENTATION
    
    engine has duplicate complex vdsm logic to generate the vdsm id.
    
        @Reloadable
        @TypeConverterAttribute(String.class)
        @DefaultValueAttribute(
            "IDFILE=/etc/vdsm/vdsm.id; " +
            "if [ -r \"${IDFILE}\" ]; then " +
                "cat \"${IDFILE}\"; " +
            "else " +
                "UUID=\"$(" +
                    "dmidecode -s system-uuid 2> /dev/null | " +
                    "sed -e 's/.*Not.*//' " +
                ")\"; " +
                "if [ -z \"${UUID}\" ]; then " +
                    "UUID=\"$(uuidgen 2> /dev/null)\" && " +
                    "mkdir -p \"$(dirname \"${IDFILE}\")\" && " +
                    "echo \"${UUID}\" > \"${IDFILE}\" && " +
                    "chmod 0644 \"${IDFILE}\"; " +
                "fi; " +
                "[ -n \"${UUID}\" ] && echo \"${UUID}\"; " +
            "fi"
        )
        BootstrapNodeIDCommand(372),
    
    The command is executed synchronously (UI wise) when host is added.
    
    ASSUMPTIONS OF CURRENT IMPLEMENTATION
    
     1. dmidecode exists out of the box in any distribution.
    
     ---> WRONG: fedora 17 has no, and other distributions may also lack.
    
     2. host id is only dmidecode output.
    
     ---> WRONG: over time we saw that we need extra logic to keep the id
          sane, especially when the hardware id does not exist or
          malformed.
    
     3. dmidecode utility is used for host id
    
     ---> WRONG: there are plans to make it more secure/robust using TPM,
          which requires software at host to generate.
    
    PROBLEMS IN CURRENT IMPLEMENTATION
    
     1. if dmidecode utility is missing we cannot acquire host id before
        performing bootstrap. The whole idea of bootstrap process is to take
        vanilla distribution and install vdsm. dmidecode is missing from
        vanilla, hence cannot be executed before bootstrap.
    
     2. the logic of generating host id exists both in engine and vdsm, both
        implementations need to synced, and kept synced between versions,
        which in practice cannot be achieved. As there is too much static
        noise (distribute on different channels, not be able to update all
        IT components, etc...).
    
     3. If host id generation method is changed, the engine implementation
        should be changed as well, while engine should not really care how
        vdsm maintain its identity.
    
    NEW IMPLEMENTATION
    
    Acquire vdsm id during bootstrap process, at the earliest. When all
    dependencies are available.
    
    If vdsm id is duplicate:
    
     1. post an error to host event log.
    
     2. set the state of the host to "install fail".
    
    USER VISIBLE CHANGES
    
    The following existing scenario:
    
     1. user has host xxx.com with ip 1.1.1.1, he added this host using
        xxx.com as host name.
     2. user add new host, at the host field he *BY MISTAKE* writes 1.1.1.1.
     3. the user is blocked from proceeding because of duplicate uuid between
        xxx.com(existing) and 1.1.1.1(new).
     4. the confused user fixes the  host field to 1.1.1.2 and proceed.
    
    Behaves as:
    
     1. user has host xxx.com with ip 1.1.1.1, he added this host using
        xxx.com as host name.
     2. user add new host, at the host field he *BY MISTAKE* writes 1.1.1.1.
     3. installation starts, and ends up with installation failed status on
        the new host.
     4. user sees the error message, and remove the host added by mistake.
    
    REASONING
    
    The above sequence of adding the same host with different name/address is not
    common or frequent, and does not justify the need to duplicate vdsm logic into
    engine, nor find a solution for distributions that locks the dmidecode utility
    at their base system layout, nor to lock our-self to dmidecode utility.
    
    Change-Id: I0263dbae34aaa02c126c5ed1dc52a84f4f5e77f8
    Signed-off-by: Alon Bar-Lev <alonbl>

Comment 1 Alon Bar-Lev 2012-11-12 16:49:32 UTC
There was something totally wrong yesterday night in bugzilla.

*** This bug has been marked as a duplicate of bug 875527 ***


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