libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/7] libcloud git commit: Add SR-IOV net support to images in EC2 compute driver
Date Mon, 10 Apr 2017 02:22:56 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 9e864c66d -> f4f91b182


Add SR-IOV net support to images in EC2 compute driver


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/f255f06e
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/f255f06e
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/f255f06e

Branch: refs/heads/trunk
Commit: f255f06ed13d0c645d3fe8b30e20a4ddf03e59d9
Parents: c62d7c9
Author: Alex Misstear <amisstea@redhat.com>
Authored: Tue Apr 4 12:03:19 2017 -0400
Committer: Alex Misstear <amisstea@redhat.com>
Committed: Tue Apr 4 12:03:19 2017 -0400

----------------------------------------------------------------------
 libcloud/compute/drivers/ec2.py   | 14 +++++++++++++-
 libcloud/test/compute/test_ec2.py |  3 ++-
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/f255f06e/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index 466b802..a268a3e 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -2392,6 +2392,10 @@ RESOURCE_EXTRA_ATTRIBUTES_MAP = {
         'ena_support': {
             'xpath': 'enaSupport',
             'transform_func': str
+        },
+        'sriov_net_support': {
+            'xpath': 'sriovNetSupport',
+            'transform_func': str
         }
     },
     'network': {
@@ -3928,7 +3932,7 @@ class BaseEC2NodeDriver(NodeDriver):
                           image_location=None, root_device_name=None,
                           block_device_mapping=None, kernel_id=None,
                           ramdisk_id=None, virtualization_type=None,
-                          ena_support=None):
+                          ena_support=None, sriov_net_support=None):
         """
         Registers an Amazon Machine Image based off of an EBS-backed instance.
         Can also be used to create images from snapshots. More information
@@ -3972,6 +3976,11 @@ class BaseEC2NodeDriver(NodeDriver):
                                  Network Adapter for the AMI
         :type       ena_support: ``bool``
 
+        :param      sriov_net_support: Set to "simple" to enable enhanced
+                                       networking with the Intel 82599 Virtual
+                                       Function interface
+        :type       sriov_net_support: ``str``
+
         :rtype:     :class:`NodeImage`
         """
 
@@ -4006,6 +4015,9 @@ class BaseEC2NodeDriver(NodeDriver):
         if ena_support is not None:
             params['EnaSupport'] = ena_support
 
+        if sriov_net_support is not None:
+            params['SriovNetSupport'] = sriov_net_support
+
         image = self._to_image(
             self.connection.request(self.path, params=params).object
         )

http://git-wip-us.apache.org/repos/asf/libcloud/blob/f255f06e/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index 7702d82..4a894bc 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -559,7 +559,8 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin):
                                               description='My Image',
                                               architecture='x86_64',
                                               block_device_mapping=mapping,
-                                              ena_support=True)
+                                              ena_support=True,
+                                              sriov_net_support='simple')
         self.assertEqual(image.id, 'ami-57c2fb3e')
 
     def test_ex_list_availability_zones(self):


Mime
View raw message