[node-patches] Change in ovirt-node[master]: drop vdsm related information

mburns at redhat.com mburns at redhat.com
Sat Feb 16 13:22:59 UTC 2013


Michael Burns has uploaded a new change for review.

Change subject: drop vdsm related information
......................................................................

drop vdsm related information

vdsm is moving to a plugin model, so all vdsm configuration
is moving to the plugin and out of ovirt-node

Change-Id: I9a50a182a57904141ca3e072420da7af11b91b00
Signed-off-by: Mike Burns <mburns at redhat.com>
---
M recipe/archipel-install.ks
M recipe/centos6-pkgs.ks
M recipe/centos6-post.ks
M recipe/fedora-pkgs.ks
M recipe/ovirt17-post.ks
M recipe/rhevh6-pkgs.ks
M recipe/rhevh6-post.ks
D scripts/tui/src/ovirt/node/setup/engine_page.py
8 files changed, 4 insertions(+), 399 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/19/12119/1

diff --git a/recipe/archipel-install.ks b/recipe/archipel-install.ks
index 755810c..2620e6e 100644
--- a/recipe/archipel-install.ks
+++ b/recipe/archipel-install.ks
@@ -1,2 +1,2 @@
 bootloader --timeout=30 --append="nomodeset check rootflags=ro crashkernel=128M elevator=deadline install quiet rd_NO_LVM stateless=1"
-services --enabled=auditd,ntpd,ntpdate,iptables,network,rsyslog,multipathd,snmpd,ovirt-early,ovirt,ovirt-post,anyterm,collectd,libvirtd,cgconfig,archipel --disabled=vdsmd,vdsm-reg
+services --enabled=auditd,ntpd,ntpdate,iptables,network,rsyslog,multipathd,snmpd,ovirt-early,ovirt,ovirt-post,anyterm,collectd,libvirtd,cgconfig,archipel
diff --git a/recipe/centos6-pkgs.ks b/recipe/centos6-pkgs.ks
index 2770a42..3e4f7f7 100644
--- a/recipe/centos6-pkgs.ks
+++ b/recipe/centos6-pkgs.ks
@@ -1,15 +1,8 @@
 collectd-virt
 libguestfs-winsupport
 qemu-kvm
-# workaround: vdsm-reg dep
-traceroute
-# supported hooks
-vdsm-hook-vhostmd
 # rhbz#641494 RFE - add libguestfs
 libguestfs-winsupport
 ltrace
-#VDSM
-vdsm-cli
-vdsm-reg
 # keyboard layout
 system-config-keyboard-base
diff --git a/recipe/centos6-post.ks b/recipe/centos6-post.ks
index 65eb3dd..5aabe16 100644
--- a/recipe/centos6-post.ks
+++ b/recipe/centos6-post.ks
@@ -1,13 +1,11 @@
 # add RHEV-H rwtab locations
 mkdir -p /rhev
 cat > /etc/rwtab.d/rhev << EOF_RWTAB_RHEVH
-empty	/rhev
-files	/var/lib/vdsm
 dirs    /var/db
 dirs    /var/lib/rhsm
 EOF_RWTAB_RHEVH
 
-# minimal lsb_release for vdsm-reg (bz#549147)
+# minimal lsb_release for bz#549147
 cat > /usr/bin/lsb_release <<\EOF_LSB
 #!/bin/sh
 if [ "$1" = "-r" ]; then
@@ -91,8 +89,6 @@
 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 -A INPUT -p icmp -j ACCEPT
 -A INPUT -i lo -j ACCEPT
-# vdsm
--A INPUT -p tcp --dport 54321 -j ACCEPT
 # libvirt tls
 -A INPUT -p tcp --dport 16514 -j ACCEPT
 # SSH
@@ -201,22 +197,6 @@
  
  	if [ -x "$MAKEDEV" ]; then
 EOF_start_udev
-
-# semanage is not present in the image and virt_use_nfs is on (see rhbz#642209)
-# remove it from vdsmd startup script to avoid error
-sed -i 's#/usr/sbin/semanage#/bin/true#' /etc/rc.d/init.d/vdsmd
-
-# libvirtd upstart job is already configured on rhevh
-sed -i 's/ && start_libvirtd$//' /etc/rc.d/init.d/vdsmd
-
-# chkconfig results (symlinks) cannnot be peristed
-sed -i 's#/sbin/chkconfig \$srv off##' /etc/rc.d/init.d/vdsmd
-
-# reserve vdsm port 54321
-augtool << \EOF_sysctl
-set /files/etc/sysctl.conf/net.ipv4.ip_local_reserved_ports 54321
-save
-EOF_sysctl
 
 # set maxlogins to 3
 echo "*        -       maxlogins      3" >> /etc/security/limits.conf
diff --git a/recipe/fedora-pkgs.ks b/recipe/fedora-pkgs.ks
index 7b53013..7327fe9 100644
--- a/recipe/fedora-pkgs.ks
+++ b/recipe/fedora-pkgs.ks
@@ -15,10 +15,6 @@
 # host statistics rhbz#588852
 vhostmd
 
-# oVirt
-vdsm-reg
-ovirt-host-deploy-offline
-
 # keyboard layout
 system-config-keyboard-base
 # plymouth stuff
diff --git a/recipe/ovirt17-post.ks b/recipe/ovirt17-post.ks
index e212b21..e09b675 100644
--- a/recipe/ovirt17-post.ks
+++ b/recipe/ovirt17-post.ks
@@ -35,8 +35,6 @@
 <service>
   <short>ovirt-node</short>
   <description>This service opens necessary ports for ovirt-node operations</description>
-  <!-- vdsm -->
-  <port protocol="tcp" port="54321"/>
   <!-- libvirt tls -->
   <port protocol="tcp" port="16514"/>
   <!-- guest consoles -->
@@ -140,5 +138,5 @@
 rm -rf /tmp/SELinux
 echo "-w /etc/shadow -p wa" >> /etc/audit/audit.rules
 
-# Workaround for vdsm needing /etc/ovirt-node-image-release
+# Workaround for packages needing /etc/ovirt-node-image-release
 ln -s /etc/system-release /etc/ovirt-node-image-release
diff --git a/recipe/rhevh6-pkgs.ks b/recipe/rhevh6-pkgs.ks
index d4d242a..9569cb5 100644
--- a/recipe/rhevh6-pkgs.ks
+++ b/recipe/rhevh6-pkgs.ks
@@ -1,9 +1,5 @@
 # remove
 -redhat-release-notes
-# workaround: vdsm-reg dep
-traceroute
-# supported hooks
-vdsm-hook-vhostmd
 # RHN agent
 rhn-virtualization-host
 rhn-setup
@@ -13,9 +9,6 @@
 libguestfs-winsupport
 ltrace
 vhostmd
-#VDSM
-vdsm-cli
-vdsm-reg
 # keyboard layout
 system-config-keyboard-base
 # qlogic firmware
diff --git a/recipe/rhevh6-post.ks b/recipe/rhevh6-post.ks
index a77c3ac..4693cbf 100644
--- a/recipe/rhevh6-post.ks
+++ b/recipe/rhevh6-post.ks
@@ -2,9 +2,7 @@
 mkdir -p /rhev
 mkdir -p /var/cache/rhn
 cat > /etc/rwtab.d/rhev << EOF_RWTAB_RHEVH
-empty	/rhev
 files	/var/cache/rhn
-files	/var/lib/vdsm
 dirs    /var/db
 dirs    /var/lib/rhsm
 EOF_RWTAB_RHEVH
@@ -17,7 +15,7 @@
 0-59/2 * * * * root python /usr/share/rhn/virtualization/poller.pyc
 EOF_cron-rhn
 
-# minimal lsb_release for vdsm-reg (bz#549147)
+# minimal lsb_release for bz#549147
 cat > /usr/bin/lsb_release <<\EOF_LSB
 #!/bin/sh
 if [ "$1" = "-r" ]; then
@@ -143,8 +141,6 @@
 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 -A INPUT -p icmp -j ACCEPT
 -A INPUT -i lo -j ACCEPT
-# vdsm
--A INPUT -p tcp --dport 54321 -j ACCEPT
 # libvirt tls
 -A INPUT -p tcp --dport 16514 -j ACCEPT
 # SSH
@@ -253,22 +249,6 @@
  
  	if [ -x "$MAKEDEV" ]; then
 EOF_start_udev
