Remove users_per_tenant, small fixes/enhancements
Change-Id: Iac724062b5c18bfba537660fcec8706b9e9b13f0
This commit is contained in:
parent
315f94bdc9
commit
f64ab431f9
@ -2,51 +2,4 @@
|
||||
KLOUDBUSTER IMAGE BUILD INSTRUCTIONS
|
||||
====================================
|
||||
|
||||
There are 2 ways to build the kloudbuster image:
|
||||
* using Vagrant (recommended to build the image on Mac)
|
||||
* using the build-image.sh script (recommended to build the image on Linux)
|
||||
|
||||
Build on Mac OSX
|
||||
================
|
||||
|
||||
Pre-Requisites
|
||||
--------------
|
||||
* must have access to the Internet (to allow download of packages)
|
||||
* must install Vagrant (https://www.vagrantup.com/downloads.html)
|
||||
* must install VirtualBox (https://www.virtualbox.org/wiki/Downloads)
|
||||
|
||||
Instructions
|
||||
------------
|
||||
|
||||
* Open a shell window
|
||||
* cd to the scale/dib directory (where this README.rst file resides)
|
||||
* run vagrant: "vagrant up"
|
||||
|
||||
The build should take around 5-7 minutes (may vary depending on the speed of your Internet connection) and you should see the kloudbuster.qcow2 image appear in the current directory.
|
||||
|
||||
After the image is built, simply discard the vagrant VM: "vagrant destroy"
|
||||
|
||||
|
||||
Build on Linux
|
||||
==============
|
||||
|
||||
Pre-Requisites
|
||||
--------------
|
||||
* must have access to the Internet (to allow download of packages)
|
||||
* must install git
|
||||
* must install qemu-utils
|
||||
|
||||
Instructions
|
||||
------------
|
||||
|
||||
* clone the kloudbuster git repository somewhere
|
||||
* git clone -b kloudbuster git://github.com/stackforge/vmtp.git
|
||||
* cd vmtp/scale/dib
|
||||
* ./build-image.sh
|
||||
|
||||
The build should take around 5-7 minutes (may vary depending on the speed of your Internet connection) and you should see the kloudbuster.qcow2 image appear in the current directory.
|
||||
|
||||
After the image is built, move the image in a safe location and delete the vmtp directory.
|
||||
|
||||
|
||||
|
||||
Refer to `here <http://kloudbuster.readthedocs.org/en/latest/installation.html#build-vm-image>`_ for the instructions of building KloudBuster image.
|
||||
|
@ -170,7 +170,7 @@ paths:
|
||||
description: The session to be queried
|
||||
required: true
|
||||
- name: offset
|
||||
type: int
|
||||
type: integer
|
||||
in: query
|
||||
description: The offset of the log file to read
|
||||
required: false
|
||||
|
@ -56,14 +56,11 @@ server:
|
||||
disk: 20
|
||||
|
||||
# Number of tenants to be created on the cloud
|
||||
# KloudBuster will also create 1 user automatically for each tenant
|
||||
number_tenants: 1
|
||||
|
||||
# Number of Users to be created inside the tenant
|
||||
# By default, create only 1 user per tenant
|
||||
users_per_tenant: 1
|
||||
|
||||
# Number of routers to be created within the context of each User
|
||||
routers_per_user: 1
|
||||
routers_per_tenant: 1
|
||||
|
||||
# Number of networks to be created within the context of each Router
|
||||
# Assumes 1 subnet per network
|
||||
@ -136,14 +133,15 @@ client:
|
||||
# Timeout for HTTP requests
|
||||
timeout: 5
|
||||
# Connection Type: "Keep-alive", "New"
|
||||
# keep-alive: the TCP connection is reused across requests
|
||||
# new: create a new TCP connection for every request (and close it after receiving the reply)
|
||||
# Keep-alive: the TCP connection is reused across requests
|
||||
# New: create a new TCP connection for every request (and close it after receiving the reply)
|
||||
# Note: "New" is not currently supported.
|
||||
connection_type: 'Keep-alive'
|
||||
# Interval for periodical report in seconds
|
||||
# Use 0 if you only need 1 final aggregated report for the entire run duration
|
||||
# Otherwise will provide results at every interval (results are reset at the start of each period and
|
||||
# are not cumulative across periods)
|
||||
report_interval: 5
|
||||
report_interval: 0
|
||||
# Duration of testing tools (seconds)
|
||||
duration: 30
|
||||
|
||||
|
@ -12,15 +12,14 @@
|
||||
# tenant to hold the resources for both server cloud and client cloud.
|
||||
#
|
||||
# NOTE:
|
||||
# (1) For now, we only support one user per tenant;
|
||||
# (2) Under tenant/user resuing mode, all resources will be sitting under
|
||||
# (1) Under tenant/user resuing mode, all resources will be sitting under
|
||||
# the same tenant, so there will be fixed *ONLY* one user for holding
|
||||
# client side resources;
|
||||
|
||||
tenant_name: demo_tenant
|
||||
server_user:
|
||||
- username: demo_user_1
|
||||
password: demo_user_1
|
||||
username: demo_user_1
|
||||
password: demo_user_1
|
||||
client_user:
|
||||
username: demo_user_2
|
||||
password: demo_user_2
|
||||
|
@ -34,12 +34,8 @@ hardcoded_client_cfg = {
|
||||
# Number of tenants to be created on the cloud
|
||||
'number_tenants': 1,
|
||||
|
||||
# Number of Users to be created inside the tenant
|
||||
'users_per_tenant': 1,
|
||||
|
||||
# Number of routers to be created within the context of each User
|
||||
# For now support only 1 router per user
|
||||
'routers_per_user': 1,
|
||||
'routers_per_tenant': 1,
|
||||
|
||||
# Number of networks to be created within the context of each Router
|
||||
# Assumes 1 subnet per network
|
||||
@ -133,9 +129,8 @@ class KBConfig(object):
|
||||
self.update_configs()
|
||||
|
||||
def get_total_vm_count(self, config):
|
||||
return (config['number_tenants'] * config['users_per_tenant'] *
|
||||
config['routers_per_user'] * config['networks_per_router'] *
|
||||
config['vms_per_network'])
|
||||
return (config['number_tenants'] * config['routers_per_tenant'] *
|
||||
config['networks_per_router'] * config['vms_per_network'])
|
||||
|
||||
def get_credentials(self):
|
||||
# Retrieve the credentials
|
||||
@ -168,7 +163,6 @@ class KBConfig(object):
|
||||
self.tenants_list = configure.Configuration.from_file(CONF.tenants_list).configure()
|
||||
try:
|
||||
self.config_scale['number_tenants'] = 1
|
||||
self.config_scale['users_per_tenant'] = len(self.tenants_list['server_user'])
|
||||
except Exception as e:
|
||||
LOG.error('Cannot parse the count of tenant/user from the config file.')
|
||||
raise KBConfigParseException(e.message)
|
||||
|
@ -218,7 +218,7 @@ class KloudBuster(object):
|
||||
self.tenants_list['server'] =\
|
||||
[{'name': tenants_list['tenant_name'], 'user': tenants_list['server_user']}]
|
||||
self.tenants_list['client'] =\
|
||||
[{'name': tenants_list['tenant_name'], 'user': [tenants_list['client_user']]}]
|
||||
[{'name': tenants_list['tenant_name'], 'user': tenants_list['client_user']}]
|
||||
LOG.warn("REUSING MODE: The quotas will not be adjusted automatically.")
|
||||
LOG.warn("REUSING MODE: The flavor configs will be ignored.")
|
||||
else:
|
||||
@ -453,17 +453,17 @@ class KloudBuster(object):
|
||||
logging.delete_logfile('kloudbuster')
|
||||
|
||||
def get_tenant_vm_count(self, config):
|
||||
return (config['users_per_tenant'] * config['routers_per_user'] *
|
||||
config['networks_per_router'] * config['vms_per_network'])
|
||||
return (config['routers_per_tenant'] * config['networks_per_router'] *
|
||||
config['vms_per_network'])
|
||||
|
||||
def calc_neutron_quota(self):
|
||||
total_vm = self.get_tenant_vm_count(self.server_cfg)
|
||||
|
||||
server_quota = {}
|
||||
server_quota['network'] = self.server_cfg['routers_per_user'] *\
|
||||
server_quota['network'] = self.server_cfg['routers_per_tenant'] *\
|
||||
self.server_cfg['networks_per_router']
|
||||
server_quota['subnet'] = server_quota['network']
|
||||
server_quota['router'] = self.server_cfg['routers_per_user']
|
||||
server_quota['router'] = self.server_cfg['routers_per_tenant']
|
||||
if (self.server_cfg['use_floatingip']):
|
||||
# (1) Each VM has one floating IP
|
||||
# (2) Each Router has one external IP
|
||||
|
@ -85,20 +85,17 @@ class Tenant(object):
|
||||
a user offloads tasks to user class
|
||||
"""
|
||||
if self.reusing_users:
|
||||
for user_info in self.reusing_users:
|
||||
user_name = user_info['username']
|
||||
password = user_info['password']
|
||||
user_instance = users.User(user_name, password, self, '_member_')
|
||||
self.user_list.append(user_instance)
|
||||
user_name = self.reusing_users['username']
|
||||
password = self.reusing_users['password']
|
||||
user_instance = users.User(user_name, password, self, '_member_')
|
||||
self.user_list.append(user_instance)
|
||||
else:
|
||||
# Loop over the required number of users and create resources
|
||||
for user_count in xrange(self.kloud.scale_cfg['users_per_tenant']):
|
||||
user_name = self.tenant_name + "-U" + str(user_count)
|
||||
user_instance = users.User(user_name, user_name, self,
|
||||
self.kloud.scale_cfg['keystone_admin_role'])
|
||||
# Global list with all user instances
|
||||
self.user_list.append(user_instance)
|
||||
self.res_logger.log('users', user_instance.user_name, user_instance.user.id)
|
||||
user_name = self.tenant_name + "-U"
|
||||
user_instance = users.User(user_name, user_name, self,
|
||||
self.kloud.scale_cfg['keystone_admin_role'])
|
||||
# Global list with all user instances
|
||||
self.user_list.append(user_instance)
|
||||
self.res_logger.log('users', user_instance.user_name, user_instance.user.id)
|
||||
|
||||
for user_instance in self.user_list:
|
||||
# Now create the user resources like routers which inturn trigger network and
|
||||
|
@ -219,8 +219,8 @@ class User(object):
|
||||
external_network = base_network.find_external_network(self.neutron_client)
|
||||
|
||||
# Create the required number of routers and append them to router list
|
||||
LOG.info("Creating routers and networks for user %s" % self.user_name)
|
||||
for router_count in range(config_scale['routers_per_user']):
|
||||
LOG.info("Creating routers and networks for tenant %s" % self.tenant.tenant_name)
|
||||
for router_count in range(config_scale['routers_per_tenant']):
|
||||
router_instance = base_network.Router(self)
|
||||
self.router_list.append(router_instance)
|
||||
router_name = self.user_name + "-R" + str(router_count)
|
||||
|
Loading…
x
Reference in New Issue
Block a user