From 1760c6c670f34f8bfa5b2dc7ec7f218a0e05f772 Mon Sep 17 00:00:00 2001 From: Milamber Date: Sun, 9 Aug 2015 12:36:35 +0100 Subject: [PATCH] Add an option to allow the resize of root disk when the instance is created. (need CloudStack 4.4 or +, cloud-initramfs-growroot installed on the template) Signed-off-by: Milamber --- lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py b/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py index b3a998301be..83aa936d638 100644 --- a/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py +++ b/lib/ansible/modules/extras/cloud/cloudstack/cs_instance.py @@ -107,6 +107,11 @@ options: - Disk size in GByte required if deploying instance from ISO. required: false default: null + root_disk_size: + description: + - Root disk size in GByte required if deploying instance with KVM hypervisor and want resize the root disk size at startup (need CloudStack >= 4.4, cloud-initramfs-growroot installed and enabled in the template) + required: false + default: null security_groups: description: - List of security groups the instance to be applied to. @@ -521,6 +526,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack): args['group'] = self.module.params.get('group') args['keypair'] = self.module.params.get('ssh_key') args['size'] = self.module.params.get('disk_size') + args['rootdisksize'] = self.module.params.get('root_disk_size') args['securitygroupnames'] = ','.join(self.module.params.get('security_groups')) args['affinitygroupnames'] = ','.join(self.module.params.get('affinity_groups')) @@ -789,6 +795,7 @@ def main(): ip6_address = dict(defaul=None), disk_offering = dict(default=None), disk_size = dict(type='int', default=None), + root_disk_size = dict(type='int', default=None), keyboard = dict(choices=['de', 'de-ch', 'es', 'fi', 'fr', 'fr-be', 'fr-ch', 'is', 'it', 'jp', 'nl-be', 'no', 'pt', 'uk', 'us'], default=None), hypervisor = dict(choices=['KVM', 'VMware', 'BareMetal', 'XenServer', 'LXC', 'HyperV', 'UCS', 'OVM'], default=None), security_groups = dict(type='list', aliases=[ 'security_group' ], default=[]),