Change in ovirt-engine[master]: bootstrap: do not get unique id at canDoAction

Yair Zaslavsky has submitted this change and it was merged. Change subject: bootstrap: do not get unique id at canDoAction ...................................................................... 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. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=875527 Change-Id: I0263dbae34aaa02c126c5ed1dc52a84f4f5e77f8 Signed-off-by: Alon Bar-Lev <alonbl@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVdsCommand.java D backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstallHelper.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsInstaller.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/itests/BasicTestSetup.java 4 files changed, 64 insertions(+), 180 deletions(-) Approvals: Alon Bar-Lev: Verified Yair Zaslavsky: Looks good to me, approved -- To view, visit http://gerrit.ovirt.org/9159 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0263dbae34aaa02c126c5ed1dc52a84f4f5e77f8 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <alonbl@redhat.com> Gerrit-Reviewer: Allon Mureinik <amureini@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alonbl@redhat.com> Gerrit-Reviewer: Barak Azulay <bazulay@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfediuck@redhat.com> Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernandez@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzaslavs@redhat.com>
participants (1)
-
yzaslavs@redhat.com