dalgibbard / citrix_xenserver_patcher

Auto / Manual Patching tool for Citrix XenServer Boxes
Do What The F*ck You Want To Public License
142 stars 45 forks source link

Tested with 6.0.2? #11

Closed AndersJonsson1 closed 9 years ago

AndersJonsson1 commented 10 years ago

I am a complete noob, w/Xenserver as well as Linux in general, so apologies in advance for any particularly dense comments I might make. :)

In any case, fresh base install of Xenserver 6.0.2, to an old IBM iDataplex dx340, seemingly fully successful (can connect via XenCenter to it, access console remotely, as well the wget cmds to grab the script work fine, albeit requiring the SSL-related '--no-check-certificate' switch to successfully download, however after running patcher.py, after being apparently successful getting the list of patches, and then downloading them locally, it then errors out like so:

Would you like to install these items? [y/n]: y Starting patching... Downloading: XS602E005.zip Download Size: 113841584 Bytes 113841584 [100.00%] Applying: XS602E005 Uncompressing... Internal Upload... Patch internal upload failed for: XS602E005.xsupdate

You will note the above is referencing patch 5, after the first time it failed in the same way I learned a bit of VI (I know, hah...welcome to Linux ;) so I could edit up an exclusions file to tell it to not do either patch 3 or 4 (I had some thought maybe those patches were already included in a base 6.0.2 install) and although that successfully prevented the script from grabbing those patches...it then promptly failed in the same way when grabbing the next patch 5.

Its prob something dumb I am doing to cause this...if I knew where to look in Xenserver for logs of this, I would do so. Too new at the moment to know where those might be located.

Anyway, just was wondering whether this was definitely tested against 6.0.2, or not.

p.s., I have 2 iDataplex servers and a lot of time on my hands...if you need some grunt work to install/reinstall/test anything just let me know...happy to do it. (earn my keep, so to speak...)

Thanks! Andy

bugbytetechnology commented 10 years ago

I've just installed a new XenServer 6.2 and found I was having the same problem using the script. My Linux skills are novice, at best, so apologies in advance if I'm not using the correct terminology here, or not going about fixing this in the correct way. However, the following did work for me.

I found that when the patch is uploaded, but not yet installed the hostname is blank (which can be seen by doing a "xe patch-list" command). However, the validation within patcher.py to check if the patch has uploaded includes a hostname guid when calling patch-list and this is why is failing.

I replaced line 237 of patcher.py with the following, which has resolved it for me:

patch_upload_verify_cmd = str(xecli) + str(' patch-list params=uuid uuid=') + str(uuid) + str(" --minimal"
dalgibbard commented 10 years ago

Hi all, firstly, I apologise for the delay in providing an update here- I'm very much under fire at the moment, and working on multiple other projects, even in my own time :frowning:

A very kind person has sent me a mail (who shall remain annonymous unless they see this and want their name 'out there') with a some debug and suggestion into this issue:

When I launch that on different 6.2 XenServer version It always return:
Patch internal upload failed for: XS62ESP1.xsupdate

I've also tried on 6.1 XenServer and the same error, of course with different Hotfix number.

I've done some debug, the problem is on this line:
    if not ( patch_upload_uuid != None and patch_upload_uuid == uuid ):

These are the content of the variables:

    print(patch_upload_uuid)  2 line result:
1)  uuid: 0850b186-4d47-11e3-a720-001b2151a503
2)
print(uuid) 1 line result
1)  0850b186-4d47-11e3-a720-001b2151a503

Looks like an additional blank line, plus potentially a change in variable formatting (the addition of 'uuid:') is causing issues here. I don't have time to look at it immediately though- but hopefully i'll get this done soon, or someone can feel free to beat me to it :smile:

dalgibbard commented 9 years ago

This should have been fixed by @mf 's recent commit. Please test and confirm. If not; the output should be slightly more verbose now anyway.

bugbytetechnology commented 9 years ago

I can confirm this is working for me now, although it didn't straight away, but the verbose output helped me track down the actual problem for my install. It looks like it wasn't working for me previously because of a mismatch of hostnames.

I found that the hostname listed in /etc/sysconfig/network was different from the one in /etc/hosts and that was different again from the one displayed when issuing a xe host-list command. The patcher.py script appears to compare the /etc/hosts hostname with the output from xe host-list command so the differences there on my system was almost certainly the problem.

Many thanks for fixing this! :-)

dalgibbard commented 9 years ago

I've taken it one step further and amended the code to use /etc/sysconfig/network - as that is the ultimate source of truth it would seem!

Thanks for providing the prompt feedback, i'll get this one closed off :)