diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 5fb958b98..d71b8222b 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -465,3 +465,9 @@ Example configuration:: Determine the flavor to use (e.g. ``m1.medium``, ``m1.large``, etc). The smallest flavor that meets the ``min-ram`` requirements will be chosen. + +**optional** + + ``key-name`` + If given, is the name of a keypair that will be used when booting each + server. diff --git a/nodepool/cmd/config_validator.py b/nodepool/cmd/config_validator.py index cff69ecd0..a12a5bd79 100644 --- a/nodepool/cmd/config_validator.py +++ b/nodepool/cmd/config_validator.py @@ -34,6 +34,7 @@ class ConfigValidator: v.Required('diskimage'): str, 'min-ram': int, 'flavor-name': str, + 'key-name': str, } pool_label = v.All(pool_label_main, diff --git a/nodepool/config.py b/nodepool/config.py index 49cd0ccef..03fc0275e 100644 --- a/nodepool/config.py +++ b/nodepool/config.py @@ -89,7 +89,8 @@ class ProviderLabel(ConfigValue): def __eq__(self, other): if (other.diskimage != self.diskimage or other.min_ram != self.min_ram or - other.flavor_name != self.flavor_name): + other.flavor_name != self.flavor_name or + other.key_name != self.key_name): return False return True @@ -250,6 +251,7 @@ def loadConfig(config_path): pl.diskimage = newconfig.diskimages[label['diskimage']] pl.min_ram = label.get('min-ram', 0) pl.flavor_name = label.get('flavor-name', None) + pl.key_name = label.get('key-name') top_label = newconfig.labels[pl.name] top_label.pools.append(pp) diff --git a/nodepool/nodepool.py b/nodepool/nodepool.py index 5354dbfd4..61bc84549 100644 --- a/nodepool/nodepool.py +++ b/nodepool/nodepool.py @@ -280,6 +280,7 @@ class NodeLauncher(threading.Thread, StatsReporter): image_id=cloud_image.external_id, min_ram=self._label.min_ram, flavor_name=self._label.flavor_name, + key_name=self._label.key_name, az=self._node.az, config_drive=self._diskimage.config_drive, nodepool_node_id=self._node.id,