-
-# semanage is not present in the image and virt_use_nfs is on (see rhbz#642209)
-# remove it from vdsmd startup script to avoid error
-sed -i 's#/usr/sbin/semanage#/bin/true#' /etc/rc.d/init.d/vdsmd
-
-# libvirtd upstart job is already configured on rhevh
-sed -i 's/ && start_libvirtd$//' /etc/rc.d/init.d/vdsmd
-
-# chkconfig results (symlinks) cannnot be peristed
-sed -i 's#/sbin/chkconfig \$srv off##' /etc/rc.d/init.d/vdsmd
-
-# reserve vdsm port 54321
-augtool << \EOF_sysctl
-set /files/etc/sysctl.conf/net.ipv4.ip_local_reserved_ports 54321
-save
-EOF_sysctl
 
 # rhbz#734478 add virt-who (*.py are removed in rhevh image)
 cat > /usr/bin/virt-who <<EOF_virt_who
diff --git a/scripts/tui/src/ovirt/node/setup/engine_page.py b/scripts/tui/src/ovirt/node/setup/engine_page.py
deleted file mode 100644
index 6397560..0000000
--- a/scripts/tui/src/ovirt/node/setup/engine_page.py
+++ /dev/null
@@ -1,335 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# engine_page.py - Copyright (C) 2012 Red Hat, Inc.
-# Written by Fabian Deutsch <fabiand at redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# MA  02110-1301, USA.  A copy of the GNU General Public License is
-# also available at http://www.gnu.org/copyleft/gpl.html.
-from ovirt.node import plugins, valid, ui, utils, app
-from ovirt.node.config.defaults import NodeConfigFileSection
-from ovirt.node.plugins import Changeset
-import logging
-import os
-import sys
-import traceback
-import httplib
-
-"""
-Configure Engine
-"""
-
-
-LOGGER = logging.getLogger(__name__)
-
-
-class Plugin(plugins.NodePlugin):
-    _cert_path = None
-    _server = None
-    _port = None
-
-    def name(self):
-        return "oVirt Engine"
-
-    def rank(self):
-        return 100
-
-    def model(self):
-        cfg = VDSM().retrieve()
-        model = {
-            "vdsm_cfg.address": cfg["server"] or "",
-            "vdsm_cfg.port": cfg["port"] or "443",
-            "vdsm_cfg.cert": "Verified"
-            if utils.fs.Config().exists(cfg["cert_path"]) else "N/A",
-            "vdsm_cfg.password": "",
-            "vdsm_cfg.password_confirmation": ""
-        }
-        return model
-
-    def validators(self):
-        same_as_password = plugins.Validator.SameAsIn(self,
-                                                      "vdsm_cfg.password",
-                                                      "Password")
-
-        def cert_validator(v):
-            cert_path = VDSM().retrieve()["cert_path"]
-            cert_exists = cert_path and os.path.exists(cert_path)
-            return cert_exists or ("The Engine Certificate does not exist. " +
-                                   "Retrieve and verify it before you " +
-                                   "continue.")
-
-        return {"vdsm_cfg.address": valid.FQDNOrIPAddress() | valid.Empty(),
-                "vdsm_cfg.port": valid.Port(),
-                "vdsm_cfg.password": valid.Text(),
-                "vdsm_cfg.password_confirmation": same_as_password,
-                "action.register": cert_validator
-                }
-
-    def ui_content(self):
-        ws = [ui.Header("header[0]", "oVirt Engine Configuration"),
-              ui.Entry("vdsm_cfg.address", "Management Server:"),
-              ui.Entry("vdsm_cfg.port", "Management Server Port:"),
-              ui.Divider("divider[0]"),
-              ui.SaveButton("action.fetch_cert", "Retrieve Certificate"),
-              ui.KeywordLabel("vdsm_cfg.cert", "Certificate Status: "),
-              ui.Divider("divider[1]"),
-              ui.Label("vdsm_cfg.password._label",
-                       "Optional password for adding Node through oVirt " +
-                       "Engine UI"),
-              ui.PasswordEntry("vdsm_cfg.password", "Password:"),
-              ui.PasswordEntry("vdsm_cfg.password_confirmation",
-                               "Confirm Password:"),
-              ]
-
-        page = ui.Page("page", ws)
-        page.buttons = [ui.SaveButton("action.register", "Save & Register")]
-
-        self.widgets.add(page)
-        return page
-
-    def on_change(self, changes):
-        pass
-
-    def on_merge(self, effective_changes):
-        self.logger.info("Saving engine stuff")
-        changes = Changeset(self.pending_changes(False))
-        effective_model = Changeset(self.model())
-        effective_model.update(effective_changes)
-
-        self.logger.debug("Changes: %s" % changes)
-        self.logger.debug("Effective Model: %s" % effective_model)
-
-        if changes.contains_any(["action.fetch_cert"]):
-            buttons = [ui.Button("action.cert.accept", "Accept"),
-                       ui.Button("action.cert.reject", "Reject & Remove")]
-
-            try:
-                server = effective_model["vdsm_cfg.address"]
-                port = findPort(server, effective_model["vdsm_cfg.port"])
-                self._cert_path, fingerprint = retrieveCetrificate(server,
-                                                                   port)
-                self._server, self._port = server, port
-            except Exception as e:
-                fingerprint = str(e)
-                buttons = [ui.Button("action.cert.reject", "Close")]
-
-            self._fp_dialog = ui.Dialog("dialog.engine.fp",
-                                        "@ENGINENAME@ Fingerprint",
-                                        [ui.Label("dialog.label[0]", "TBD"),
-                                         ui.Label("dialog.fp", fingerprint)])
-            self._fp_dialog.buttons = buttons
-            return self._fp_dialog
-
-        elif changes.contains_any(["action.cert.accept"]):
-            self._fp_dialog.close()
-            model = VDSM()
-            model.update(self._server, self._port, self._cert_path)
-            utils.fs.Config().persist(self._cert_path)
-            self._server, self._port, self._cert_path = None, None, None
-
-        elif changes.contains_any(["action.cert.reject"]):
-            model = VDSM()
-            model.update(cert_path=None)
-            utils.fs.Config().unpersist(self._cert_path)
-            os.unlink(self._cert_path)
-            self._fp_dialog.close()
-            self._server, self._port, self._cert_path = None, None, None
-
-        txs = utils.Transaction("Configuring oVirt Engine")
-
-        if changes.contains_any(["vdsm_cfg.password_confirmation"]):
-            self.logger.debug("Setting engine password")
-            txs += [SetEnginePassword()]
-
-        if effective_changes.contains_any(["action.register"]):
-            self.logger.debug("Connecting to engine")
-            txs += [ActivateVDSM()]
-
-        if len(txs) > 0:
-            progress_dialog = ui.TransactionProgressDialog("dialog.txs", txs,
-                                                           self)
-            progress_dialog.run()
-
-            # VDSM messes with logging, and we just reset it
-            app.configure_logging()
-
-        # Acts like a page reload
-        return self.ui_content()
-
-
-def findPort(engineServer, enginePort):
-    """Function to find the correct port for a given server
-    """
-    # pylint: disable-msg=E0611,F0401
-    sys.path.append('/usr/share/vdsm-reg')
-    import deployUtil  # @UnresolvedImport
-
-    from ovirt_config_setup.engine import \
-        TIMEOUT_FIND_HOST_SEC  # @UnresolvedImport
-    from ovirt_config_setup.engine import \
-        compatiblePort  # @UnresolvedImport
-    # pylint: enable-msg=E0611,F0401
-
-    compatPort, sslPort = compatiblePort(enginePort)
-
-    LOGGER.debug("Finding port %s:%s with compat %s ssl %s" %
-                 (engineServer, enginePort, compatPort, sslPort))
-
-    deployUtil.nodeCleanup()
-
-    # Build port list to try
-    port_cfgs = [(enginePort, sslPort)]
-    if compatPort:
-        port_cfgs += [(compatPort, sslPort)]
-    else:
-        port_cfgs += [(enginePort, False)]
-
-    LOGGER.debug("Port configuratoins for engine: %s" % port_cfgs)
-
-    for try_port, use_ssl in port_cfgs:
-        LOGGER.debug("Trying to reach engine %s via %s %s" %
-                     (engineServer, try_port, "SSL" if use_ssl else ""))
-
-        is_reachable = False
-
-        try:
-            is_reachable = isHostReachable(host=engineServer,
-                                           port=try_port, ssl=use_ssl,
-                                           timeout=TIMEOUT_FIND_HOST_SEC)
-        except Exception:
-            LOGGER.debug("Failed to reach engine: %s" % traceback.format_exc())
-
-        if is_reachable:
-            LOGGER.debug("Reached engine")
-            enginePort = try_port
-            break
-
-    if not is_reachable:
-        raise RuntimeError("Can't connect to @ENGINENAME@")
-
-    return enginePort
-
-
-def isHostReachable(host, port, ssl, timeout):
-    """Check if a host is reachable on a given port via HTTP/HTTPS
-    """
-    if ssl:
-        Connection = httplib.HTTPSConnection
-    else:
-        Connection = httplib.HTTPConnection
-    Connection(str(host), port=int(port), timeout=timeout).request("HEAD", "/")
-    return True
-
-
-def retrieveCetrificate(engineServer, enginePort):
-    """Function to retrieve and store the certificate from an Engine
-    """
-    fingerprint = None
-
-    # pylint: disable-msg=E0611,F0401
-    sys.path.append('/usr/share/vdsm-reg')
-    import deployUtil  # @UnresolvedImport
-    # pylint: enable-msg=E0611,F0401
-
-    if deployUtil.getRhevmCert(engineServer, enginePort):
-        _, _, path = deployUtil.certPaths('')
-        fingerprint = deployUtil.generateFingerPrint(path)
-    else:
-        msgCert = "Failed downloading @ENGINENAME@ certificate"
-        raise RuntimeError(msgCert)
-
-    return path, fingerprint
-
-
-#
-#
-# Functions and classes to support the UI
-#
-#
-class VDSM(NodeConfigFileSection):
-    """Class to handle VDSM configuration in /etc/default/ovirt file
-
-    >>> from ovirt.node.config.defaults import ConfigFile, SimpleProvider
-    >>> fn = "/tmp/cfg_dummy"
-    >>> cfgfile = ConfigFile(fn, SimpleProvider)
-    >>> n = VDSM(cfgfile)
-    >>> n.update("engine.example.com", "1234", "p")
-    >>> sorted(n.retrieve().items())
-    [('cert_path', 'p'), ('port', '1234'), ('server', 'engine.example.com')]
-    """
-    keys = ("OVIRT_MANAGEMENT_SERVER",
-            "OVIRT_MANAGEMENT_PORT",
-            "OVIRT_MANAGEMENT_CERTIFICATE")
-
-    @NodeConfigFileSection.map_and_update_defaults_decorator
-    def update(self, server, port, cert_path):
-        (valid.Empty() | valid.FQDNOrIPAddress())(server)
-        (valid.Empty() | valid.Port())(port)
-
-
-class SetRootPassword(utils.Transaction.Element):
-    title = "Setting root password and starting sshd"
-
-    def __init__(self, password):
-        super(SetRootPassword, self).__init__()
-        self.password = password
-
-    def commit(self):
-        passwd = utils.security.Passwd()
-        passwd.set_password("root", self.password)
-
-        sshd = utils.security.Ssh()
-        sshd.password_authentication(True)
-        sshd.restart()
-
-
-class ActivateVDSM(utils.Transaction.Element):
-    title = "Activating VDSM"
-
-    def commit(self):
-        self.logger.info("Connecting to VDSM server")
-
-        # pylint: disable-msg=E0611,F0401
-        sys.path.append('/usr/share/vdsm-reg')
-        import deployUtil  # @UnresolvedImport
-
-        sys.path.append('/usr/share/vdsm')
-        from vdsm import constants  # @UnresolvedImport
-
-        from ovirt_config_setup.engine import \
-            write_vdsm_config  # @UnresolvedImport
-        # pylint: enable-msg=E0611,F0401
-
-        cfg = VDSM().retrieve()
-
-        # Stopping vdsm-reg may fail but its ok - its in the case when the
-        # menus are run after installation
-        deployUtil._logExec([constants.EXT_SERVICE, 'vdsm-reg', 'stop'])
-        if write_vdsm_config(cfg["server"], cfg["port"]):
-            deployUtil._logExec([constants.EXT_SERVICE, 'vdsm-reg',
-                                 'start'])
-
-            msgConf = "@ENGINENAME@ Configuration Successfully Updated"
-            self.logger.debug(msgConf)
-        else:
-            msgConf = "@ENGINENAME@ Configuration Failed"
-            raise RuntimeError(msgConf)
-
-
-class SetEnginePassword(utils.Transaction.Element):
-    title = "Setting Engine password"
-
-    def commit(self):
-        self.logger.info("Setting Engine password")


--
To view, visit http://gerrit.ovirt.org/12119
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a50a182a57904141ca3e072420da7af11b91b00
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Michael Burns <mburns at redhat.com>



More information about the node-patches mailing list