derekjhyang / xenserver_to_xen

Migrate your Xenserver image from *.xva to *.img or *.qcow2
22 stars 16 forks source link

Cannot convert xva file #1

Open mfechner opened 10 years ago

mfechner commented 10 years ago

I just create a xva file from a xenserver 6.2 untared it and execute:

python2 xenmigrate_new.py  -c Ref\:32/ test.img

Bit I get the error message:

xenmigrate 0.7.4 -- 2011.09.13
(c)2011 Jolokia Networks and Mark Pace -- jolokianetworks.com

convert ref dir   : Ref:32/
to raw file       : test.img
last file         : 40986
disk image size   : 40 GB

RW notification every: 1.0GB
Converting:
Traceback (most recent call last):
  File "xenmigrate_new.py", line 508, in <module>
    reftoraw(opts.convert,args[0],opts.gz)
  File "xenmigrate_new.py", line 358, in reftoraw
    source.close()
UnboundLocalError: local variable 'source' referenced before assignment
m34nbunny commented 9 years ago

I know this is old; however for anyone wanting to fix it, search the file and replace every instance that is within a

finally: try: source.close()

replace with

finally: try: """source.close()"""

Not a permanent solution but it will start converting the file.

derekjhyang commented 6 years ago

@meanbunny , thank you for your comment. I know that is old but I can work in Xenserver 5.5

javax-sousa commented 4 years ago

I modified it according to the suggestion above, but it still didn't work: error log: enmigrate 0.7.4 -- 2011.09.13 (c)2011 Jolokia Networks and Mark Pace -- jolokianetworks.com

convert ref dir : Ref:26 to raw file : disk.img last file : 51200 disk image size : 50 GB

RW notification every: 1.0GB Converting: Traceback (most recent call last): File "xenmigrate.py", line 507, in reftoraw(opts.convert,args[0],opts.gz) File "xenmigrate.py", line 357, in reftoraw source.close() UnboundLocalError: local variable 'source' referenced before assignment