From babf25ccdcafc05cf8d1b8e9c362d556bbd35dfb Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 14 Jul 2015 07:44:03 -0500 Subject: [PATCH] [spec] Consistent resource names Name resources consistently to improve cleanup and make Rally more generic. Change-Id: I2888b9874c695a6616576c22f3ea218901911b5d --- .../in-progress/consistent_resource_names.rst | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 doc/specs/in-progress/consistent_resource_names.rst diff --git a/doc/specs/in-progress/consistent_resource_names.rst b/doc/specs/in-progress/consistent_resource_names.rst new file mode 100644 index 0000000000..097a1c6f14 --- /dev/null +++ b/doc/specs/in-progress/consistent_resource_names.rst @@ -0,0 +1,125 @@ +.. + This work is licensed under a Creative Commons Attribution 3.0 Unported + License. + + http://creativecommons.org/licenses/by/3.0/legalcode + +========================= +Consistent Resource Names +========================= + +To facilitate better cleanup of ephemeral resources created by Rally, +random resource names need to be consistently used across all +scenarios and all plugins. Additionally, to support Rally's use +against systems other than OpenStack, plugins need greater control +over both the format and the list of characters used in generating +resource names. + +Problem description +=================== + +Currently we use a few different cleanup mechanisms, some of which +(Keystone) use resource names, while most others use tenant +membership. As a result, if Rally is interrupted before cleanup +completes it may not be possible to know which resources were created +by Rally (and thus should be cleaned up after the fact). + +Random names are generated from a fairly limited set of digits and +ASCII letters. This should be configurable by each plugin, along with +all other parts of the random name, in order to support benchmarking +systems other than OpenStack, which may have different naming +restrictions. + +Finally, each Rally task should include some consistent element in its +resource names, distinct from other Rally tasks, to support multiple +independent Rally runs and cleanup. + +Proposed change +=============== + +Random names will consist of three components: + +* A random element derived from the task ID that is the same for all + random names in the task; +* A random element that should be different for all names in the task; + and +* Any amount of formatting as determined by the plugin. + +The format of the random name will be given by a class variable, +``RESOURCE_NAME_FORMAT``, on each scenario and context plugin. This +variable is a ``mktemp(1)``-like string that describes the format; the +default for scenario plugins will be:: + + RESOURCE_NAME_FORMAT = "s_rally_XXXXXXXX_XXXXXXXX" + +And for context plugins:: + + RESOURCE_NAME_FORMAT = "c_rally_XXXXXXXX_XXXXXXXX" + +The format must have two separate sets of at least three consecutive +'X's. (That is, they must match: +``^.*(?