From 5cd8f8dd9eee52a2a27faf278ab406589d8efacf Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Fri, 28 Aug 2015 15:38:07 +0200 Subject: [PATCH] openstack: set config default and documentation Add documentation for the ~/.teuthology.yaml OpenStack configuration values and set reasonable defaults. Signed-off-by: Loic Dachary --- docs/siteconfig.rst | 66 ++++++++++++++++++++++++++++++++++++++++++++ teuthology/config.py | 13 +++++++++ 2 files changed, 79 insertions(+) diff --git a/docs/siteconfig.rst b/docs/siteconfig.rst index d0ab2643f0..130ec99ec2 100644 --- a/docs/siteconfig.rst +++ b/docs/siteconfig.rst @@ -109,3 +109,69 @@ Here is a sample configuration with many of the options set and documented:: # armv7l # etc. baseurl_template: http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri} + + # The OpenStack backend configuration, a dictionary interpreted as follows + # + openstack: + + # The path to the user-data file used when creating a target. It can have + # the {os_type} and {os_version} placeholders which are replaced with + # the value of --os-type and --os-version. No instance of a give {os_type} + # and {os_version} combination can be created unless such a file exists. + # + user-data: teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt + + # The IP number of the instance running the teuthology cluster. It will + # be used to build user facing URLs and should usually be the floating IP + # associated with the instance running the pulpito server. + # + ip: 8.4.8.4 + + # OpenStack has predefined machine sizes (called flavors) + # For a given job requiring N machines, the following example select + # the smallest flavor that satisfies these requirements. For instance + # If there are three flavors + # + # F1 (10GB disk, 2000MB RAM, 1CPU) + # F2 (100GB disk, 7000MB RAM, 1CPU) + # F3 (50GB disk, 7000MB RAM, 1CPU) + # + # and machine: { disk: 40, ram: 7000, cpus: 1 }, F3 will be chosen. + # F1 does not have enough RAM (2000 instead of the 7000 minimum) and + # although F2 satisfies all the requirements, it is larger than F3 + # (100GB instead of 50GB) and presumably more expensive. + # + # This configuration applies to all instances created for teuthology jobs + # that do not redefine these values. + # + machine: + + # The minimum root disk size of the flavor, in GB + # + disk: 20 # GB + + # The minimum RAM size of the flavor, in MB + # + ram: 8000 # MB + + # The minimum number of vCPUS of the flavor + # + cpus: 1 + + # The volumes attached to each instance. In the following example, + # three volumes of 10 GB will be created for each instanced and + # will show as /dev/vdb, /dev/vdc and /dev/vdd + # + # + # This configuration applies to all instances created for teuthology jobs + # that do not redefine these values. + # + volumes: + + # The number of volumes + # + count: 3 + + # The size of each volume, in GB + # + size: 10 # GB diff --git a/teuthology/config.py b/teuthology/config.py index 5944f3e0e8..e7cfcc296c 100644 --- a/teuthology/config.py +++ b/teuthology/config.py @@ -147,6 +147,19 @@ class TeuthologyConfig(YamlConfig): 'koji_task_url': 'https://kojipkgs.fedoraproject.org/work/', 'baseurl_template': 'http://{host}/{proj}-{pkg_type}-{dist}-{arch}-{flavor}/{uri}', 'teuthology_path': None, + 'openstack': { + 'user-data': 'teuthology/openstack/openstack-{os_type}-{os_version}-user-data.txt', + 'ip': '1.1.1.1', + 'machine': { + 'disk': 20, + 'ram': 8000, + 'cpus': 1, + }, + 'volumes': { + 'count': 3, + 'size': 10, + }, + }, } def __init__(self, yaml_path=None): -- 2.39.5