Use any disk for /boot regardless of its size

Apparently, the disks which're bigger than 2T were excluded from list
of bootable disks if possible. Just because in the past, those disks
were unrecognized by BIOS (or UEFI under CSM).

In fact, it was just misconfiguration of RAID controller or BIOS
itself.

GRUB uses BIOS INT13h in order to find all available disks.
Therefore, unless particular disk is not configured as 'bootable',
there's no change for GRUB to find it.

One should configure hardware in the following way assuming that
the first disk (hd0) is bootable and is used for operating system
purposes.
In case of hardware RAID, FC multipath or any other HBA, the disk
(or lun, or whatever) which was configured as 'bootable' will be
reported as hd0 via INT13h. So, GRUB will be able to boot from it.

DocImpact
Closes-Bug: #1588260

Change-Id: I7bc729ffafa3b9d6bfe8521fa38599d36d02f7e1
(cherry picked from commit e2a20044b2)
This commit is contained in:
Alexander Gordeev 2016-06-02 15:53:57 +03:00 committed by Aleksandr Gordeev
parent 8e3a639c50
commit 7ffbf39caf
2 changed files with 3 additions and 18 deletions

View File

@ -147,11 +147,7 @@ class Nailgun(BaseDataDriver):
# by fuel-agent (it always installs BIOS variant of # by fuel-agent (it always installs BIOS variant of
# grub) # grub)
# * grub bug (http://savannah.gnu.org/bugs/?41883) # * grub bug (http://savannah.gnu.org/bugs/?41883)
# NOTE(kozhukalov): On some hardware GRUB is not able disks = self.ks_disks
# to see disks larger than 2T due to firmware bugs,
# so we'd better avoid placing /boot on such
# huge disks if it is possible.
disks = self.small_ks_disks or self.ks_disks
suitable_disks = [ suitable_disks = [
disk for disk in disks disk for disk in disks
if ('nvme' not in disk['name'] and self._is_boot_disk(disk)) if ('nvme' not in disk['name'] and self._is_boot_disk(disk))
@ -205,11 +201,6 @@ class Nailgun(BaseDataDriver):
return [d for d in self.ks_disks return [d for d in self.ks_disks
if d['name'].startswith('md') and self._is_os_disk(d)] if d['name'].startswith('md') and self._is_os_disk(d)]
@property
def small_ks_disks(self):
"""Get those disks which are smaller than 2T"""
return [d for d in self.ks_disks if d['size'] <= 2097152]
@property @property
def ks_vgs(self): def ks_vgs(self):
return filter( return filter(

View File

@ -1461,13 +1461,6 @@ class TestNailgunBootDisks(unittest2.TestCase):
self._check_boot_disks(ks_disks_return_value, not_expected_disk, self._check_boot_disks(ks_disks_return_value, not_expected_disk,
expected_disks) expected_disks)
def test_only_small_boot_disks(self):
ks_disks_return_value = self.disks + [self.big_disk]
not_expected_disk = self.big_disk
expected_disks = self.disks
self._check_boot_disks(ks_disks_return_value, not_expected_disk,
expected_disks)
def test_boot_disks_no_nvme(self): def test_boot_disks_no_nvme(self):
ks_disks_return_value = self.disks + [self.nvme_disk] ks_disks_return_value = self.disks + [self.nvme_disk]
not_expected_disk = self.nvme_disk not_expected_disk = self.nvme_disk
@ -1823,13 +1816,14 @@ class TestNailgunMockedMeta(unittest2.TestCase):
def test_boot_partition_ok_first_disk_huge(self, mock_lbd, def test_boot_partition_ok_first_disk_huge(self, mock_lbd,
mock_image_meta): mock_image_meta):
# /boot should be on first disk even if it's huge
data = copy.deepcopy(PROVISION_SAMPLE_DATA) data = copy.deepcopy(PROVISION_SAMPLE_DATA)
data['ks_meta']['pm_data']['ks_spaces'] = FIRST_DISK_HUGE_KS_SPACES data['ks_meta']['pm_data']['ks_spaces'] = FIRST_DISK_HUGE_KS_SPACES
mock_lbd.return_value = LIST_BLOCK_DEVICES_SAMPLE mock_lbd.return_value = LIST_BLOCK_DEVICES_SAMPLE
drv = nailgun.Nailgun(data) drv = nailgun.Nailgun(data)
self.assertEqual( self.assertEqual(
drv.partition_scheme.fs_by_mount('/boot').device, drv.partition_scheme.fs_by_mount('/boot').device,
'/dev/sdb3') '/dev/sda3')
def test_boot_partition_ok_many_huge_disks(self, mock_lbd, def test_boot_partition_ok_many_huge_disks(self, mock_lbd,
mock_image_meta): mock_image_meta):