[node-patches] Change in ovirt-node[master]: fix iscsi installs and upgrade using uefi

jboggs at redhat.com jboggs at redhat.com
Thu Apr 24 15:53:40 UTC 2014


Joey Boggs has uploaded a new change for review.

Change subject: fix iscsi installs and upgrade using uefi
......................................................................

fix iscsi installs and upgrade using uefi

rhbz#1051136
Signed-off-by: Joey Boggs <jboggs at redhat.com>
Change-Id: Id06a55c913e7d9948fc4666844bf21b7eac7b51b
---
M scripts/ovirt-init-functions.sh.in
M src/ovirtnode/install.py
M src/ovirtnode/ovirtfunctions.py
3 files changed, 20 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/55/27055/1

diff --git a/scripts/ovirt-init-functions.sh.in b/scripts/ovirt-init-functions.sh.in
index 0fd225e..1ddf53b 100644
--- a/scripts/ovirt-init-functions.sh.in
+++ b/scripts/ovirt-init-functions.sh.in
@@ -1428,6 +1428,11 @@
             tuned-adm profile $OVIRT_TUNED_PROFILE
         fi
 
+        #iscsi installs with hang when network service is killed
+        if [ -e "/dev/disk/by-label/Boot" ]; then
+            rm  /var/lock/subsys/network
+        fi
+
         if is_standalone; then
             return 0
         fi
diff --git a/src/ovirtnode/install.py b/src/ovirtnode/install.py
index 042e6bb..4722efd 100755
--- a/src/ovirtnode/install.py
+++ b/src/ovirtnode/install.py
@@ -307,8 +307,11 @@
         logger.info("Installing the image.")
         # copy grub.efi to safe location
         if _functions.is_efi_boot():
+            if "OVIRT_ISCSI_INSTALL" in OVIRT_VARS:
+                _functions.system("umount /boot")
             shutil.copy("/boot/efi/EFI/%s/grub.efi" % self.efi_dir_name,
                         "/tmp")
+            _functions.mount_boot()
         if "OVIRT_ROOT_INSTALL" in OVIRT_VARS:
             if OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "n":
                 logger.info("Root Installation Not Required, Finished.")
@@ -338,6 +341,9 @@
             if _functions.is_upgrade() and not _functions.is_iscsi_install():
                 _functions.mount_liveos()
                 grub_config_file = "/liveos/grub/grub.conf"
+        if _functions.is_iscsi_install() or _functions.findfs("Boot") \
+            and not _functions.is_efi_boot():
+            grub_config_file = "/boot/grub/grub.conf"
         if _functions.is_efi_boot():
             logger.debug(str(os.listdir("/liveos")))
             _functions.system("umount /liveos")
@@ -346,8 +352,6 @@
                 grub_config_file = "/liveos/EFI/fedora/grub.cfg"
             else:
                 grub_config_file = "/liveos/EFI/redhat/grub.conf"
-        if _functions.is_iscsi_install() or _functions.findfs("Boot"):
-            grub_config_file = "/boot/grub/grub.conf"
         grub_config_file_exists = grub_config_file is not None \
             and os.path.exists(grub_config_file)
         logger.debug("Grub config file is: %s" % grub_config_file)
diff --git a/src/ovirtnode/ovirtfunctions.py b/src/ovirtnode/ovirtfunctions.py
index b46a42f..5c2cfdc 100644
--- a/src/ovirtnode/ovirtfunctions.py
+++ b/src/ovirtnode/ovirtfunctions.py
@@ -37,6 +37,7 @@
 import logging
 import grp
 import pwd
+import time
 from ovirt.node.config import defaults
 from ovirt.node.utils import process
 import ovirt.node.utils.system as osystem
@@ -628,9 +629,13 @@
                         augtool("set",
                                 "/files/etc/default/ovirt/OVIRT_BOOTIF",
                                 "\"%s\"" % value)
-                    if "BOOTPROTO" in key:
+                    elif "BOOTPROTO" in key:
                         augtool("set",
                                 "/files/etc/default/ovirt/OVIRT_BOOTPROTO",
+                                "\"%s\"" % value)
+                    elif "ISCSI" in key:
+                        augtool("set",
+                                "/files/etc/default/ovirt/%s" % key,
                                 "\"%s\"" % value)
                 except:
                     pass
@@ -651,6 +656,8 @@
                 system(login_cmd)
                 logger.info("Restarting iscsi service")
                 system("service iscsi restart")
+                # let login settle devices
+                time.sleep(5)
                 system("pvscan")
                 system("vgscan")
                 system("vgchange -ay")
@@ -1169,6 +1176,7 @@
     cmd.communicate()
 
     if is_iscsi_install() or findfs("BootUpdate"):
+        mount_config()
         boot_update_dev = findfs("BootUpdate")
         boot_dev = findfs("Boot")
         e2label_bootbackup_cmd = "e2label '%s' BootBackup" % boot_dev


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id06a55c913e7d9948fc4666844bf21b7eac7b51b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Joey Boggs <jboggs at redhat.com>



More information about the node-patches mailing list