Commit 6c4f9394 by Guba Sándor

dashboard: connected max_ram_size and ram_size setting

parent e83b54bb
...@@ -278,6 +278,7 @@ class VmDetailView(CheckedDetailView): ...@@ -278,6 +278,7 @@ class VmDetailView(CheckedDetailView):
resources = { resources = {
'num_cores': request.POST.get('cpu-count'), 'num_cores': request.POST.get('cpu-count'),
'ram_size': request.POST.get('ram-size'), 'ram_size': request.POST.get('ram-size'),
'max_ram_size': request.POST.get('ram-size'), # TODO: max_ram
'priority': request.POST.get('cpu-priority') 'priority': request.POST.get('cpu-priority')
} }
Instance.objects.filter(pk=self.object.pk).update(**resources) Instance.objects.filter(pk=self.object.pk).update(**resources)
...@@ -422,7 +423,6 @@ class VmDetailView(CheckedDetailView): ...@@ -422,7 +423,6 @@ class VmDetailView(CheckedDetailView):
new_name = "Saved from %s (#%d) at %s" % ( new_name = "Saved from %s (#%d) at %s" % (
self.object.name, self.object.pk, date self.object.name, self.object.pk, date
) )
self.object.save_as_template_async(name=new_name, self.object.save_as_template_async(name=new_name,
user=request.user) user=request.user)
messages.success(request, _("Saving instance as template!")) messages.success(request, _("Saving instance as template!"))
...@@ -776,7 +776,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView): ...@@ -776,7 +776,7 @@ class TemplateCreate(SuccessMessageMixin, CreateView):
tags = post.pop("tags") tags = post.pop("tags")
post['pw'] = User.objects.make_random_password() post['pw'] = User.objects.make_random_password()
post.pop("parent") post.pop("parent")
post['max_ram_size'] = post['ram_size']
inst = Instance.create(params=post, disks=[], networks=networks, inst = Instance.create(params=post, disks=[], networks=networks,
tags=tags, req_traits=req_traits) tags=tags, req_traits=req_traits)
messages.success(request, _("Your disk has been created, " messages.success(request, _("Your disk has been created, "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment