From 524d6ff54b34195e02af0ddd085f9ffa921f3c3f Mon Sep 17 00:00:00 2001 From: Vladimir Kozhukalov Date: Wed, 8 Apr 2015 17:06:47 +0300 Subject: [PATCH] IBP Got rid of md for /boot Centos does use legacy grub, and it is only able to boot from md with metadata 0.9. So, we are limited to have not more than 28 disks on a node because current version of volume manager assumes /boot is spread over all disks and 0.9 metadata does not support more than 28. To avoid this limitation we've got rid of using md for /boot completely. Change-Id: I08398453625a4e9136d67989c7ebea41cb9cb766 Closes-Bug: #1340414 --- fuel_agent/drivers/nailgun.py | 20 +++++++++++++++++++- fuel_agent/tests/test_manager.py | 7 +------ fuel_agent/tests/test_nailgun.py | 2 -- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/fuel_agent/drivers/nailgun.py b/fuel_agent/drivers/nailgun.py index 86cc9b5..10d650a 100644 --- a/fuel_agent/drivers/nailgun.py +++ b/fuel_agent/drivers/nailgun.py @@ -65,6 +65,11 @@ class Nailgun(object): # how it is given by nailgun self.data = data + # this var is used as a flag that /boot fs + # has already been added. we need this to + # get rid of md over all disks for /boot partition. + self._boot_done = False + def partition_data(self): return self.data['ks_meta']['pm_data']['ks_spaces'] @@ -250,7 +255,8 @@ class Nailgun(object): metadatacopies=metadatacopies) if volume['type'] == 'raid': - if 'mount' in volume and volume['mount'] != 'none': + if 'mount' in volume and \ + volume['mount'] not in ('none', '/boot'): LOG.debug('Attaching partition to RAID ' 'by its mount point %s' % volume['mount']) partition_scheme.md_attach_by_mount( @@ -258,6 +264,18 @@ class Nailgun(object): fs_type=volume.get('file_system', 'xfs'), fs_label=self._getlabel(volume.get('disk_label'))) + if 'mount' in volume and volume['mount'] == '/boot' and \ + not self._boot_done: + LOG.debug('Adding file system on partition: ' + 'mount=%s type=%s' % + (volume['mount'], + volume.get('file_system', 'ext2'))) + partition_scheme.add_fs( + device=prt.name, mount=volume['mount'], + fs_type=volume.get('file_system', 'ext2'), + fs_label=self._getlabel(volume.get('disk_label'))) + self._boot_done = True + # this partition will be used to put there configdrive image if partition_scheme.configdrive_device() is None: LOG.debug('Adding configdrive partition on disk %s: size=20' % diff --git a/fuel_agent/tests/test_manager.py b/fuel_agent/tests/test_manager.py index 098ebb0..faeea13 100644 --- a/fuel_agent/tests/test_manager.py +++ b/fuel_agent/tests/test_manager.py @@ -114,11 +114,6 @@ class TestManager(test_base.BaseTestCase): self.assertEqual(mock_pu_sgt_expected_calls, mock_pu_sgt.call_args_list) - mock_mu_m_expected_calls = [mock.call('/dev/md0', 'mirror', - '/dev/sda3', '/dev/sdb3', - '/dev/sdc3')] - self.assertEqual(mock_mu_m_expected_calls, mock_mu_m.call_args_list) - mock_lu_p_expected_calls = [ mock.call('/dev/sda5', metadatasize=28, metadatacopies=2), mock.call('/dev/sda6', metadatasize=28, metadatacopies=2), @@ -137,7 +132,7 @@ class TestManager(test_base.BaseTestCase): self.assertEqual(mock_lu_l_expected_calls, mock_lu_l.call_args_list) mock_fu_mf_expected_calls = [ - mock.call('ext2', '', '', '/dev/md0'), + mock.call('ext2', '', '', '/dev/sda3'), mock.call('ext2', '', '', '/dev/sda4'), mock.call('swap', '', '', '/dev/mapper/os-swap'), mock.call('xfs', '', '', '/dev/mapper/image-glance')] diff --git a/fuel_agent/tests/test_nailgun.py b/fuel_agent/tests/test_nailgun.py index e1dc7f6..799950f 100644 --- a/fuel_agent/tests/test_nailgun.py +++ b/fuel_agent/tests/test_nailgun.py @@ -576,7 +576,6 @@ class TestNailgun(test_base.BaseTestCase): self.assertEqual(4, len(p_scheme.pvs)) self.assertEqual(3, len(p_scheme.lvs)) self.assertEqual(2, len(p_scheme.vgs)) - self.assertEqual(1, len(p_scheme.mds)) self.assertEqual(3, len(p_scheme.parteds)) @mock.patch('yaml.load') @@ -682,7 +681,6 @@ class TestNailgun(test_base.BaseTestCase): self.assertEqual(4, len(p_scheme.pvs)) self.assertEqual(3, len(p_scheme.lvs)) self.assertEqual(2, len(p_scheme.vgs)) - self.assertEqual(1, len(p_scheme.mds)) self.assertEqual(3, len(p_scheme.parteds)) self.assertEqual(3, self.drv._get_partition_count('ceph')) #NOTE(agordeev): (-2, -1, -1) is the list of ceph data partition counts