You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2011/03/18 02:30:33 UTC

svn commit: r1082779 - in /incubator/libcloud/trunk/libcloud: compute/drivers/ec2.py compute/providers.py compute/types.py data/pricing.json

Author: tomaz
Date: Fri Mar 18 01:30:32 2011
New Revision: 1082779

URL: http://svn.apache.org/viewvc?rev=1082779&view=rev
Log:
Add Nimbus driver.

Changes submitted by David LaBissoniere <labisso at uchicago dot edu> as a part
of LIBCLOUD-75.

Modified:
    incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py
    incubator/libcloud/trunk/libcloud/compute/providers.py
    incubator/libcloud/trunk/libcloud/compute/types.py
    incubator/libcloud/trunk/libcloud/data/pricing.json

Modified: incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py?rev=1082779&r1=1082778&r2=1082779&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/drivers/ec2.py Fri Mar 18 01:30:32 2011
@@ -894,3 +894,59 @@ class EucNodeDriver(EC2NodeDriver):
     def list_locations(self):
         raise NotImplementedError, \
             'list_locations not implemented for this driver'
+
+# Nimbus clouds have 3 EC2-style instance types but their particular RAM
+# allocations are configured by the admin
+NIMBUS_INSTANCE_TYPES = {
+    'm1.small': {
+        'id' : 'm1.small',
+        'name': 'Small Instance',
+        'ram': None,
+        'disk': None,
+        'bandwidth': None,
+    },
+    'm1.large': {
+        'id' : 'm1.large',
+        'name': 'Large Instance',
+        'ram': None,
+        'disk': None,
+        'bandwidth': None,
+    },
+    'm1.xlarge': {
+        'id' : 'm1.xlarge',
+        'name': 'Extra Large Instance',
+        'ram': None,
+        'disk': None,
+        'bandwidth': None,
+    },
+}
+
+class NimbusConnection(EC2Connection):
+    """
+    Connection class for Nimbus
+    """
+
+    host = None
+
+class NimbusNodeDriver(EC2NodeDriver):
+    """
+    Driver class for Nimbus
+    """
+
+    type = Provider.NIMBUS
+    name = 'Nimbus'
+    api_name = 'nimbus'
+    region_name = 'nimbus'
+    friendly_name = 'Nimbus Private Cloud'
+    connectionCls = NimbusConnection
+    _instance_types = NIMBUS_INSTANCE_TYPES
+
+    def ex_describe_addresses(self, nodes):
+        """Nimbus doesn't support elastic IPs, so this is a passthrough
+        """
+        nodes_elastic_ip_mappings = {}
+        for node in nodes:
+            # empty list per node
+            nodes_elastic_ip_mappings[node.id] = []
+        return nodes_elastic_ip_mappings
+

Modified: incubator/libcloud/trunk/libcloud/compute/providers.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/providers.py?rev=1082779&r1=1082778&r2=1082779&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/providers.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/providers.py Fri Mar 18 01:30:32 2011
@@ -73,6 +73,8 @@ DRIVERS = {
         ('libcloud.compute.drivers.dreamhost', 'DreamhostNodeDriver'),
     Provider.BRIGHTBOX:
         ('libcloud.compute.drivers.brightbox', 'BrightboxNodeDriver'),
+    Provider.NIMBUS:
+        ('libcloud.compute.drivers.ec2', 'NimbusNodeDriver'),
 }
 
 def get_driver(provider):

Modified: incubator/libcloud/trunk/libcloud/compute/types.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/compute/types.py?rev=1082779&r1=1082778&r2=1082779&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/compute/types.py (original)
+++ incubator/libcloud/trunk/libcloud/compute/types.py Fri Mar 18 01:30:32 2011
@@ -51,6 +51,7 @@ class Provider(object):
     @cvar OPENNEBULA: OpenNebula.org
     @cvar DREAMHOST: DreamHost Private Server
     @cvar CLOUDSIGMA: CloudSigma
+    @cvar NIMBUS: Nimbus
     """
     DUMMY = 0
     EC2 = 1  # deprecated name
@@ -81,6 +82,7 @@ class Provider(object):
     BRIGHTBOX = 24
     CLOUDSIGMA = 25
     EC2_AP_NORTHEAST = 26
+    NIMBUS = 27
 
 class NodeState(object):
     """

Modified: incubator/libcloud/trunk/libcloud/data/pricing.json
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/data/pricing.json?rev=1082779&r1=1082778&r2=1082779&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/data/pricing.json (original)
+++ incubator/libcloud/trunk/libcloud/data/pricing.json Fri Mar 18 01:30:32 2011
@@ -79,6 +79,12 @@
         "m2.4xlarge": 2.39
     },
 
+    "nimbus" : {
+        "m1.small": 0.0,
+        "m1.large": 0.0,
+        "m1.xlarge": 0.0
+    },
+
     "cloudsigma_zrh": {
         "micro-regular": 0.0548,
         "micro-high-cpu": 0.381,