libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Siim Põder (JIRA) <j...@apache.org>
Subject [jira] [Comment Edited] (LIBCLOUD-628) gce.create_node fails to create boot disk if needed.
Date Sun, 26 Oct 2014 10:51:34 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-628?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14184458#comment-14184458
] 

Siim Põder edited comment on LIBCLOUD-628 at 10/26/14 10:51 AM:
----------------------------------------------------------------

gcloud appears to default to disk size of 10G, so the following patch might be sensible:

{code}
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index bbcfbb8..74fd8d2 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -1222,7 +1222,7 @@ class GCENodeDriver(NodeDriver):
                     ex_network='default', ex_tags=None, ex_metadata=None,
                     ex_boot_disk=None, use_existing_disk=True,
                     external_ip='ephemeral', ex_disk_type='pd-standard',
-                    ex_disk_auto_delete=True):
+                    ex_disk_size=10, ex_disk_auto_delete=True):
         \"\"\"
         Create a new node and return a node object for the node.

@@ -1268,6 +1268,9 @@ class GCENodeDriver(NodeDriver):
                                 for an SSD disk.
         :type     ex_disk_type: ``str``

+        :keyword  ex_disk_size: Specify a disk size in GB, default: 10.
+        :type     ex_disk_type: ``int``
+
         :keyword  ex_disk_auto_delete: Indicate that the boot disk should be
                                        deleted when the Node is deleted. Set to
                                        True by default.
@@ -1287,8 +1290,8 @@ class GCENodeDriver(NodeDriver):
             image = self.ex_get_image(image)

         if not ex_boot_disk:
-            ex_boot_disk = self.create_volume(None, name, location=location,
-                                              image=image,
+            ex_boot_disk = self.create_volume(ex_disk_size, name,
+                                              location=location, image=image,
                                               use_existing=use_existing_disk,
                                               ex_disk_type=ex_disk_type)
 
{code}


was (Author: siimphh):
gcloud appears to default to disk size of 10G, so the following patch might be sensible:

{code}
diff --git a/libcloud/compute/drivers/gce.py b/libcloud/compute/drivers/gce.py
index bbcfbb8..74fd8d2 100644
--- a/libcloud/compute/drivers/gce.py
+++ b/libcloud/compute/drivers/gce.py
@@ -1222,7 +1222,7 @@ class GCENodeDriver(NodeDriver):
                     ex_network='default', ex_tags=None, ex_metadata=None,
                     ex_boot_disk=None, use_existing_disk=True,
                     external_ip='ephemeral', ex_disk_type='pd-standard',
-                    ex_disk_auto_delete=True):
+                    ex_disk_size=100, ex_disk_auto_delete=True):
         \"\"\"
         Create a new node and return a node object for the node.

@@ -1268,6 +1268,9 @@ class GCENodeDriver(NodeDriver):
                                 for an SSD disk.
         :type     ex_disk_type: ``str``

+        :keyword  ex_disk_size: Specify a disk size in GB, default: 100.
+        :type     ex_disk_type: ``int``
+
         :keyword  ex_disk_auto_delete: Indicate that the boot disk should be
                                        deleted when the Node is deleted. Set to
                                        True by default.
@@ -1287,8 +1290,8 @@ class GCENodeDriver(NodeDriver):
             image = self.ex_get_image(image)

         if not ex_boot_disk:
-            ex_boot_disk = self.create_volume(None, name, location=location,
-                                              image=image,
+            ex_boot_disk = self.create_volume(ex_disk_size, name,
+                                              location=location, image=image,
                                               use_existing=use_existing_disk,
                                               ex_disk_type=ex_disk_type)
 
{code}

> gce.create_node fails to create boot disk if needed.
> ----------------------------------------------------
>
>                 Key: LIBCLOUD-628
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-628
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Compute
>            Reporter: Siim Põder
>            Priority: Minor
>
> Calling create_node calls create_volume with size of None which results in API error:
> libcloud.common.google.InvalidRequestError: {'domain': 'global', 'message': "Invalid
value for field 'resource.sizeGb': ''.  Disk size is required.", 'reason': 'invalid'}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message