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

Support for Xenserver 7.1 #65

Closed gnanet closed 6 years ago

gnanet commented 7 years ago

Seems with version 7.1 there are some changes that break functionality:

Tried a simple if-else switch for the extracted file-name but the timeout which causes the uuid validation fail is too high for me to present with a solution.

gnanet commented 7 years ago

Just look at a simple example: XS71E001

The manual installation steps trough cli are:

Installing the update by using the xe Command Line Interface

this command part does not even exsist on 7.1

Alternatively, if you need to update and restart hosts in a rolling manner, you can apply the update file to an individual host by running the following:

xe upload-apply host-uuid= uuid=

If the update is successful, the hosts field contains the UUIDs of the hosts to which this patch was successfully applied. This should be a complete list of all hosts in the pool.

dalgibbard commented 7 years ago

Thanks for the info! I don't currently have any XenServer boxes kicking about to test with, but hopefully I'll be able to look at this at some point... Otherwise I'll happily accept patches 😄

gnanet commented 7 years ago

If i can find out how and why this error happened with the zeroed-middle-uuid i think i will be able to present some changeset, but i am not a python programmer, i only hack around in scripts and code :)

To get work done with the the patches i only used your script to list the D/L urls, and later i simply followed the docs, and i never seen any issue after patch-upload, the uuid response came asap, and update-apply worked too.

I still have to work with that server, so if i get to test my changes i send you the patches (or create the pull req)

dalgibbard commented 7 years ago

It may just be that the zero uuid is returned whilst waiting for all members of the pool to obtain the patch or something? It might be sufficient just to continually check the uuid until it doesn't return zeros (for a set timeout duration at least).

gnanet commented 7 years ago

I could imagine such a case, but this one is a single-server setup. I will secure the logs.

dalgibbard commented 7 years ago

Hey @gnanet - I've just merged @ssamson-tis changes into master; are you able to test if this meets your requirements?

gnanet commented 7 years ago

There are new patches to that version as i seen, i will see if i can arrange a maintenance with my customer soon

cjmny commented 7 years ago

Just tried it on a non critical 7.1 pool. Getting the following error:

Starting patching...

Downloading: XS71E008.zip Download Size: 2064793 Bytes Applying: XS71E0080%] Uncompressing... Failed to locate unzipped patchfile: XS71E008.xsupdate Trying with: XS71E008.iso Internal Upload... XE Error detected: You gave an invalid object reference. The object may have recently been deleted. The class parameter gives the type of reference given, and the handle parameter echoes the bad value given. class: SR handle: OpaqueRef:5af1b767-738a-4316-4260-1637f3bc61d7

Return code is: 1 New error detected, aborting

dalgibbard commented 7 years ago

@ssamson-tis any ideas?

ssamson-tis commented 7 years ago

Seems strange. Could you execute this command "xe patch-list" on XenServer and give the output here ?

And this : xe patch-pool-apply uuid=e3c382d7-0000-0000-9901-d0d15ee02ad9

cjmny commented 7 years ago

Sure thing: ` #xe patch-list uuid ( RO) : 008f1b43-0000-0000-8475-28f15dbfd1fc name-label ( RO): XS71E006 name-description ( RO): Public Availability: Security fixes to Xen size ( RO): 2447023 hosts (SRO): 59e423e8-f741-4d2e-97a8-9ec95bb7fa82, 0416c5b3-b4f2-4b8c-94be-c09a1a30e65e, 94145214-254a-465e-adc1-0e23c8936fcd after-apply-guidance (SRO): restartHost

uuid ( RO) : d2df0c4f-0000-0000-a754-19a8b7739b5c name-label ( RO): XS71E005 name-description ( RO): Public Availability: Security fixes to Xen Device Model size ( RO): 1418580 hosts (SRO): 94145214-254a-465e-adc1-0e23c8936fcd, 59e423e8-f741-4d2e-97a8-9ec95bb7fa82, 0416c5b3-b4f2-4b8c-94be-c09a1a30e65e after-apply-guidance (SRO):

uuid ( RO) : 04bcb1f7-0000-0000-9cac-9d2a87746b24 name-label ( RO): XS71E007 name-description ( RO): Public Availability: Security fixes to Xen size ( RO): 2457822 hosts (SRO): 0416c5b3-b4f2-4b8c-94be-c09a1a30e65e, 94145214-254a-465e-adc1-0e23c8936fcd, 59e423e8-f741-4d2e-97a8-9ec95bb7fa82 after-apply-guidance (SRO): restartHost

uuid ( RO) : a4ebb0e4-0000-0000-8b42-4673d3111d29 name-label ( RO): XS71E004 name-description ( RO): Public Availability: fixes to Toolstack size ( RO): 79057963 hosts (SRO): 0416c5b3-b4f2-4b8c-94be-c09a1a30e65e, 94145214-254a-465e-adc1-0e23c8936fcd, 59e423e8-f741-4d2e-97a8-9ec95bb7fa82 after-apply-guidance (SRO): restartXAPI

uuid ( RO) : b80ea320-0000-0000-a14d-781861b5c0ac name-label ( RO): XS71E003 name-description ( RO): Public Availability: fixes to Storage size ( RO): 2388513 hosts (SRO): 94145214-254a-465e-adc1-0e23c8936fcd, 59e423e8-f741-4d2e-97a8-9ec95bb7fa82, 0416c5b3-b4f2-4b8c-94be-c09a1a30e65e after-apply-guidance (SRO):

uuid ( RO) : fc438a32-0000-0000-8676-9feb121c6997 name-label ( RO): XS71E001 name-description ( RO): Public Availability: fixes to XenCenter size ( RO): 57559040 hosts (SRO): 0416c5b3-b4f2-4b8c-94be-c09a1a30e65e, 94145214-254a-465e-adc1-0e23c8936fcd, 59e423e8-f741-4d2e-97a8-9ec95bb7fa82 after-apply-guidance (SRO): `

