[node-patches] Change in ovirt-node[master]: installer: Finish iscsiroot installation code

jboggs at redhat.com jboggs at redhat.com
Mon Oct 15 20:45:38 UTC 2012


Joey Boggs has uploaded a new change for review.

Change subject: installer: Finish iscsiroot installation code
......................................................................

installer: Finish iscsiroot installation code

rhbz#520111

To install you need to specify at minimum these options:
BOOTIF=eth0
storage_init=/dev/sda
iscsi_init=/dev/sdc
iscsi_target_name=iqn.shared.root
iscsi_install
iscsi_server=192.168.1.5:3260

!!Boot disk must be locally attached!!
Root installed to /dev/sdc as $iscsi_init
Boot and HostVG installed to local /dev/sda

Change-Id: Iafd5c5e02c76644886bf06ce98c5328e1e87a865
Signed-off-by: Joey Boggs <jboggs at redhat.com>
---
M scripts/ovirt-auto-install.py
M scripts/ovirtnode/install.py
M scripts/ovirtnode/storage.py
3 files changed, 23 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/89/8589/1

diff --git a/scripts/ovirt-auto-install.py b/scripts/ovirt-auto-install.py
index 6554b69..38804a6 100755
--- a/scripts/ovirt-auto-install.py
+++ b/scripts/ovirt-auto-install.py
@@ -58,11 +58,13 @@
             ovirt_store_config("/etc/shadow")
         file.close()
     else:
-        config_networking()
+        if not is_iscsi_install():
+            config_networking()
         print "Automatic installation failed. Please review /var/log/ovirt.log"
         sys.exit(1)
 
-config_networking()
+if not is_iscsi_install():
+    config_networking()
 #set ssh_passwd_auth
 if "OVIRT_SSH_PWAUTH" in OVIRT_VARS:
     if OVIRT_VARS["OVIRT_SSH_PWAUTH"] == "yes":
diff --git a/scripts/ovirtnode/install.py b/scripts/ovirtnode/install.py
index c4c921d..3ff7d26 100755
--- a/scripts/ovirtnode/install.py
+++ b/scripts/ovirtnode/install.py
@@ -93,6 +93,8 @@
                 _functions.mount_efi()
 
     def grub_install(self):
+        if is_iscsi_install():
+            self.disk = re.sub("p[1,2,3]$", "", findfs(self.boot_candidate))
         device_map = "(hd0) %s" % self.disk
         logger.debug(device_map)
         device_map_conf = open(self.grub_dir + "/device.map", "w")
@@ -381,12 +383,20 @@
         self.kernel_image_copy()
 
         # reorder tty0 to allow both serial and phys console after installation
+<<<<<<< HEAD:scripts/ovirtnode/install.py
         if _functions.is_iscsi_install():
             self.root_param = "root=LABEL=Root"
             self.bootparams = "root=iscsi:%s::%s::%s ip=%s:dhcp" % (
+=======
+        if is_iscsi_install():
+            self.root_param = "root=live:LABEL=Root"
+            self.bootparams = "netroot=iscsi:%s::%s::%s ip=br%s:dhcp bridge=br%s:%s " % (
+>>>>>>> c0fdc03... installer: Finish iscsiroot installation code:scripts/install.py
                 OVIRT_VARS["OVIRT_ISCSI_TARGET_HOST"],
                 OVIRT_VARS["OVIRT_ISCSI_TARGET_PORT"],
                 OVIRT_VARS["OVIRT_ISCSI_TARGET_NAME"],
+                OVIRT_VARS["OVIRT_BOOTIF"],
+                OVIRT_VARS["OVIRT_BOOTIF"],
                 OVIRT_VARS["OVIRT_BOOTIF"])
         else:
             self.root_param = "root=live:LABEL=Root"
diff --git a/scripts/ovirtnode/storage.py b/scripts/ovirtnode/storage.py
index e500065..67d40aa 100644
--- a/scripts/ovirtnode/storage.py
+++ b/scripts/ovirtnode/storage.py
@@ -35,7 +35,7 @@
         logger.propagate = False
         OVIRT_VARS = _functions.parse_defaults()
         self.overcommit = 0.5
-        self.BOOT_SIZE = 50
+        self.BOOT_SIZE = 256
         self.ROOT_SIZE = 256
         self.CONFIG_SIZE = 5
         self.LOGGING_SIZE = 2048
@@ -360,7 +360,7 @@
         for drv in self.HOSTVGDRIVE.strip(",").split(","):
             drv = _functions.translate_multipath_device(drv)
             if drv != "":
-                if self.ROOTDRIVE == drv:
+                if self.ROOTDRIVE == drv and not is_iscsi_install():
                     self.reread_partitions(self.ROOTDRIVE)
                     parted_cmd = ("parted \"" + drv + "\" -s \"mkpart " +
                                   "primary ext2 " + str(self.RootBackup_end) +
@@ -370,11 +370,11 @@
                     hostvgpart = "4"
                 elif self.BOOTDRIVE == drv:
                     parted_cmd = ("parted \"" + drv + "\" -s \"mkpart " +
-                                  "primary ext2 " + str(self.boot_size_si) +
+                                  "primary ext2 " + str(self.boot_size_si * 2) +
                                   " -1\"")
                     logger.debug(parted_cmd)
                     _functions.system(parted_cmd)
-                    hostvgpart = "2"
+                    hostvgpart = "3"
                     self.ROOTDRIVE = self.BOOTDRIVE
                 elif self.ISCSIDRIVE == drv:
                     parted_cmd = ("parted \"" + drv + "\" -s \"mkpart " +
@@ -739,7 +739,8 @@
                     return True
 
         if ("OVIRT_ROOT_INSTALL" in _functions.OVIRT_VARS and
-                  _functions.OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "y"):
+                  _functions.OVIRT_VARS["OVIRT_ROOT_INSTALL"] == "y" and not \
+                      is_iscsi_install()):
             logger.info("Partitioning root drive: " + self.ROOTDRIVE)
             _functions.wipe_partitions(self.ROOTDRIVE)
             self.reread_partitions(self.ROOTDRIVE)
@@ -829,6 +830,9 @@
             drive_list.append("BOOT")
             drive_space_dict["BOOTDRIVESPACE"] = BOOTDRIVESPACE
             drive_space_dict["BOOT_NEED_SIZE"] = self.BOOT_SIZE
+            if BOOTDRIVESPACE > self.BOOT_SIZE:
+                return True
+
         else:
             ROOTDRIVESPACE = self.get_drive_size(self.ROOTDRIVE)
             HOSTVGDRIVESPACE = 0


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafd5c5e02c76644886bf06ce98c5328e1e87a865
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