Ability to customize flavors in Tempest

We need custom flavors, since we run Tempest on Virtuozzo
in CentOs 7 containers, they require more resources.

Change-Id: I83187e103e4bb80ad87afcf1c0a7583149f98828
This commit is contained in:
Evgeny Antyshev 2017-01-20 10:52:13 +00:00 committed by Alan Pevec
parent 7775ab65fd
commit b1870cde74
4 changed files with 148 additions and 13 deletions

View File

@ -1016,6 +1016,30 @@ Provisioning tempest config
**CONFIG_PROVISION_TEMPEST_FLOATRANGE** **CONFIG_PROVISION_TEMPEST_FLOATRANGE**
CIDR network address for the floating IP subnet. CIDR network address for the floating IP subnet.
**CONFIG_PROVISION_TEMPEST_FLAVOR_NAME**
Primary flavor name to use in Tempest.
**CONFIG_PROVISION_TEMPEST_FLAVOR_DISK**
Primary flavor's disk quota in Gb.
**CONFIG_PROVISION_TEMPEST_FLAVOR_RAM**
Primary flavor's ram in Mb.
**CONFIG_PROVISION_TEMPEST_FLAVOR_VCPUS**
Primary flavor's vcpus number.
**CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_NAME**
Alternative flavor name to use in Tempest.
**CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_DISK**
Alternative flavor's disk quota in Gb.
**CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_RAM**
Alternative flavor's ram in Mb.
**CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_VCPUS**
Alternative flavor's vcpus number.
**CONFIG_RUN_TEMPEST** **CONFIG_RUN_TEMPEST**
Specify 'y' to run Tempest smoke test as last step of installation. Specify 'y' to run Tempest smoke test as last step of installation.

View File

@ -285,6 +285,104 @@ def initConfig(controller):
"NEED_CONFIRM": False, "NEED_CONFIRM": False,
"CONDITION": False}, "CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-name",
"PROMPT": "What is the name of the primary Tempest flavor?",
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": "m1.nano",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_NAME",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-disk",
"PROMPT": ("How much of disk space has "
"the primary Tempest flavor (Gb)?"),
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_integer],
"DEFAULT_VALUE": "0",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_DISK",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-ram",
"PROMPT": "How much is the primary Tempest flavor's ram (Mb)?",
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_integer],
"DEFAULT_VALUE": "128",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_RAM",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-vcpus",
"PROMPT": "How many vcpus is in the primary Tempest flavor?",
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_integer],
"DEFAULT_VALUE": "1",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_VCPUS",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-alt-name",
"PROMPT": "What is the name of the alternative Tempest flavor?",
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": "m1.micro",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_NAME",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-alt-disk",
"PROMPT": ("How much of disk space has "
"the alternative Tempest flavor (Gb)?"),
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_integer],
"DEFAULT_VALUE": "0",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_DISK",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-alt-ram",
"PROMPT": "How much is the alternative Tempest flavor's ram?",
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_integer],
"DEFAULT_VALUE": "128",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_RAM",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "provision-tempest-flavor-alt-vcpus",
"PROMPT": "How many vcpus has the alternative Tempest flavor?",
"OPTION_LIST": False,
"VALIDATORS": [validators.validate_integer],
"DEFAULT_VALUE": "1",
"MASK_INPUT": False,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_VCPUS",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"CONDITION": False},
{"CMD_OPTION": "run-tempest", {"CMD_OPTION": "run-tempest",
"PROMPT": ("Do you wish to run tempest?"), "PROMPT": ("Do you wish to run tempest?"),
"OPTION_LIST": ["y", "n"], "OPTION_LIST": ["y", "n"],

View File

@ -53,24 +53,32 @@ class packstack::provision::tempest ()
$tempest_user = hiera('CONFIG_PROVISION_TEMPEST_USER') $tempest_user = hiera('CONFIG_PROVISION_TEMPEST_USER')
$tempest_password = hiera('CONFIG_PROVISION_TEMPEST_USER_PW') $tempest_password = hiera('CONFIG_PROVISION_TEMPEST_USER_PW')
# Nano and Micro flavors are used, otherwise flavors used by default too much resources for nothing $tempest_flavor_name = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_NAME')
$tempest_flavor_ref = "42" $tempest_flavor_ref = "42"
$tempest_flavor_ref_alt = "84" $tempest_flavor_ram = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_RAM')
$tempest_flavor_disk = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_DISK')
$tempest_flavor_vcpus= hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_VCPUS')
nova_flavor { 'm1.nano': $tempest_flavor_alt_name = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_NAME')
$tempest_flavor_alt_ref = "84"
$tempest_flavor_alt_ram = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_RAM')
$tempest_flavor_alt_disk = hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_DISK')
$tempest_flavor_alt_vcpus= hiera('CONFIG_PROVISION_TEMPEST_FLAVOR_ALT_VCPUS')
nova_flavor { $tempest_flavor_name :
ensure => present, ensure => present,
id => $tempest_flavor_ref, id => $tempest_flavor_ref,
ram => '128', ram => $tempest_flavor_ram,
disk => '0', disk => $tempest_flavor_disk,
vcpus => '1', vcpus => $tempest_flavor_vcpus,
require => [ Class['::nova::api'], Class['::nova::keystone::auth'] ], require => [ Class['::nova::api'], Class['::nova::keystone::auth'] ],
} }
nova_flavor { 'm1.micro': nova_flavor { $tempest_flavor_alt_name :
ensure => present, ensure => present,
id => $tempest_flavor_ref_alt, id => $tempest_flavor_alt_ref,
ram => '128', ram => $tempest_flavor_alt_ram,
disk => '0', disk => $tempest_flavor_alt_disk,
vcpus => '1', vcpus => $tempest_flavor_alt_vcpus,
require => [ Class['::nova::api'], Class['::nova::keystone::auth'] ], require => [ Class['::nova::api'], Class['::nova::keystone::auth'] ],
} }
@ -122,7 +130,7 @@ class packstack::provision::tempest ()
configure_networks => $configure_networks, configure_networks => $configure_networks,
debug => $debug, debug => $debug,
flavor_ref => $tempest_flavor_ref, flavor_ref => $tempest_flavor_ref,
flavor_ref_alt => $tempest_flavor_ref_alt, flavor_ref_alt => $tempest_flavor_alt_ref,
glance_available => $glance_available, glance_available => $glance_available,
heat_available => $heat_available, heat_available => $heat_available,
horizon_available => $horizon_available, horizon_available => $horizon_available,

View File

@ -0,0 +1,5 @@
---
features:
- |
Added new set of variables CONFIG_PROVISION_TEMPEST_FLAVOR_*,
enabling the customization of created flavors.