Merge "Add resize to /"

This commit is contained in:
Zuul 2023-02-10 20:06:11 +00:00 committed by Gerrit Code Review
commit 5ef313e4f9
5 changed files with 55 additions and 15 deletions

View File

@ -1234,6 +1234,17 @@ class AgentManager(service.PeriodicService):
}
filesystems.append(data)
if utils.is_filesystem_supported(constants.FILESYSTEM_NAME_ROOT,
self._ihost_personality):
root_lv_size = utils.get_current_fs_size("root")
data = {
'name': constants.FILESYSTEM_NAME_ROOT,
'size': root_lv_size,
'logical_volume': constants.FILESYSTEM_LV_DICT[
constants.FILESYSTEM_NAME_ROOT]
}
filesystems.append(data)
if filesystems:
# Create the filesystems if they do not already exist.
# This audit does not check if the fs size has changed.

View File

@ -577,6 +577,7 @@ FILESYSTEM_NAME_IMAGE_CONVERSION = 'image-conversion'
FILESYSTEM_NAME_INSTANCES = 'instances'
FILESYSTEM_NAME_LOG = 'log'
FILESYSTEM_NAME_VAR = 'var'
FILESYSTEM_NAME_ROOT = 'root'
FILESYSTEM_LV_DICT = {
FILESYSTEM_NAME_PLATFORM: 'platform-lv',
@ -593,6 +594,7 @@ FILESYSTEM_LV_DICT = {
FILESYSTEM_NAME_KUBELET: 'kubelet-lv',
FILESYSTEM_NAME_LOG: 'log-lv',
FILESYSTEM_NAME_VAR: 'var-lv',
FILESYSTEM_NAME_ROOT: 'root-lv',
}
# Supported DRDB file system resizes (via controllerfs-modify)
@ -619,6 +621,7 @@ FILESYSTEM_CONTROLLER_SUPPORTED_LIST = [
FILESYSTEM_NAME_INSTANCES,
FILESYSTEM_NAME_LOG,
FILESYSTEM_NAME_VAR,
FILESYSTEM_NAME_ROOT,
]
FILESYSTEM_WORKER_SUPPORTED_LIST = [
@ -628,6 +631,7 @@ FILESYSTEM_WORKER_SUPPORTED_LIST = [
FILESYSTEM_NAME_INSTANCES,
FILESYSTEM_NAME_LOG,
FILESYSTEM_NAME_VAR,
FILESYSTEM_NAME_ROOT,
]
FILESYSTEM_STORAGE_SUPPORTED_LIST = [
@ -636,6 +640,7 @@ FILESYSTEM_STORAGE_SUPPORTED_LIST = [
FILESYSTEM_NAME_SCRATCH,
FILESYSTEM_NAME_LOG,
FILESYSTEM_NAME_VAR,
FILESYSTEM_NAME_ROOT,
]
FILESYSTEM_HOSTS_SUPPORTED_LIST_DICT = {

View File

@ -8133,6 +8133,8 @@ class ConductorManager(service.PeriodicService):
'platform::filesystem::log::runtime',
constants.FILESYSTEM_NAME_VAR:
'platform::filesystem::var::runtime',
constants.FILESYSTEM_NAME_ROOT:
'platform::filesystem::root::runtime',
}
puppet_class = [classmap.get(fs) for fs in filesystem_list]

View File

@ -300,6 +300,10 @@ class StoragePuppet(base.BasePuppet):
config.update({
'platform::filesystem::var::params::lv_size': fs.size
})
elif fs.name == constants.FILESYSTEM_NAME_ROOT:
config.update({
'platform::filesystem::root::params::lv_size': fs.size
})
return config
def _get_worker_config(self, host):

View File

@ -69,6 +69,7 @@ class TestAgentManager(base.TestCase):
self.kubelet_fs_size = 10
self.log_fs_size = 8
self.var_fs_size = 20
self.root_fs_size = 20
def mock_get_current_fs_size(fs_name):
if fs_name == constants.FILESYSTEM_NAME_SCRATCH:
@ -83,6 +84,8 @@ class TestAgentManager(base.TestCase):
return self.log_fs_size
elif fs_name == constants.FILESYSTEM_NAME_VAR:
return self.var_fs_size
elif fs_name == constants.FILESYSTEM_NAME_ROOT:
return self.root_fs_size
self.mocked_get_current_fs_size = mock.patch(
'sysinv.common.utils.get_current_fs_size',
mock_get_current_fs_size)
@ -108,7 +111,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -132,7 +136,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -179,7 +184,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 20},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 2},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -202,7 +208,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -225,7 +232,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -248,7 +256,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -271,7 +280,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -294,7 +304,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -317,7 +328,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api.create_host_filesystems.assert_called_with(
self.context,
@ -339,7 +351,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api_dc_aio.create_host_filesystems.assert_called_with(
self.context,
@ -361,7 +374,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api_dc_aio.create_host_filesystems.assert_called_with(
self.context,
@ -383,7 +397,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api_dc_std.create_host_filesystems.assert_called_with(
self.context,
@ -405,7 +420,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api_dc_std.create_host_filesystems.assert_called_with(
self.context,
@ -426,7 +442,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api_dc_std.create_host_filesystems.assert_called_with(
self.context,
@ -447,7 +464,8 @@ class TestAgentManager(base.TestCase):
{'logical_volume': 'docker-lv', 'name': 'docker', 'size': 30},
{'logical_volume': 'kubelet-lv', 'name': 'kubelet', 'size': 10},
{'logical_volume': 'log-lv', 'name': 'log', 'size': 8},
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20}]
{'logical_volume': 'var-lv', 'name': 'var', 'size': 20},
{'logical_volume': 'root-lv', 'name': 'root', 'size': 20}]
self.fake_conductor_api_dc_std.create_host_filesystems.assert_called_with(
self.context,