From 767a5fc5daaa91b01a7cad0f118ce4af074e35c3 Mon Sep 17 00:00:00 2001 From: Levi Date: Sat, 6 May 2017 18:17:47 -0500 Subject: [PATCH] fixing errors on vm creation --- hosting/opennebula_functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hosting/opennebula_functions.py b/hosting/opennebula_functions.py index 8a010931..b8f5b5ab 100644 --- a/hosting/opennebula_functions.py +++ b/hosting/opennebula_functions.py @@ -88,7 +88,7 @@ class HostingManageVMAdmin(admin.ModelAdmin): return TemplateResponse(request, "hosting/managevms.html", context) def create_vm_view(self, specs): - + vm_id = None try: # We do have the vm_template param set. Get and parse it # and check it to be in the desired range. @@ -107,11 +107,11 @@ class HostingManageVMAdmin(admin.ModelAdmin): vm_id = oca.VirtualMachine.allocate( self.client, vm_string_formatter.format( - memory=specs.get('memory'), + memory=1024 * specs.get('memory'), vcpu=specs.get('cores'), cpu=0.1 * specs.get('cores'), disk_type='fs', - size=specs.get('disk_size') + size=10000 * specs.get('disk_size') ) ) # message = _("Created with id = " + str(vm_id))