From b5f9f638f1966af089dbce76c1b9ce03149ae9ce Mon Sep 17 00:00:00 2001 From: "Ing. Jan KRCMAR" Date: Thu, 9 Mar 2017 14:26:55 +0100 Subject: [PATCH] autostart stays persistent after instance migration --- instances/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/instances/views.py b/instances/views.py index 753d42f..44297ce 100644 --- a/instances/views.py +++ b/instances/views.py @@ -571,7 +571,15 @@ def instance(request, compute_id, vname): instance.compute = new_compute instance.save() conn_migrate.close() - msg = _("Migrate") + if autostart: + conn_new = wvmInstance(new_compute.hostname, + new_compute.login, + new_compute.password, + new_compute.type, + vname) + conn_new.set_autostart(1) + conn_new.close() + msg = _("Migrate to %s" % new_compute.hostname) addlogmsg(request.user.username, instance.name, msg) return HttpResponseRedirect(reverse('instance', args=[compute_id, vname]))