Jump to: navigation, search

Difference between revisions of "Rally/ServerProviders"

(Note)
(Fixed renamings and new config formats)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
= Server providers: Introduction =
 +
 +
Server providers in Rally are typically used by [[DeployEngines|deploy engines]] to manage virtual machines necessary for OpenStack deployment and its following benchmarking. The key feature of server providers is that they provide a '''''unified interface''''' for interacting with different '''''virtualization technologies''''' (''LXS'', ''Virsh'' etc.) and '''''cloud suppliers''''' (like ''Amazon'').
 +
 +
Every server provider should implement the following basic interface:
 +
* '''''constructor''''', which should take the '''''deployment''''' entity the provider should bind to and a '''''config''''' dictionary as its parameters;
 +
* '''''create_servers(image_uuid, type_id, amount)''''', which should create the requested number of virtual machines of the given type using a specific image. The method should also return the list of created servers wrapped in special ''Server'' entities.
 +
* '''''destroy_servers()''''', which should destroy all virtual machines previously created by the same server provider.
 +
 +
 +
Below you will find a short but informative description of server providers implemented in Rally.
 +
 
=Available Server providers=
 
=Available Server providers=
  
==DummyProvider==
+
==ExistingServers==
  
 
===Description===
 
===Description===
Line 7: Line 19:
 
===Configuration Example===
 
===Configuration Example===
 
     {
 
     {
         "name": "ExampleEngine",
+
         "type": "DevstackEngine",
 
         "provider": {
 
         "provider": {
             "name": "DummyProvider",
+
             "type": "ExistingServers",
             "credentials": ["root@host1.net", "root@host2.net"]
+
             "credentials": [{"user": "root", "host": "10.2.0.8"}]
 
         }
 
         }
 
     }
 
     }
 
 
  
 
==VirshProvider==
 
==VirshProvider==
Line 21: Line 31:
 
This provider creates virtual machines on host provided by configuration.
 
This provider creates virtual machines on host provided by configuration.
 
===Configuration Examples===
 
===Configuration Examples===
====Clone VM from pre-built template using virsh====
+
Clone VM from pre-built template using virsh
    {
+
      {
        "name": "VirshProvider",
+
            "type": "VirshProvider",
        "connection": "user@host.net",
+
            "connection": "user@host.net",
        "vm_name": "virsh-test",
+
            "template_name": "stack-01-devstack-template",
        "clone_from_template": "devstack-template"
+
            "template_user": "ubuntu",
    }
+
            "template_password": "password"  
 +
        }
  
 
==LxcProvider==
 
==LxcProvider==
  
 
===Description===
 
===Description===
This provider creates lxc containers on host provided by another provider. This may be useful if you want to run a lots of compute nodes with fake virt.
+
This provider creates lxc containers on host provided by another provider. Container is attached to the same network as host.
 +
 
 +
Works well with ubuntu-13.10 hosts.
 
===Configuration Example===
 
===Configuration Example===
  
 
     {
 
     {
        "name": "LxcProvider",
+
            "type": "LxcProvider",
        "containers_per_host": 4,
+
            "containers_per_host": 1,
        "distribution": "debian",
+
            "distribution": "ubuntu",
        "host_provider": {
+
            "ipv4_start_address": "192.168.1.43",
            "name": "DummyProvider",
+
            "ipv4_prefixlen": 16,
            "credentials": ["root@host.net"]
+
            "host_provider": {
 +
                "type": "DummyProvider",
 +
                "credentials": [{"user": "root", "host": "192.168.1.42"}]
 
             }
 
             }
 
     }
 
     }
  
 +
==OpenStackProvider==
  
 +
===Description===
 +
Provides VMs using existing OpenStack cloud.
  
 +
===Configuration Example===
  
=Note=
+
    {
LxcProvider still under development. Stay tuned.
+
        "type": "OpenStackProvider",
 +
        "deployment_name": "Rally sample deployment",
 +
        "amount": 3,
 +
        "user": "admin",
 +
        "tenant": "admin",
 +
        "password": "secret",
 +
        "auth_url": "http://example.net:5000/v2.0",
 +
        "flavor_id": 2,
 +
        "image": {
 +
            "checksum": "75846dd06e9fcfd2b184aba7fa2b2a8d",
 +
            "url": "http://example.com/disk1.img",
 +
            "name": "Ubuntu Precise(added by rally)",
 +
            "format": "qcow2",
 +
            "userdata": "#cloud-config\r\n disable_root: false\r\n manage_etc_hosts: true\r\n"
 +
        }
 +
    }

Latest revision as of 10:11, 19 May 2014

Server providers: Introduction

Server providers in Rally are typically used by deploy engines to manage virtual machines necessary for OpenStack deployment and its following benchmarking. The key feature of server providers is that they provide a unified interface for interacting with different virtualization technologies (LXS, Virsh etc.) and cloud suppliers (like Amazon).

Every server provider should implement the following basic interface:

  • constructor, which should take the deployment entity the provider should bind to and a config dictionary as its parameters;
  • create_servers(image_uuid, type_id, amount), which should create the requested number of virtual machines of the given type using a specific image. The method should also return the list of created servers wrapped in special Server entities.
  • destroy_servers(), which should destroy all virtual machines previously created by the same server provider.


Below you will find a short but informative description of server providers implemented in Rally.

Available Server providers

ExistingServers

Description

This provider does nothing, but returns endpoints from configuration. This may be useful if you have specific software/hardware configuration ready to deploy OpenStack.

Configuration Example

   {
       "type": "DevstackEngine",
       "provider": {
           "type": "ExistingServers",
           "credentials": [{"user": "root", "host": "10.2.0.8"}]
       }
   }

VirshProvider

Description

This provider creates virtual machines on host provided by configuration.

Configuration Examples

Clone VM from pre-built template using virsh

      {
           "type": "VirshProvider",
           "connection": "user@host.net",  
           "template_name": "stack-01-devstack-template", 
           "template_user": "ubuntu",  
           "template_password": "password" 
       }

LxcProvider

Description

This provider creates lxc containers on host provided by another provider. Container is attached to the same network as host.

Works well with ubuntu-13.10 hosts.

Configuration Example

   {
           "type": "LxcProvider",
           "containers_per_host": 1,
           "distribution": "ubuntu",
           "ipv4_start_address": "192.168.1.43",
           "ipv4_prefixlen": 16,
           "host_provider": {
               "type": "DummyProvider",
               "credentials": [{"user": "root", "host": "192.168.1.42"}]
           }
   }

OpenStackProvider

Description

Provides VMs using existing OpenStack cloud.

Configuration Example

   {
       "type": "OpenStackProvider",
       "deployment_name": "Rally sample deployment",
       "amount": 3,
       "user": "admin",
       "tenant": "admin",
       "password": "secret",
       "auth_url": "http://example.net:5000/v2.0",
       "flavor_id": 2,
       "image": {
           "checksum": "75846dd06e9fcfd2b184aba7fa2b2a8d",
           "url": "http://example.com/disk1.img",
           "name": "Ubuntu Precise(added by rally)",
           "format": "qcow2",
           "userdata": "#cloud-config\r\n disable_root: false\r\n manage_etc_hosts: true\r\n"
       }
   }