diff --git a/instances/templates/instance.html b/instances/templates/instance.html index e7ca557..b77d469 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -844,6 +844,12 @@ +
+ +
+ +
+
{% if computes_count != 1 %} {% else %} diff --git a/instances/views.py b/instances/views.py index 4dfe4e5..753d42f 100644 --- a/instances/views.py +++ b/instances/views.py @@ -561,13 +561,13 @@ def instance(request, compute_id, vname): live = request.POST.get('live_migrate', False) unsafe = request.POST.get('unsafe_migrate', False) xml_del = request.POST.get('xml_delete', False) + offline = request.POST.get('offline_migrate', False) new_compute = Compute.objects.get(id=compute_id) conn_migrate = wvmInstances(new_compute.hostname, new_compute.login, new_compute.password, new_compute.type) - conn_migrate.moveto(conn, vname, live, unsafe, xml_del) - conn_migrate.define_move(vname) + conn_migrate.moveto(conn, vname, live, unsafe, xml_del, offline) instance.compute = new_compute instance.save() conn_migrate.close() diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 3c287e0..0777b35 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -67,20 +67,18 @@ class wvmInstances(wvmConnect): dom = self.get_instance(name) dom.resume() - def moveto(self, conn, name, live, unsafe, undefine): + def moveto(self, conn, name, live, unsafe, undefine, offline): flags = 0 if live and conn.get_status() == 1: flags |= VIR_MIGRATE_LIVE if unsafe and conn.get_status() == 1: flags |= VIR_MIGRATE_UNSAFE dom = conn.get_instance(name) - dom.migrate(self.wvm, flags, name, None, 0) + xml = dom.XMLDesc(VIR_DOMAIN_XML_SECURE) + if not offline: + dom.migrate(self.wvm, flags, None, None, 0) if undefine: dom.undefine() - - def define_move(self, name): - dom = self.get_instance(name) - xml = dom.XMLDesc(VIR_DOMAIN_XML_SECURE) self.wvm.defineXML(xml) def graphics_type(self, name):