fix wrong network label
This commit is contained in:
parent
2853903232
commit
5e20cfffcc
@ -92,6 +92,13 @@ class copy_vm_xcp(backup_generic):
|
|||||||
except IndexError,error:
|
except IndexError,error:
|
||||||
result = (1,"error get VM opaqueref %s"%(error))
|
result = (1,"error get VM opaqueref %s"%(error))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
# get vm backup network opaqueRef
|
||||||
|
try:
|
||||||
|
networkRef = session.xenapi.network.get_by_name_label(self.network_name)[0]
|
||||||
|
except IndexError, error:
|
||||||
|
result = (1, "error get VM network opaqueref %s" % (error))
|
||||||
|
return result
|
||||||
|
|
||||||
if str2bool(self.halt_vm):
|
if str2bool(self.halt_vm):
|
||||||
status_vm = session.xenapi.VM.get_power_state(vm)
|
status_vm = session.xenapi.VM.get_power_state(vm)
|
||||||
@ -185,7 +192,6 @@ class copy_vm_xcp(backup_generic):
|
|||||||
for i in vifDestroy:
|
for i in vifDestroy:
|
||||||
vifRecord = session.xenapi.VIF.get_record(i)
|
vifRecord = session.xenapi.VIF.get_record(i)
|
||||||
session.xenapi.VIF.destroy(i)
|
session.xenapi.VIF.destroy(i)
|
||||||
networkRef = session.xenapi.network.get_by_name_label(self.network_name)[0]
|
|
||||||
data = {'MAC': vifRecord['MAC'],
|
data = {'MAC': vifRecord['MAC'],
|
||||||
'MAC_autogenerated': False,
|
'MAC_autogenerated': False,
|
||||||
'MTU': vifRecord['MTU'],
|
'MTU': vifRecord['MTU'],
|
||||||
|
Loading…
Reference in New Issue
Block a user