-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VmBackup.py: script doesn't work for me. Could You help, please #59
Comments
Try changing |
Now get this: Traceback (most recent call last): |
Where did you get your version of XenAPI.py from? Can you try again with the XS 7.2 SDK version (They are backwards compatible) from https://www.citrix.com/downloads/xenserver/product-software/xenserver-72-standard-edition.html |
Now use XenAPI.py from XS 7.2 SDK and get: [root@Xen03 NAUbackup]# ./VmBackup.py XXXXXXXXXX OTRS preview If delete ignore_ssl=True from VmBackup.py, get at the end: Traceback (most recent call last): |
ok well I'm fairly certain that the ignore_ssl=True part is needed to fix your original error (see xapi-project/xen-api#2100). From looking in XenAPI.py on line 136 we are calling the xmlrpclib. If that is not expecting the context argument then I imagine you are not using the correct version. Looking at the xmlrpclib package page (https://docs.python.org/2/library/xmlrpclib.html) it looks like the context parameter was added in version 2.7.9 ("Changed in version 2.7.9: Added the context argument") so you will need to update to at least this version. |
Ok. Will try to downgrade Python to 2.7.9 version. At now use Python 2.7.13. |
Thanks for your help on this, @thomasmck ... I will try to take a look soon to see what version of XenApi.py and python I am running for comparison. Appreciate the feedback. I'm still on 7.1 and tests on 7.2 provide valuable insights. |
So it actually works if you overwrite ssl settings before making the call, like this
3rd line is my session code, yours will be different. |
change line 1456 https://github.com/NAUbackup/VmBackup/blob/master/VmBackup.py#L1456 session = XenAPI.Session('https://localhost/') to session = XenAPI.Session('http://localhost/') |
@gfiasco Thanks for this change, it worked for me. No issues with XenServer 7.6 but Version 8.0 that was just released threw this error: May need to add code to check version and switch from https to http or someone likely much smarter can advise a solution. |
I just released V3.24 and would be interested if this error still occurs. Thanks! If so, let me know and I can maybe catch the error and do a retry with http instead of https. Perhaps better, I could report this to Citrix as a bug. |
Hello! Faced same issue today with Xen Server 8 and latest NAUbackup+XenAPI.py Error messages before workaround: Regards |
Sorry to hear that. I will take a look, perhaps create a fallback if https fails to then try http. |
Does importing also the ssl module near the top and changing the code to read
still not work? Seems to at least under XS 7.X. |
Hi
Added this line to VmBackup.py and got same error, so returned to http
protocol
…On Wed, 26 Jun 2019 at 22:43, NAUbackup ***@***.***> wrote:
Does including ssl near the top and changing the code to read
ignore_ssl=True
session = XenAPI.Session('https://localhost/')
still not work?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#59?email_source=notifications&email_token=AINTJEMIQGNLIKWETDCC72LP4PBFFA5CNFSM4ED3JD72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYUTPWI#issuecomment-506017753>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AINTJELLPAIPVRH7US2IWELP4PBFFANCNFSM4ED3JD7Q>
.
|
i have the same error too, i started to try the scripts yesterday on the citrix 8.0, only works with http protocol |
Try substituting that call with the following expanded code:
|
i'm sorry but what lines should I replace? |
Put that in place of the lines: try: Also, make sure you add ", ssl" to the line import sys, time, os, datetime, subprocess, re, shutil, XenAPI, smtplib, re, base64, socket, threading so that it reads: |
Hi Tried extended code, still same error Regards, |
Thank you, Alex, for the feedback. It runs fine as such under 7.1. I will take another look. I really need to get an instance up and running on my 8.0 test pool. I'd have done so sooner except I have to get the NFS networking sorted out. |
If you would like I have 8.0 fully patched on a box, with a tiny VM that backs up in a few seconds, mounted to NFS that I can IP Gate to your IP via SSH. Happy to let you play with the script on this as some small way of saying thank-you for all the efforts... Not a problem if you would like let me know. |
Thank you, Dan, I will keep that in mind if I cannot get something rigged up here soon. Your offer is much appreciated! |
Hi! Could someone help, please? What's wrong? Script doesn't work for me. No complite backup, no log in file.
Xenserver 7.0
VmBackup.py 3.22
Python 2.7.13
[root@Xen03 NAUbackup]# ./VmBackup.py XXXXXXXXXX OTRS preview
2017-11-15-(14:54:26) - VmBackup config loaded from: OTRS
2017-11-15-(14:54:26) - VmBackup.py running with these settings:
2017-11-15-(14:54:26) - backup_dir = /snapshots/BACKUPS
2017-11-15-(14:54:26) - status_log = /snapshots/NAUbackup/status.log
2017-11-15-(14:54:26) - compress = False
2017-11-15-(14:54:26) - max_backups = 2
2017-11-15-(14:54:26) - vdi_export_format = raw
2017-11-15-(14:54:26) - pool_db_backup = 0
2017-11-15-(14:54:26) - exclude (cnt)= 0
2017-11-15-(14:54:26) - exclude:
2017-11-15-(14:54:26) - vdi-export (cnt)= 0
2017-11-15-(14:54:26) - vdi-export:
2017-11-15-(14:54:26) - vm-export (cnt)= 1
2017-11-15-(14:54:26) - vm-export: OTRS
Traceback (most recent call last):
File "./VmBackup.py", line 1453, in
session.xenapi.login_with_password(username, password)
File "/snapshots/NAUbackup/XenAPI.py", line 248, in call
return self.__send(self.__name, args)
File "/snapshots/NAUbackup/XenAPI.py", line 141, in xenapi_request
self._login(methodname, params)
File "/snapshots/NAUbackup/XenAPI.py", line 165, in _login
result = _parse_result(getattr(self, 'session.%s' % method)(*params))
File "/usr/lib64/python2.7/xmlrpclib.py", line 1233, in call
return self.__send(self.__name, args)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1587, in __request
verbose=self.__verbose
File "/usr/lib64/python2.7/xmlrpclib.py", line 1273, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1301, in single_request
self.send_content(h, request_body)
File "/usr/lib64/python2.7/xmlrpclib.py", line 1448, in send_content
connection.endheaders(request_body)
File "/usr/lib64/python2.7/httplib.py", line 1013, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 864, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 826, in send
self.connect()
File "/usr/lib64/python2.7/httplib.py", line 1236, in connect
server_hostname=sni_hostname)
File "/usr/lib64/python2.7/ssl.py", line 350, in wrap_socket
_context=self)
File "/usr/lib64/python2.7/ssl.py", line 611, in init
self.do_handshake()
File "/usr/lib64/python2.7/ssl.py", line 833, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
[root@Xen03 NAUbackup]#
The text was updated successfully, but these errors were encountered: