When importing an instance with the same name as the exported one if the
mac address is "auto" we try to reuse the previous mac address. One can
still force generation of a new one with mac="generate".
Forward-port-of: r1887, Reviewed-by: iustinp
Reviewed-by: imsnah
'disk0_dump'))
self.src_image = diskimage
+ if self.op.mac == constants.VALUE_AUTO:
+ old_name = export_info.get(constants.INISECT_INS, 'name')
+ if self.op.instance_name == old_name:
+ # FIXME: adjust every nic, when we'll be able to create instances
+ # with more than one
+ if int(export_info.get(constants.INISECT_INS, 'nic_count')) >= 1:
+ self.op.mac = export_info.get(constants.INISECT_INS, 'nic_0_mac')
+
# ip ping checks (we use the same ip that was resolved in ExpandNames)
if self.op.start and not self.op.ip_check: