[node-patches] Change in ovirt-node[ovirt-3.5]: Always use local kdump after install installs

rbarry at redhat.com rbarry at redhat.com
Tue Aug 5 01:21:02 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Always use local kdump after install installs
......................................................................

Always use local kdump after install installs

If no kdump parameters are specified, default to local. Instead
of leaving the service disabled

Change-Id: I5dcf8a8046a8c4284edf0bd3ed6ed24000ffe7ef
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1123413
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1122917
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M scripts/ovirt-auto-install.py
M scripts/ovirt-init-functions.sh.in
M src/ovirt/node/installer/core/progress_page.py
M src/ovirtnode/kdump.py
4 files changed, 24 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/52/31052/1

diff --git a/scripts/ovirt-auto-install.py b/scripts/ovirt-auto-install.py
index 8d9b5c5..b8c5e9d 100755
--- a/scripts/ovirt-auto-install.py
+++ b/scripts/ovirt-auto-install.py
@@ -178,7 +178,9 @@
                                     OVIRT_VARS["OVIRT_KDUMP_SSH_KEY"])
             elif "OVIRT_KDUMP_NFS" in OVIRT_VARS:
                 model.configure_nfs(OVIRT_VARS["OVIRT_KDUMP_NFS"])
-            elif "OVIRT_KDUMP_LOCAL" in OVIRT_VARS:
+            elif "OVIRT_DISABLE_KDUMP" in OVIRT_VARS:
+                model.disable_kdump()
+            else:
                 model.configure_local()
 
             tx = model.transaction()
diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 64fde10..2e21680 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -734,8 +734,8 @@
             kdump_nfs=*)
             kdump_nfs=${i#kdump_nfs=}
             ;;
-            kdump_local=*)
-            kdump_local=${i#kdump_local=}
+            disable_kdump*)
+            disable_kdump="Y"
             ;;
             kdump_ssh=*)
             kdump_ssh=${i#kdump_ssh=}
@@ -862,7 +862,7 @@
     mkdir /tmp/early-logs && ( mount --bind /var/log /tmp/early-logs && mount --make-rprivate /tmp/early-logs ; )
 
     # save boot parameters as defaults for ovirt-config-*
-    params="bootif init init_app vol_boot_size vol_efi_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot runtime_mode kdump_nfs kdump_local kdump_ssh kdump_ssh_key iscsi_name snmp_password install netconsole_server netconsole_port stateless wipe_fakeraid iscsi_init iscsi_target_name iscsi_target_host iscsi_target_port iscsi_install network_layout bond_name bond_slaves bond_options tuned_profile nfsv4_domain use_strong_rng disable_aes_ni keyboard_layout logrotate_max_size"
+    params="bootif init init_app vol_boot_size vol_efi_size vol_swap_size vol_root_size vol_config_size vol_logging_size vol_data_size vol_swap2_size vol_data2_size crypt_swap crypt_swap2 upgrade standalone overcommit ip_address ip_netmask ip_gateway ipv6 dns ntp vlan ssh_pwauth syslog_server syslog_port collectd_server collectd_port bootparams hostname firstboot runtime_mode kdump_nfs disable_kdump kdump_ssh kdump_ssh_key iscsi_name snmp_password install netconsole_server netconsole_port stateless wipe_fakeraid iscsi_init iscsi_target_name iscsi_target_host iscsi_target_port iscsi_install network_layout bond_name bond_slaves bond_options tuned_profile nfsv4_domain use_strong_rng disable_aes_ni keyboard_layout logrotate_max_size"
     # mount /config unless firstboot is forced
     if [ "$firstboot" != "1" ]; then
         mount_config
diff --git a/src/ovirt/node/installer/core/progress_page.py b/src/ovirt/node/installer/core/progress_page.py
index 347e22e..1501683 100644
--- a/src/ovirt/node/installer/core/progress_page.py
+++ b/src/ovirt/node/installer/core/progress_page.py
@@ -167,6 +167,8 @@
                    self.SetPassword(cfg["admin.password"]),
                    self.InstallImageAndBootloader(cfg["boot.device.current"]),
                    self.SetKeyboardLayout(cfg["keyboard.layout"])]
+            if "disable_kdump" not in system.kernel_cmdline_arguments():
+                tx += [self.ConfigureKdump()]
 
             if system.is_pxe():
                     tx += [self.ClearNetworkConfig()]
@@ -297,6 +299,22 @@
             tx = model.transaction()
             tx()
 
+    class ConfigureKdump(utils.Transaction.Element):
+        title = "Configuring Local KDump"
+
+        def __init__(self):
+            super(InstallerThread.ConfigureKdump, self).__init__()
+
+        def commit(self):
+            try:
+                model = defaults.KDump()
+                model.configure_local()
+                tx = model.transaction()
+                tx()
+
+            except:
+                self.logger.info("Could not configure local kdump!")
+
     class MigrateConfigs(utils.Transaction.Element):
         title = "Migrating configuration data"
 
diff --git a/src/ovirtnode/kdump.py b/src/ovirtnode/kdump.py
index c94178b..27b2043 100644
--- a/src/ovirtnode/kdump.py
+++ b/src/ovirtnode/kdump.py
@@ -48,10 +48,5 @@
             _functions.ovirt_store_config("/etc/kdump.conf")
             _functions.logger.info("Syslog Configuration Completed")
             return True
-        if "OVIRT_KDUMP_LOCAL" in _functions.OVIRT_VARS:
-            restore_kdump_config()
-            _functions.ovirt_store_config("/etc/kdump.conf")
-            _functions.logger.info("Syslog Configuration Completed")
-            return True
     except:
         _functions.logger.error("KDump Configuration Failed")


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5dcf8a8046a8c4284edf0bd3ed6ed24000ffe7ef
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list