Commit f9af35c8 authored by Guido Trotter's avatar Guido Trotter
Browse files

Burnin: Use iallocator in import/export

Currently the iallocator option is ignored by burnin at import/export
time even if passed in. With this patch it becomes used. The log message
used by the importer is also changed to reflect this.

This patch also improves import/export on the non-iallocator case:
  - The secondary node is not passed anymore on non-mirrored templates
  - On mirrored templates the secondary node is logged

Reviewed-by: imsnah
parent 3e91897b
......@@ -288,6 +288,19 @@ class Burner(object):
self.instances)
for pnode, snode, enode, instance in mytor:
if self.opts.iallocator:
pnode = snode = None
import_log_msg = ("- Import instance %s from node %s (iallocator: %s)" %
(instance, enode, self.opts.iallocator))
elif self.opts.disk_template not in constants.DTS_NET_MIRROR:
snode = None
import_log_msg = ("- Import instance %s from node %s to node %s" %
(instance, enode, pnode))
else:
import_log_msg = ("- Import instance %s from node %s to nodes %s/%s" %
(instance, enode, pnode, snode))
exp_op = opcodes.OpExportInstance(instance_name=instance,
target_node=enode,
shutdown=True)
......@@ -313,7 +326,8 @@ class Burner(object):
wait_for_sync=True,
mac="auto",
file_storage_dir=None,
file_driver=None)
file_driver=None,
iallocator=self.opts.iallocator)
erem_op = opcodes.OpRemoveExport(instance_name=instance)
Log("- Export instance %s to node %s" % (instance, enode))
......@@ -321,8 +335,7 @@ class Burner(object):
Log("- Remove instance %s" % (instance))
self.ExecOp(rem_op)
self.to_rem.remove(instance)
Log("- Import instance %s from node %s to node %s" %
(instance, enode, pnode))
Log(import_log_msg)
self.ExecOp(imp_op)
Log("- Remove export of instance %s" % (instance))
self.ExecOp(erem_op)
......
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 to comment