Skip to content
Snippets Groups Projects
Commit 432e8e2f authored by Iustin Pop's avatar Iustin Pop
Browse files

Add new spindle_count node parameter


Currently this is not handled by Ganeti, just recorded.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 2a27dac3
No related branches found
No related tags found
No related merge requests found
...@@ -973,9 +973,11 @@ IPOLICY_ALL_KEYS = (IPOLICY_ISPECS | ...@@ -973,9 +973,11 @@ IPOLICY_ALL_KEYS = (IPOLICY_ISPECS |
# Node parameter names # Node parameter names
ND_OOB_PROGRAM = "oob_program" ND_OOB_PROGRAM = "oob_program"
ND_SPINDLE_COUNT = "spindle_count"
NDS_PARAMETER_TYPES = { NDS_PARAMETER_TYPES = {
ND_OOB_PROGRAM: VTYPE_MAYBE_STRING, ND_OOB_PROGRAM: VTYPE_MAYBE_STRING,
ND_SPINDLE_COUNT: VTYPE_INT,
} }
NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys()) NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
...@@ -1817,6 +1819,7 @@ BEC_DEFAULTS = { ...@@ -1817,6 +1819,7 @@ BEC_DEFAULTS = {
NDC_DEFAULTS = { NDC_DEFAULTS = {
ND_OOB_PROGRAM: None, ND_OOB_PROGRAM: None,
ND_SPINDLE_COUNT: 1,
} }
DISK_LD_DEFAULTS = { DISK_LD_DEFAULTS = {
......
...@@ -99,8 +99,8 @@ vm_capable ...@@ -99,8 +99,8 @@ vm_capable
Node Parameters Node Parameters
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
These parameters are node specific and can be preseeded on node-group The ``ndparams`` refer to node parameters. These can be set as defaults
and cluster level. on cluster and node group levels, but they take effect for nodes only.
Currently we support the following node parameters: Currently we support the following node parameters:
...@@ -109,6 +109,13 @@ oob_program ...@@ -109,6 +109,13 @@ oob_program
the `Ganeti Node OOB Management Framework <design-oob.rst>`_ design the `Ganeti Node OOB Management Framework <design-oob.rst>`_ design
document. document.
spindle_count
This should reflect the I/O performance of local attached storage
(e.g. for "file", "plain" and "drbd" disk templates). It doesn't
have to match the actual spindle count of (any eventual) mechanical
hard-drives, its meaning is site-local and just the relative values
matter.
Hypervisor State Parameters Hypervisor State Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
#!/usr/bin/python #!/usr/bin/python
# #
# Copyright (C) 2006, 2007, 2010, 2011 Google Inc. # Copyright (C) 2006, 2007, 2010, 2011, 2012 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -200,6 +200,7 @@ class TestConfigRunner(unittest.TestCase): ...@@ -200,6 +200,7 @@ class TestConfigRunner(unittest.TestCase):
def testGetNdParamsModifiedNode(self): def testGetNdParamsModifiedNode(self):
my_ndparams = { my_ndparams = {
constants.ND_OOB_PROGRAM: "/bin/node-oob", constants.ND_OOB_PROGRAM: "/bin/node-oob",
constants.ND_SPINDLE_COUNT: 1,
} }
cfg = self._get_object() cfg = self._get_object()
......
#!/usr/bin/python #!/usr/bin/python
# #
# Copyright (C) 2006, 2007, 2008, 2010 Google Inc. # Copyright (C) 2006, 2007, 2008, 2010, 2012 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -78,7 +78,8 @@ class TestClusterObject(unittest.TestCase): ...@@ -78,7 +78,8 @@ class TestClusterObject(unittest.TestCase):
}, },
} }
ndparams = { ndparams = {
constants.ND_OOB_PROGRAM: "/bin/cluster-oob" constants.ND_OOB_PROGRAM: "/bin/cluster-oob",
constants.ND_SPINDLE_COUNT: 1
} }
self.fake_cl = objects.Cluster(hvparams=hvparams, os_hvp=os_hvp, self.fake_cl = objects.Cluster(hvparams=hvparams, os_hvp=os_hvp,
...@@ -161,7 +162,8 @@ class TestClusterObject(unittest.TestCase): ...@@ -161,7 +162,8 @@ class TestClusterObject(unittest.TestCase):
ndparams={}, ndparams={},
group="testgroup") group="testgroup")
group_ndparams = { group_ndparams = {
constants.ND_OOB_PROGRAM: "/bin/group-oob" constants.ND_OOB_PROGRAM: "/bin/group-oob",
constants.ND_SPINDLE_COUNT: 10,
} }
fake_group = objects.NodeGroup(name="testgroup", fake_group = objects.NodeGroup(name="testgroup",
ndparams=group_ndparams) ndparams=group_ndparams)
...@@ -170,7 +172,8 @@ class TestClusterObject(unittest.TestCase): ...@@ -170,7 +172,8 @@ class TestClusterObject(unittest.TestCase):
def testFillNdParamsNode(self): def testFillNdParamsNode(self):
node_ndparams = { node_ndparams = {
constants.ND_OOB_PROGRAM: "/bin/node-oob" constants.ND_OOB_PROGRAM: "/bin/node-oob",
constants.ND_SPINDLE_COUNT: 2,
} }
fake_node = objects.Node(name="test", fake_node = objects.Node(name="test",
ndparams=node_ndparams, ndparams=node_ndparams,
...@@ -182,13 +185,15 @@ class TestClusterObject(unittest.TestCase): ...@@ -182,13 +185,15 @@ class TestClusterObject(unittest.TestCase):
def testFillNdParamsAll(self): def testFillNdParamsAll(self):
node_ndparams = { node_ndparams = {
constants.ND_OOB_PROGRAM: "/bin/node-oob" constants.ND_OOB_PROGRAM: "/bin/node-oob",
constants.ND_SPINDLE_COUNT: 5,
} }
fake_node = objects.Node(name="test", fake_node = objects.Node(name="test",
ndparams=node_ndparams, ndparams=node_ndparams,
group="testgroup") group="testgroup")
group_ndparams = { group_ndparams = {
constants.ND_OOB_PROGRAM: "/bin/group-oob" constants.ND_OOB_PROGRAM: "/bin/group-oob",
constants.ND_SPINDLE_COUNT: 4,
} }
fake_group = objects.NodeGroup(name="testgroup", fake_group = objects.NodeGroup(name="testgroup",
ndparams=group_ndparams) ndparams=group_ndparams)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment