Jump to: navigation, search

Difference between revisions of "Rally/HowToExtendRally"

(Rewritten)
(Deploy engine skeleton)
Line 1: Line 1:
 
=Extend Rally functionality=
 
=Extend Rally functionality=
  
==Add Server providers==
+
 
Stay tuned.
+
==Add Deploy engines==
 +
Implementing your own deploy engines allows you to employ custom OpenStack platforms. You can see the list of already available Deploy engines [[Rally/DeployEngines|here]].
 +
 
 +
To implement a custom deploy engine, you need to create a subclass of ''rally.deploy.engine.EngineFactory'' and implement the ''__init__()'', ''deploy()'' and ''cleanup()'' methods:
 +
 
 +
    from rally.deploy import engine
 +
    from rally.serverprovider import provider
 +
    class MyEngine(engine.EngineFactory):
 +
        def __init__(self, task, config):
 +
            self.task = task
 +
            self._config = config
 +
            self._vms = []
 +
            provider_config = config['provider']
 +
            self._vm_provider = provider.ProviderFactory.get_provider(
 +
                provider_config)
 +
            ''# Perform further initialization here''
 +
        def deploy(self):
 +
            self._vms = self._vm_provider.create_vms()
 +
            for vm in self._vms:
 +
                ''# Deploy OpenStack here''
 +
            ''# Return the endpoints''
 +
            return {
 +
                'identity': {
 +
                    'url': 'http://$IDENTITY_HOST/' % identity_host,
 +
                    'uri': 'http://$IDENTITY_HOST:5000/v2.0/' % identity_host,
 +
                    'admin_username': '$ADMIN',
 +
                    'admin_password': '$PASSWORD',
 +
                    'admin_tenant_name': '$TENANT',
 +
                }
 +
            }
 +
        def cleanup(self):
 +
            ''# Cleanup the deployment here, e.g.''
 +
            self._vm_provider.destroy_vms()
  
  
==Add Deploy engines==
+
==Add Server providers==
 
Stay tuned.
 
Stay tuned.
  

Revision as of 08:26, 15 October 2013

Extend Rally functionality

Add Deploy engines

Implementing your own deploy engines allows you to employ custom OpenStack platforms. You can see the list of already available Deploy engines here.

To implement a custom deploy engine, you need to create a subclass of rally.deploy.engine.EngineFactory and implement the __init__(), deploy() and cleanup() methods:

   from rally.deploy import engine
   from rally.serverprovider import provider
   class MyEngine(engine.EngineFactory):
       def __init__(self, task, config):
           self.task = task
           self._config = config
           self._vms = []
           provider_config = config['provider']
           self._vm_provider = provider.ProviderFactory.get_provider(
               provider_config)
           # Perform further initialization here
       def deploy(self):
           self._vms = self._vm_provider.create_vms()
           for vm in self._vms:
               # Deploy OpenStack here
           # Return the endpoints
           return {
               'identity': {
                   'url': 'http://$IDENTITY_HOST/' % identity_host,
                   'uri': 'http://$IDENTITY_HOST:5000/v2.0/' % identity_host,
                   'admin_username': '$ADMIN',
                   'admin_password': '$PASSWORD',
                   'admin_tenant_name': '$TENANT',
               }
           }
       def cleanup(self):
           # Cleanup the deployment here, e.g.
           self._vm_provider.destroy_vms()


Add Server providers

Stay tuned.


Add Benchmark scenarios

Stay tuned.