NAUbackup / VmBackup

XenServer simple backup script
228 stars 61 forks source link

NameError: global name 'xvda_uuid' is not defined #65

Closed 0sorkon closed 6 years ago

0sorkon commented 6 years ago

[root@xen-hp380g8-a NAUbackup]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: XenServer Description: XenServer release 7.2.0 (xenenterprise) Release: 7.2.0 Codename: xenenterprise

[root@xen-hp380g8-a NAUbackup]# grep -v "#" ./vdi-backup.cfg max_backups=3 backup_dir=/mnt/backup/nfs/Xen_backup/vdi vdi_export_format=vhd vdi-export=ceph.admin

[root@xen-hp380g8-a NAUbackup]# VmBackup.py ./passwd.file ./vdi-backup.cfg ... 2018-02-01-(17:12:11) - vbd: OpaqueRef:89be6584-318a-9a3a-de6d-d15bd1e78e91 2018-02-01-(17:12:11) - disk: 1 - begin 2018-02-01-(17:12:11) - vbd: OpaqueRef:42d033a2-d766-5767-212d-51a8af5809b1 2018-02-01-(17:12:11) - Writing VIF info 2018-02-01-(17:12:11) - Writing VIF: 0 global name 'xvda_uuid' is not defined 2018-02-01-(17:12:11) - ERROR EXCEPTION - <type 'exceptions.NameError'> 2018-02-01-(17:12:11) - ERROR NOTE: see VmBackup output for details Traceback (most recent call last): File "/mnt/backup/nfs/Xen_backup/NAUbackup/VmBackup.py", line 1491, in main(session) File "/mnt/backup/nfs/Xen_backup/NAUbackup/VmBackup.py", line 177, in main if xvda_uuid == '': NameError: global name 'xvda_uuid' is not defined

NAUbackup commented 6 years ago

Thank you for reporting this -- will take a look. Which VMbackup release version exactly are you running?

0sorkon commented 6 years ago

latest from github v3.22 2017/11/11. on 3.21 september 2017 everything working well.

NAUbackup commented 6 years ago

Might be due to a change in a library definition. That it worked on 3.21 and not on 3.22 is very helpful to know, thank you.

NAUbackup commented 6 years ago

I think the issue is that the global variables xvda_uuid and xvda_name_label are still needed under certain circumstances, but were commented out when going from 3.21 to 3.22:

# global xvda_uuid # global xvda_name_label

should be:

global xvda_uuid
global xvda_name_label

Please try to remove the "#" from the lines from VmBackup.py where those two variables are commented out and see if the script then runs correctly.

--Tobias

0sorkon commented 6 years ago

yes, after uncommenting line 560,561 global xvda_uuid global xvda_name_label it seems working, thank you

NAUbackup commented 6 years ago

OK, good, thank you. I will make that correction as well as a couple of other minor adjustments and get a new release out in the near future. Glad it's working for you again! --Tobias