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 2014/09/23 13:29:44 UTC

git commit: Add virtualization type option for EC2 image registration

Repository: libcloud
Updated Branches:
  refs/heads/trunk 51189eff1 -> ad73a0c91


Add virtualization type option for EC2 image registration

Closes #361

Signed-off-by: Tomaz Muraus <to...@apache.org>


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

Branch: refs/heads/trunk
Commit: ad73a0c91920fc04cc27b52e17633334295ae6f9
Parents: 51189ef
Author: Andy Grimm <ag...@redhat.com>
Authored: Mon Sep 22 15:22:34 2014 -0400
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Sep 23 13:22:41 2014 +0200

----------------------------------------------------------------------
 CHANGES.rst                     |  5 +++++
 libcloud/compute/drivers/ec2.py | 10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/ad73a0c9/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 6898eb7..54bf069 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -107,6 +107,11 @@ Compute
   (GITHUB-360)
   [Evgeny Egorochkin]
 
+- Allow user to specify virtualization type when registering an EC2 image by
+  passing ``virtualization_type`` argument to the ``ex_register_image`` method.
+  (GITHUB-361)
+  [Andy Grimm]
+
 Storage
 ~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/ad73a0c9/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index 693e5c3..6d98c9a 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -2573,7 +2573,7 @@ class BaseEC2NodeDriver(NodeDriver):
     def ex_register_image(self, name, description=None, architecture=None,
                           image_location=None, root_device_name=None,
                           block_device_mapping=None, kernel_id=None,
-                          ramdisk_id=None):
+                          ramdisk_id=None, virtualization_type=None):
         """
         Registers an Amazon Machine Image based off of an EBS-backed instance.
         Can also be used to create images from snapshots. More information
@@ -2608,6 +2608,11 @@ class BaseEC2NodeDriver(NodeDriver):
         :param      ramdisk_id: RAM disk for AMI (optional)
         :type       ramdisk_id: ``str``
 
+        :param      virtualization_type: The type of virtualization for the
+                                         AMI you are registering, paravirt
+                                         or hvm (optional)
+        :type       virtualization_type: ``str``
+
         :rtype:     :class:`NodeImage`
         """
 
@@ -2636,6 +2641,9 @@ class BaseEC2NodeDriver(NodeDriver):
         if ramdisk_id is not None:
             params['RamDiskId'] = ramdisk_id
 
+        if virtualization_type is not None:
+            params['VirtualizationType'] = virtualization_type
+
         image = self._to_image(
             self.connection.request(self.path, params=params).object
         )