And # xe patch-pool-apply uuid=e3c382d7-0000-0000-9901-d0d15ee02ad9 The uuid you supplied was invalid. type: pool_patch uuid: e3c382d7-0000-0000-9901-d0d15ee02ad9

ssamson-tis commented 7 years ago

So, there is a error when you upload XS71E008.zip. Can you execute again patcher.py ? Before that, delete all files .iso .zip.

If the script failed, execute "xe patch-upload file-name=XS71E008.iso" and give the output. Do you have some VM with an iso connected ?

dalgibbard commented 7 years ago

Just a quick note to say I've been working on this today; essentially the original patch-xxxxx commands (eg patch-upload) have been replaced with update-xxxxx commands (eg. update-upload

The old patch-list command returns UUIDs with zeros in the 2nd and 3rd segments; whereas upload-list returns the true, original UUIDs. Should have something for this shortly.

dalgibbard commented 7 years ago

Commit 968c9cf brings full (and tested) XenServer 7.1+ support using the citrix documented arguments for the XE cli. I haven't tested it against a pool however, so please check and report back how this is working for you :) Still seems odd to me that they'd introduce a new command-set with a minor revision update though ... they probably should have pushed these breaking changes into 7.0 😉

dalgibbard commented 7 years ago

Closing this as I'm pretty sure it's fixed, but radio silence :)

cjmny commented 7 years ago

Sorry, I have some sort of stuck SR on this pool that is creating issues. You're right though, it probably is fixed.

cjmny commented 6 years ago

This may need to be reopened. I just put three brand new 7.1 machines in place in a new pool. No VM's installed yet. The updater seems to hang on "Internal Upload".

dalgibbard commented 6 years ago

Re-opened for further testing

dalgibbard commented 6 years ago

Downloaded a fresh 7.1.0 ISO, installed into virtualbox, pulled the patcher.py and ran without any args - runs with no issue.

working

Any more information on the issue? Any steps to reproduce?

cjmny commented 6 years ago

Are you able to create a pool and try the pool patching mode? That seems to be where the problem occurs.

dalgibbard commented 6 years ago

Oh I see; I probably can do this in the future; but unlikely to be this week at least :) Are you able to try manually uploading and/or checking the patching documentation to see if there's any differences between patching a pool and patching a single host? Are you patching from the Pool Master right?

cjmny commented 6 years ago

I was trying to patch from the master. I just ended up patching them manually so I could join them to an existing pool and use them. I do have other recently decommissioned hardware that I can set up as a test pool at some point. I will check out the documentation when I have some time and report back.

dalgibbard commented 6 years ago

Appreciate your feedback @cjmny - i'll let you know if I make any headway on my end also :)

dalgibbard commented 6 years ago

@cjmny couldn't switch off this evening so had a look LOL

created three VMs on 7.1.0 (bridge networking, all same subnet - no firewalls involved), and linked all into a pool. Ran patcher.py -p on the master, all processes completed successfully, patches show as installed on other nodes (and I watched the progress too).

Might I suggest:

cjmny commented 6 years ago

Wow, committed :) I will look into it! Thank you!

dalgibbard commented 6 years ago

Will close for now, but will continue to watch, so update if any issue :)