Alon Bar-Lev has uploaded a new change for review. Change subject: host-deploy: enforce random vdsm id in case of duplicate ......................................................................
host-deploy: enforce random vdsm id in case of duplicate CURRENT IMPLEMENTATION Fail installation if a duplicate vdsm id is reported by vdsm. PROBLEM IN CURRENT IMPLEMENTATION Manual intervention required: # uuidgen > /etc/vdsm/vdsm.id NEW IMPLEMENTATION Enforce random vdsm id when duplicate is reported. PROBLEM IN NEW IMPLEMENTATION A host can be added twice with different addresses/names, results in duplicate active hosts polling the same vdsm. Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=890022 Change-Id: Id448585b502cd53510526bc0a09bd7f9cd22230b Signed-off-by: Alon Bar-Lev <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java 1 file changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/10338/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java index 04d13b2..6e62405 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java @@ -15,6 +15,7 @@ import java.util.Calendar; import java.util.List; import java.util.TimeZone; +import java.util.UUID; import java.util.concurrent.Callable; import javax.naming.TimeLimitExceededException; @@ -98,7 +99,7 @@ /** * set vds object with unique id. - * Check if vdsmid is unique, if not, halt installation, otherwise + * Check if vdsmid is unique, if not, warn and generate our own. * update the vds object. * @param vdsmid unique id read from host. */ @@ -132,19 +133,16 @@ hosts.append(v.getvds_name()); } - log.errorFormat( - "Host {0} reports duplicate unique id {1} of following hosts {2}", - _vds.gethost_name(), - vdsmid, - hosts - ); - throw new SoftError( + _messages.post( + InstallerMessages.Severity.WARNING, String.format( - "Host %1$s reports unique id which already registered for %2$s", + "Host %1$s reports unique id which already registered for %2$s, generating random unique id", _vds.gethost_name(), hosts ) ); + + vdsmid = UUID.randomUUID().toString(); } log.infoFormat("Assigning unique id {0} to Host {1}", vdsmid, _vds.gethost_name()); @@ -362,6 +360,14 @@ return null; }}, new Callable<Object>() { public Object call() throws Exception { + // we put what we know, as we allow to modify + _parser.cliEnvironmentSet( + VdsmEnv.VDSM_ID, + _vds.getUniqueId() + ); + return null; + }}, + new Callable<Object>() { public Object call() throws Exception { _parser.cliEnvironmentSet( String.format( "%svars/ssl", -- To view, visit http://gerrit.ovirt.org/10338 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id448585b502cd53510526bc0a09bd7f9cd22230b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
