From patchwork Wed May 20 15:52:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Alvarez Sanchez X-Patchwork-Id: 1294454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HVV0cDWF; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Ry1m59Qvz9sRf for ; Thu, 21 May 2020 01:52:28 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 15D4024B59; Wed, 20 May 2020 15:52:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 61Cs8KpJE65w; Wed, 20 May 2020 15:52:21 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 0955A20482; Wed, 20 May 2020 15:52:21 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id F0F18C07FF; Wed, 20 May 2020 15:52:20 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3D9C9C0176 for ; Wed, 20 May 2020 15:52:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2C6F38858A for ; Wed, 20 May 2020 15:52:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tecDjBQdlsE7 for ; Wed, 20 May 2020 15:52:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by hemlock.osuosl.org (Postfix) with ESMTPS id 6B87588072 for ; Wed, 20 May 2020 15:52:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589989937; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r1a5rX3lMPFoSDqoDNB4VLPXtNj9gH9SFp0YRK6SiDg=; b=HVV0cDWFTMUaoU3umpeo2qEsSVB/tSKqmEnJSj00S7RrpTeaI97p/3ui2QUkGSEEXvlnPI X2RaHIywJfw6Vr8wOiPDhsF4ZITNiglVEsc6UYHOi6p3fToXypfzp7G4qiYPRLY6KfYJCX x3OtkucXvqGToHaP3rPpjnPGpYH1mlE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-362-PUZVnFMjNpiMgKWMUuF7pw-1; Wed, 20 May 2020 11:52:11 -0400 X-MC-Unique: PUZVnFMjNpiMgKWMUuF7pw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E5D68800688 for ; Wed, 20 May 2020 15:52:10 +0000 (UTC) Received: from MacBook-Pro-de-Daniel.telefonica.net (ovpn-115-107.ams2.redhat.com [10.36.115.107]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AEC1341FE; Wed, 20 May 2020 15:52:09 +0000 (UTC) From: Daniel Alvarez To: dev@openvswitch.org Date: Wed, 20 May 2020 17:52:07 +0200 Message-Id: <20200520155207.9575-1-dalvarez@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] ovs-ctl: Don't set hostname as external-id X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" ovs-ctl started to add the hostname as external-id [0] at some point. However, this can be problematic as if it's already set by an external entity it will get overwritten. In RHEL systems, systemd will invoke ovs-ctl to start OVS and that will overwrite it to the hostname of the machine. For OVN this can have a big impact because if, for whatever reason the hostname changes and the host gets restarted, ovn-controller won't claim the ports back leaving the workloads unaccessible. Also, it makes sense to leave this untouched as 1) it's an external_id, so it will actually let external entities to configure it (unlike now), and 2) it's optional. In the case of OVN, if the external-id doesn't exist, it'll default to its hostname so nothing should get broken by this change. [0] https://mail.openvswitch.org/pipermail/ovs-dev/2016-March/312054.html Signed-off-by: Daniel Alvarez Acked-by: Flavio Fernandes > --- utilities/ovs-ctl.in | 12 ------------ 1 file changed, 12 deletions(-) -- diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 8c5cd7032..87fc4934f 100644 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -35,17 +35,6 @@ insert_mod_if_required () { ovs_kmod_ctl insert } -set_hostname () { - # 'hostname -f' needs network connectivity to work. So we should - # call this only after ovs-vswitchd is running. - if test X$FULL_HOSTNAME = Xyes; then - hn="$(hostname -f)" || hn="$(uname -n)" - else - hn="$(uname -n)" - fi - ovs_vsctl set Open_vSwitch . external-ids:hostname="$hn" -} - set_system_ids () { set ovs_vsctl set Open_vSwitch . @@ -225,7 +214,6 @@ start_forwarding () { if test X"$OVS_VSWITCHD" = Xyes; then do_start_forwarding || return 1 fi - set_hostname & return 0 }