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

Already applied patches (checking) #6

Closed lucaspr closed 9 years ago

lucaspr commented 10 years ago

I installed all patches already using the command line, but when I run patcher.py it tells me to install patches (6.2 SP1 is the latest I believe).

Is the script checking already installed patches?

I must tell you I only installed SP1, which included all previous patches according to Citrix...

dsiminiuk commented 10 years ago

Yes, I get the same behavior. It lists all patches from the source even though I have already installed them manually. It apparently isn't ignoring already installed patches.

dalgibbard commented 10 years ago

I'll review this when I'm back in the office :) might take a little while though as I don't have any 6.2 sp1 installs available just yet...

Bare with me :) On 28 Dec 2013 19:11, "Daniel Siminiuk" notifications@github.com wrote:

Yes, I get the same behavior. It lists all patches from the source even though I have already installed them manually. It apparently isn't ignoring already installed patches.

— Reply to this email directly or view it on GitHubhttps://github.com/dalgibbard/citrix_xenserver_patcher/issues/6#issuecomment-31302759 .

dalgibbard commented 10 years ago

OK So, according to http://support.citrix.com/article/CTX139788 - XS62E001 - 005 and XS62E009 - 012 are provided by XS62ESP1.

Bit of a pain really, as in the past they've tended to release these kinds of things as a Minor revision increases - ie. 6.2.0 -> 6.2.1 (meaning subsequent patches get their own version naming... meaning my script wouldn't break! ).

I'll look into adding a static exception for now (ie. if XS62ESP1 is installed, then exclude 01-12.) - It's not the best solution from the point of "dynamicness" (or cleanliness) but it's all i can really think of for now!

dsiminiuk commented 10 years ago

For me personally, I don't expect this tool to track what patches are rolled up inside a service pack. Hell, the XenCenter application can't even do that. It lists all the individual patches with the service pack at the same time.

And I am already current and have installed all of them to date, so what I really need from a practical perspective is a way to not install anything I have already applied. Can you make the script just prompt me for each patch/hotfix and if I say it is already installed save that name/number to a local text file for future exclusion? Then check that file at runtime and never ask about those particular ones again? As well, if the local file is simple text file, I can edit and add patches to be excluded for whatever reason (bad results or applied manually).

Thanks!

dalgibbard commented 10 years ago

Sounds both reasonable, and fairly simple too. Then maybe I could bundle a pre-compiled list for XS6.2 SP1 users as a workaround instead. On 30 Dec 2013 14:26, "Daniel Siminiuk" notifications@github.com wrote:

For me personally, I don't expect this tool to track what patches are rolled up inside a service pack. Hell, the XenCenter application can't even do that. It lists all the individual patches with the service pack at the same time.

And I am already current and have installed all of them to date, so what I really need from a practical perspective is a way to not install anything I have already applied. Can you make the script just prompt me for each patch/hotfix and if I say it is already installed save that name/number to a local text file for future exclusion? Then check that file at runtime and never ask about those particular ones again? As well, if the local file is simple text file, I can edit and add patches to be excluded for whatever reason (bad results or applied manually).

Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/dalgibbard/citrix_xenserver_patcher/issues/6#issuecomment-31347704 .

dsiminiuk commented 10 years ago

The pre-compiled idea sounds great.

Expanding on that just slightly, if you can determine the current version of the server (6.1 vs 6.2 for example) you might be able to filter the hotfixes by version XS61* vs XS62*, and maybe you are already do so in the server query, in which case I'm talking out my butt, it happens. :)

mans-larsson commented 10 years ago

I newly deployed this script - it'sbrilliant! Worked a 100-times better the Citrix own update mechanism. And, by just listening at these ideas makes me feel more confident I did the right thing trying out this script. Many thanks for the good work!

dalgibbard commented 10 years ago

@dsiminiuk - the script does already differentiate between versions (else you'd end up applying 5.x and 6.1 etc patches to 6.2 instances! Bad) - the difficulty occurs when Citrix decide to bundle a new release, with a load of fixes, and don't increase the minor revision (ie. XS621E001 for example). I'll hopefully get a chance to sort this later this week anyway.

If anyone fancies a go at Python in the meantime, feel free to fork it and have a play :D

@mans71 - thanks for the feedback! Glad its helping people out :)

Darren.

dalgibbard commented 10 years ago

This should be resolved as of: fbb15f65ec4f179fe8d4d5a6b723e96649514630

I've updated the readme with more info, bust basically i've added several options, and have also uploaded an example exclusion script- so for XenServer 6.2:

# Grab updated patcher.py:
wget -O patcher.py https://raw.github.com/dalgibbard/citrix_xenserver_patcher/master/patcher.py
chmod +x patcher.py

# Grab the exclusions file:
wget -O XS62_exclusions.py https://raw.github.com/dalgibbard/citrix_xenserver_patcher/master/XS62_exclusions.py

# Ask the patcher to display patches- excluding one's listed in the exclusions file,
# but don't apply any- just list them:
./patcher.py -e ./XS62_exclusions.py -l

# Run the patcher, exclude from list, automatically install *without* prompting,
# and *reboot automatically* on completion [[ CAUTION! :-) ]]
./patcher.py -e ./XS62_exclusions.py -a -r

# Display usage info:
./patcher.py -h

I've tested it here to the best of my ability with the systems I have available, and it seems good. If someone else would be so kind as to verify it, then i'll get this issue closed off :-)

dsiminiuk commented 10 years ago

Running

./patcher.py -e ./XS62_exclusions.py -l

Told me that SP1 needed to be installed so I added XS62ESP1 to the XS62_exclusions.py file because I'd already done that.

Would you be able to create the exclusions file dynamically at runtime from the list of already installed patches?

[root@xenserver ~]# xe patch-list | awk -F: '$1~/name-label/ {print $2}' | sort XS62E001 XS62E002 XS62E004 XS62E005 XS62E007 XS62E008 XS62E009 XS62E010 XS62E011 XS62E012 XS62E013 XS62ESP1

... so that these can be ignored. (Notice XS62ESP1 is also in there).

The exclusions file is a great step forward though, even if I have to edit it manually.

Thanks!

dalgibbard commented 10 years ago

It shouldn't need to add it progressively, as they get added to the installed list within xenserver anyway. I overlooked the fact that SP1 actually contains SP1... :D

For non-SP1 hosts, the contained exclusions list is correct- but SP1 nodes will require this addition.

Out of interest, where did you obtain SP1? Do you have an iso of it? The citrix page still appears to offer me the non-SP1 version by the looks of it? On 7 Jan 2014 15:27, "Daniel Siminiuk" notifications@github.com wrote:

I added XS62ESP1 to the XS62_exclusions.py file otherwise it will try to install it and I already had done so.

If it succeeds in installing a patch does it add that patch automatically to the XS62_exclusions.py file?

I would think that you should be able to create the exclusions file automatically from the patches that are already installed so that you only list any new ones.

This is a great step forward.

Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/dalgibbard/citrix_xenserver_patcher/issues/6#issuecomment-31746585 .

dsiminiuk commented 10 years ago

XS62ESP1 was an update listed in the XenCenter Available Updates panel just like any other update. I did the usual right click to open the web page like I would for any other, then applied it because it was listed.

You would think that if I had already installed all the components which make up SP1 that XenCenter would not list it as a separate item. But it did, so I did it.

I don't have the download zipped package but I do have the XS62ESP1.xsupdate file here. I could get it to you via dropbox if you want it.

Found it... http://support.citrix.com/article/CTX139788

dalgibbard commented 10 years ago

What I don't understand is that if SP1 was installed, why it wasn't picked up by the code when validating installed patches... Most odd. An output of xe patch-list (I think that's right) would be useful if you have it? On 7 Jan 2014 16:53, "Daniel Siminiuk" notifications@github.com wrote:

XS62ESP1 was an update listed in the XenCenter Available Updates panel just like any other update. I did the usual right click to open the web page like I would for any other, then applied it because it was listed.

You would think that if I had already installed all the components which make up SP1 that XenCenter would not list it as a separate item. But it did, so I did it.

— Reply to this email directly or view it on GitHubhttps://github.com/dalgibbard/citrix_xenserver_patcher/issues/6#issuecomment-31755267 .

dsiminiuk commented 10 years ago

Pasting the output here doesn't preserve the spacing properly so I pasted it into a text file and you can get it here.

https://dl.dropboxusercontent.com/u/3222301/xe%20patch-list.txt

dalgibbard commented 10 years ago

Ahh I think I see the issue here; I've not tested against pools. You have two hosts listed as having these patches installed, so my code is likely failing to correctly identify the local node vs the list of hosts which have it installed. I'll look into sorting this, might take a few days though as I have a lot on my plate this week :)

PS. You can post (and preserve) code to github by wrapping it in triple backticks :)

uuid ( RO)                    : ff202d2d-2812-4c6b-b500-2f4701de7bc4
              name-label ( RO): XS62E011
        name-description ( RO): Public Availability: Storage and ISCSI fixes
                    size ( RO): 845698
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e,
e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 59128f15-92cd-4dd9-8fbe-a0115d1b07a2
              name-label ( RO): XS62E002
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1743501
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 83bca9f6-4ae5-45f9-9426-440216f73797
              name-label ( RO): XS62E010
        name-description ( RO): Public Availability: Fix for GPU pass
through
                    size ( RO): 252927
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO):

uuid ( RO)                    : 8b0518d8-3610-4b7f-8a31-0e02718d2f9f
              name-label ( RO): XS62E013
        name-description ( RO): Limited Availability: Toolstack fixes
                    size ( RO): 0
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : d9c753b9-a15b-4a31-897b-97fdae609031
              name-label ( RO): XS62E009
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1744205
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 0850b186-4d47-11e3-a720-001b2151a503
              name-label ( RO): XS62ESP1
        name-description ( RO): Public Availability: XenServer 6.2 Service
Pack 1 (SP1)
                    size ( RO): 218600009
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e,
e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 7d5a3a2f-e163-4f23-b8f7-929961eeeb2e
              name-label ( RO): XS62E008
        name-description ( RO): XenTools fixes
                    size ( RO): 0
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e,
e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : 1e11bede-e41f-402e-879b-1210fa779a68
              name-label ( RO): XS62E007
        name-description ( RO): ioemu fixes for Windows 8.1
                    size ( RO): 0
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 5579f1f0-ff83-11e2-b778-0800200c9a66
              name-label ( RO): XS62E004
        name-description ( RO): Public Availability: Fixes for Dom0 kernel
issues
                    size ( RO): 35766769
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : aeff92a9-2c60-43eb-b34e-14e4132b411c
              name-label ( RO): XS62E005
        name-description ( RO): Public Availability: Toolstack fixes
                    size ( RO): 9315631
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e,
e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : a4251789-ce6c-4726-942c-3cddbadcaca6
              name-label ( RO): XS62E012
        name-description ( RO): Public Availability: Fixes for Dom0 kernel
issues
                    size ( RO): 35767767
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : dedcc0dd-d8f3-4f76-90ca-92697c7a44f0
              name-label ( RO): XS62E001
        name-description ( RO): Public Availability: Xapi fixes
                    size ( RO): 6625641
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d,
b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartXAPI

Hopefully the above displays OK... On 7 Jan 2014 17:26, "Daniel Siminiuk" notifications@github.com wrote:

Pasting the output here doesn't preserve the spacing properly so I pasted it into a text file and you can get it here.

https://dl.dropboxusercontent.com/u/3222301/xe%20patch-list.txt

— Reply to this email directly or view it on GitHubhttps://github.com/dalgibbard/citrix_xenserver_patcher/issues/6#issuecomment-31758449 .

dalgibbard commented 10 years ago

Yeah that didn't work sigh...

uuid ( RO)                    : ff202d2d-2812-4c6b-b500-2f4701de7bc4
              name-label ( RO): XS62E011
        name-description ( RO): Public Availability: Storage and ISCSI fixes
                    size ( RO): 845698
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 59128f15-92cd-4dd9-8fbe-a0115d1b07a2
              name-label ( RO): XS62E002
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1743501
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 83bca9f6-4ae5-45f9-9426-440216f73797
              name-label ( RO): XS62E010
        name-description ( RO): Public Availability: Fix for GPU pass through
                    size ( RO): 252927
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO):

uuid ( RO)                    : 8b0518d8-3610-4b7f-8a31-0e02718d2f9f
              name-label ( RO): XS62E013
        name-description ( RO): Limited Availability: Toolstack fixes
                    size ( RO): 0
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : d9c753b9-a15b-4a31-897b-97fdae609031
              name-label ( RO): XS62E009
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1744205
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 0850b186-4d47-11e3-a720-001b2151a503
              name-label ( RO): XS62ESP1
        name-description ( RO): Public Availability: XenServer 6.2 Service Pack 1 (SP1)
                    size ( RO): 218600009
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 7d5a3a2f-e163-4f23-b8f7-929961eeeb2e
              name-label ( RO): XS62E008
        name-description ( RO): XenTools fixes
                    size ( RO): 0
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : 1e11bede-e41f-402e-879b-1210fa779a68
              name-label ( RO): XS62E007
        name-description ( RO): ioemu fixes for Windows 8.1
                    size ( RO): 0
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 5579f1f0-ff83-11e2-b778-0800200c9a66
              name-label ( RO): XS62E004
        name-description ( RO): Public Availability: Fixes for Dom0 kernel issues
                    size ( RO): 35766769
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : aeff92a9-2c60-43eb-b34e-14e4132b411c
              name-label ( RO): XS62E005
        name-description ( RO): Public Availability: Toolstack fixes
                    size ( RO): 9315631
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : a4251789-ce6c-4726-942c-3cddbadcaca6
              name-label ( RO): XS62E012
        name-description ( RO): Public Availability: Fixes for Dom0 kernel issues
                    size ( RO): 35767767
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : dedcc0dd-d8f3-4f76-90ca-92697c7a44f0
              name-label ( RO): XS62E001
        name-description ( RO): Public Availability: Xapi fixes
                    size ( RO): 6625641
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartXAPI
dalgibbard commented 10 years ago

OK, so, although much delayed (sorry!) i've made some minor changes to the code which should stop patcher.py from building the patch list against details from other pool members.

I don't have a pool to hand that I can test on, so if someone could validate this for me it would be much appreciated!

Changes are in commit ca88e173f0721be88101db6efcf1e3e9d902bb9f and is merged into master branch.

dsiminiuk commented 10 years ago

Hi Darren,

I ran it just now and got this

No local Patches are installed. The following Patches are pending installation:

uuid: 0850b186-4d47-11e3-a720-001b2151a503 url: http://support.citrix.com/article/CTX139788 timestamp: 2013-12-16T00:00:00Z name_label: XS62ESP1 patch_url: http://downloadns.citrix.com.edgesuite.net/8707/XS62ESP1.zip after_apply_guidance: restartHost name_description: Public Availability: XenServer 6.2 Service Pack 1 (SP1)

uuid: 297f2f77-5603-4aaf-9e56-db49512d4592 url: http://support.citrix.com/article/CTX140051 timestamp: 2014-01-22T00:00:00Z name_label: XS62ESP1002 patch_url: http://downloadns.citrix.com.edgesuite.net/8737/XS62ESP1002.zip after_apply_guidance: restartHost name_description: Public Availability: security fixes to Xen

NOTE: Installation of these items will require a reboot! You will be prompted to reboot at the end.

Would you like to install these items? [y/n]: n You didn't want to patch...

But in fact I applied these just a day ago.

-rw-r--r-- 1 root root 1745433 Dec 23 18:26 XS62E014.xsupdate -rw-r--r-- 1 root root 1744985 Dec 18 09:01 XS62ESP1002.xsupdate

When I run

xe patch-list | grep XS62ESP1

I get name-label ( RO): XS62ESP1 name-label ( RO): XS62ESP1002

These appear in the list already as applied but yet patcher.py would allow me to install it again?

"That ain't right"

Thanks for the update. Daniel

----- Original Message -----

From: "Darren Gibbard" < notifications@github.com > To: "dalgibbard/citrix_xenserver_patcher" < citrix_xenserver_patcher@noreply.github.com > Cc: "Daniel Siminiuk" < daniel@siminiuk.com > Sent: Friday, February 14, 2014 4:06:27 AM Subject: Re: [citrix_xenserver_patcher] Already applied patches (checking) (#6)

OK, so, although much delayed (sorry!) i've made some minor changes to the code which should stop patcher.py from building the patch list against details from other pool members.

I don't have a pool to hand that I can test on, so if someone could validate this for me it would be much appreciated!

Changes are in commit ca88e17 and is merged into master branch.

— Reply to this email directly or view it on GitHub .

dalgibbard commented 10 years ago

Thanks for the feedback - Could you paste the full xe patch-list output please?

dalgibbard commented 10 years ago

Wrap it in triple backticks :)

dsiminiuk commented 10 years ago
uuid ( RO)                    : ff202d2d-2812-4c6b-b500-2f4701de7bc4
              name-label ( RO): XS62E011
        name-description ( RO): Public Availability: Storage and ISCSI fixes
                    size ( RO): 845698
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 59128f15-92cd-4dd9-8fbe-a0115d1b07a2
              name-label ( RO): XS62E002
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1743501
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 83bca9f6-4ae5-45f9-9426-440216f73797
              name-label ( RO): XS62E010
        name-description ( RO): Public Availability: Fix for GPU pass through
                    size ( RO): 252927
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): 

uuid ( RO)                    : 8b0518d8-3610-4b7f-8a31-0e02718d2f9f
              name-label ( RO): XS62E013
        name-description ( RO): Limited Availability: Toolstack fixes
                    size ( RO): 0
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : d9c753b9-a15b-4a31-897b-97fdae609031
              name-label ( RO): XS62E009
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1744205
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 0850b186-4d47-11e3-a720-001b2151a503
              name-label ( RO): XS62ESP1
        name-description ( RO): Public Availability: XenServer 6.2 Service Pack 1 (SP1)
                    size ( RO): 218600009
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 7d5a3a2f-e163-4f23-b8f7-929961eeeb2e
              name-label ( RO): XS62E008
        name-description ( RO): XenTools fixes
                    size ( RO): 0
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : 297f2f77-5603-4aaf-9e56-db49512d4592
              name-label ( RO): XS62ESP1002
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1744985
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 78251ea4-e4e7-4d72-85bd-b22bc137e20b
              name-label ( RO): XS62E014
        name-description ( RO): Public Availability: security fixes to Xen
                    size ( RO): 1745433
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 1e11bede-e41f-402e-879b-1210fa779a68
              name-label ( RO): XS62E007
        name-description ( RO): ioemu fixes for Windows 8.1
                    size ( RO): 0
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : 5579f1f0-ff83-11e2-b778-0800200c9a66
              name-label ( RO): XS62E004
        name-description ( RO): Public Availability: Fixes for Dom0 kernel issues
                    size ( RO): 35766769
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : aeff92a9-2c60-43eb-b34e-14e4132b411c
              name-label ( RO): XS62E005
        name-description ( RO): Public Availability: Toolstack fixes
                    size ( RO): 9315631
                   hosts (SRO): b3984753-09f3-409b-8bfb-88a0e1505a0e, e1eb9451-d8ff-404e-be0e-46aa4ec69d2d
    after-apply-guidance (SRO): restartXAPI

uuid ( RO)                    : a4251789-ce6c-4726-942c-3cddbadcaca6
              name-label ( RO): XS62E012
        name-description ( RO): Public Availability: Fixes for Dom0 kernel issues
                    size ( RO): 35767767
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartHost

uuid ( RO)                    : dedcc0dd-d8f3-4f76-90ca-92697c7a44f0
              name-label ( RO): XS62E001
        name-description ( RO): Public Availability: Xapi fixes
                    size ( RO): 6625641
                   hosts (SRO): e1eb9451-d8ff-404e-be0e-46aa4ec69d2d, b3984753-09f3-409b-8bfb-88a0e1505a0e
    after-apply-guidance (SRO): restartXAPI
dsiminiuk commented 10 years ago

TADA!!!!!

dalgibbard commented 10 years ago

I've made a few minor changes this morning for issue #10 - not sure if this will help/assist this issue directly though.

Two requests if I may, could you:

xe host-list address=`hostname -i`

Thanks for your assistance!

dalgibbard commented 10 years ago

PS: If hostname -i doesn't work, try:

host-list address=`ip addr show | awk /"scope global"/\'{print$2}\' | awk -F/ \'{print$1}\'` params=uuid --minimal
dsiminiuk commented 10 years ago

Hmm...

[root@xs1 ~]# ./patcher.py -e ./XS62_exclusions.py
Error: Failed to obtain HOSTUUID from XE CLI

[root@xs1 ~]# hostname -i
192.168.1.7

[root@xs1 ~]# ip addr show | awk '/scope global/ {print $2}' | awk -F/ '{print $1}'
10.10.10.7
192.168.1.7
dsiminiuk commented 10 years ago

Further troubleshooting...

[root@xs1 ~]# echo `ip addr show | awk '/scope global/ {print $2}' | awk -F/ '{print $1}'` params=uuid --minimal
10.10.10.7 192.168.1.7 params=uuid --minimal

I have 2 interfaces, Management and Storage network NICs.

[root@xs1 ~]# xe host-list 10.10.10.7 192.168.1.7 params=uuid --minimal
Error: Unknown field '10.10.10.7'

But if I use only a single IP it works,...

[root@xs1 ~]# xe host-list address=192.168.1.7 params=uuid --minimal
e1eb9451-d8ff-404e-be0e-46aa4ec69d2d

What we really want is the IP address of the management interface which is associated to gateway.

[root@xs1 ~]# ip add show `route -n | awk '$1~/0.0.0.0/ {print $8}'` | awk '$1~/inet/ {print $2}' | awk -F/ '{print $1}'
192.168.1.7

Like this...

[root@xs1 ~]# xe host-list address=`ip add show \`route -n | awk '$1~/0.0.0.0/ {print $8}'\` | awk '$1~/inet/ {print $2}' | awk -F/ '{print $1}'` params=uuid --minimal
e1eb9451-d8ff-404e-be0e-46aa4ec69d2d

However hostname -i also returns the IP address so I'm not sure why it is failing.

dsiminiuk commented 10 years ago

I changed the pertinent line to

get_host_uuid_cmd = str(xecli) + str(' host-list address=`hostname -i` params=uuid --minimal')

Now I am getting output...

[root@xs1 ~]# ./patcher.py -e ./XS62_exclusions.py
No local Patches are installed.
The following Patches are pending installation:

uuid: 0850b186-4d47-11e3-a720-001b2151a503
 url: http://support.citrix.com/article/CTX139788
 timestamp: 2013-12-16T00:00:00Z
 name_label: XS62ESP1
 patch_url: http://downloadns.citrix.com.edgesuite.net/8707/XS62ESP1.zip
 after_apply_guidance: restartHost
 name_description: Public Availability: XenServer 6.2 Service Pack 1 (SP1)

uuid: 297f2f77-5603-4aaf-9e56-db49512d4592
 url: http://support.citrix.com/article/CTX140051
 timestamp: 2014-01-22T00:00:00Z
 name_label: XS62ESP1002
 patch_url: http://downloadns.citrix.com.edgesuite.net/8737/XS62ESP1002.zip
 after_apply_guidance: restartHost
 name_description: Public Availability: security fixes to Xen

NOTE: Installation of these items will require a reboot!
      You will be prompted to reboot at the end.

Would you like to install these items? [y/n]:

However, both of these have already been installed.

Also, I don't know why it would state "No local Patches are installed." either.

dalgibbard commented 10 years ago

The "No local patches" message is due to all previous patches being on the exclusion list.

Need to work out why its not marking those patches as applied... what happens if you say yes to patching?

Im wondering if:

I doubt its either, but is probably worth validating...

dsiminiuk commented 10 years ago
Would you like to install these items? [y/n]: y
Starting patching...
Downloading: XS62ESP1.zip
Download Size: 311454853 Bytes                                                                                                                                                                                 26009600  [8.35%]

There is a little overlap of the "Applying" over the percentage marker.

Would you like to install these items? [y/n]: y
Starting patching...
Downloading: XS62ESP1.zip
Download Size: 311454853 Bytes
Applying: XS62ESP10%]
Uncompressing...

And then it stopped

Would you like to install these items? [y/n]: y
Starting patching...
Downloading: XS62ESP1.zip
Download Size: 311454853 Bytes
Applying: XS62ESP10%]
Uncompressing...
Internal Upload...
The uploaded patch file is invalid
Patch internal upload failed for: XS62ESP1.xsupdate

Ok I think I found out what the problem was, the file system is full on Dom0.

dalgibbard commented 10 years ago

Are you definitely running the latest version? Im sure I fixed the overlapping text ages ago :)

dsiminiuk commented 10 years ago

I used wget on the homepage here to download it. Is that not the latest?

Let me get the zip package.

Also, I deleted all the /var/log/*.gz files and now I have about 1.2 GB free on /.

dsiminiuk commented 10 years ago

Got it, updated patcher.py with the hostname -i method.

Downloading again

[root@xs1 ~]# ./patcher.py -e ./XS62_exclusions.py
No local Patches are installed.
The following Patches are pending installation:

uuid: 0850b186-4d47-11e3-a720-001b2151a503
 url: http://support.citrix.com/article/CTX139788
 timestamp: 2013-12-16T00:00:00Z
 name_label: XS62ESP1
 patch_url: http://downloadns.citrix.com.edgesuite.net/8707/XS62ESP1.zip
 after_apply_guidance: restartHost
 name_description: Public Availability: XenServer 6.2 Service Pack 1 (SP1)

uuid: 297f2f77-5603-4aaf-9e56-db49512d4592
 url: http://support.citrix.com/article/CTX140051
 timestamp: 2014-01-22T00:00:00Z
 name_label: XS62ESP1002
 patch_url: http://downloadns.citrix.com.edgesuite.net/8737/XS62ESP1002.zip
 after_apply_guidance: restartHost
 name_description: Public Availability: security fixes to Xen

NOTE: Installation of these items will require a reboot!
      You will be prompted to reboot at the end.

Would you like to install these items? [y/n]: y
Starting patching...
Downloading: XS62ESP1.zip
Download Size: 311454853 Bytes  (lots of spaces here to wrap to the new line)
165265408  [53.06%]

Then

Applying: XS62ESP10%]
Uncompressing...
Internal Upload...
The uploaded patch file already exists
uuid: 0850b186-4d47-11e3-a720-001b2151a503
Patch internal upload failed for: XS62ESP1.xsupdate
[root@xs1 ~]#
pnull commented 10 years ago

:+1: I have exactly the same problem as @dsiminiuk . Installed patcher.py using these commands:

wget -O patcher.py https://raw.github.com/dalgibbard/citrix_xenserver_patcher/master/patcher.py
wget -O XS62_exclusions.py https://raw.github.com/dalgibbard/citrix_xenserver_patcher/master/XS62_exclusions.py
chmod +x patcher.py

and then run the following command:

./patcher.py -e ./XS62_exclusions.py

on a Machine thats currently on XenServer 6.2 SP1.

Would you like to install these items? [y/n]: y
Starting patching...
Downloading: XS62ESP1002.zip
Download Size: 9041707 Bytes
    9041707  [100.00%]
Applying: XS62ESP1002
Uncompressing...
Internal Upload...
The uploaded patch file already exists
uuid: 297f2f77-5603-4aaf-9e56-db49512d4592
Patch internal upload failed for: XS62ESP1002.xsupdate
Fr3DBr commented 10 years ago

Same problem as pnull here.

Fr3DBr commented 10 years ago

The problem is that if you don't have a pool, it doesn't works it seems :) Because the hosts (SRO) is always 'empty' for a single xen server.. :)

dsiminiuk commented 10 years ago

That may be one problem, I'll take your word for it. I DO have a pool of 2 machines and it fails, so... multiple issues are possible.

Fr3DBr commented 10 years ago

Actually not exactly the problem, I made a pool here and the SRO is still null/empty, you are calling xe patch-list to check for the current uuid of the pending patches, but the problem is that once the patch is uploaded via patch-upload, the hosts (SRO) gets null (for the SP1 patch at least), I'll try to manually patch it to see if it is a situation that happens only with this specific patch.

Fr3DBr commented 10 years ago

This is my output look : Starting patching... Downloading: XS62ESP1.zip Download Size: 311454853 Bytes Applying: XS62ESP10%] Uncompressing... Internal Upload... /opt/xensource/bin/xe patch-list hosts=c34d5aa7-2a21-403d-9788-078708bee418 params=uuid uuid=0850b186-4d47-11e3-a720-001b2151a503 --minimal Patch internal upload failed for: XS62ESP1.xsupdate -> -> 0850b186-4d47-11e3-a720-001b2151a503 [root@srv1303 patcher]# xe patch-list uuid ( RO) : 0850b186-4d47-11e3-a720-001b2151a503 name-label ( RO): XS62ESP1 name-description ( RO): Public Availability: XenServer 6.2 Service Pack 1 (SP1) size ( RO): 218600009 hosts (SRO): after-apply-guidance (SRO): restartHost

Fr3DBr commented 10 years ago

see hosts (SRO): ? This is what is confusing the xe 'patch-list' call, and the result is empty/null since the host uuid it has, do not have any pending patch to be applied.

dsiminiuk commented 10 years ago

This is my output, you can see there are 2 hosts listed..

[root@xs3 ~]# xe patch-list
uuid ( RO)                    : 0850b186-4d47-11e3-a720-001b2151a503
              name-label ( RO): XS62ESP1
        name-description ( RO): Public Availability: XenServer 6.2 Service Pack 1 (SP1)
                    size ( RO): 218600009
                   hosts (SRO): 0135a864-c351-407f-9cc7-d16872d9feb3, b292ca86-b41d-4cf0-92df-73497765da24
    after-apply-guidance (SRO): restartHost
Fr3DBr commented 10 years ago

Yes, but why in my case the hosts(SRO): is not being populated at all ?

Good question :D and this is the issue of the other guys too, at least the last one :P

Fr3DBr commented 10 years ago

Maybe we should skip the host uuid in patch-list procedure, as the patch is already present in the server ?

Fr3DBr commented 10 years ago

Yay, it worked !!! :D

Fr3DBr commented 10 years ago

Just need to remove the hosts uuid from patch-list step, then it will work fine (it worked for me).

Starting patching... Downloading: XS62ESP1.zip Download Size: 311454853 Bytes Applying: XS62ESP10%] Uncompressing... Internal Upload... Applying Patch... Downloading: XS62ESP1002.zip Download Size: 9041707 Bytes Applying: XS62ESP1002 Uncompressing... Internal Upload... Applying Patch... Downloading: XS62ESP1003.zip Download Size: 115571297 Bytes Applying: XS62ESP1003 Uncompressing... Internal Upload... Applying Patch... Downloading: XS62ESP1005.zip Download Size: 114639802 Bytes Applying: XS62ESP1005 Uncompressing... Internal Upload... Applying Patch... Downloading: XS62E015.zip Download Size: 115572824 Bytes Applying: XS62E0150%] Uncompressing... Internal Upload... Applying Patch... This patch has already been applied patch: c8b9d332-30e4-4e5e-9a2a-8aaae6dee91a (XS62E015)

A reboot is now required. Would you like to reboot now? [y/n]: n OK, i'll let you reboot in your own time. Don't forget though! [root@srv1303 patcher]# ./patcher.py -e ./XS62_exclusions.py No Patches Required. System is up to date.

Fr3DBr commented 10 years ago

These were my changes to patcher.py :

# patch_upload_verify_cmd = str(xecli) + str(' patch-list hosts=') + str(host_uuid) + (' params=uuid uuid=') + str(uuid) + str(" --minimal")
patch_upload_verify_cmd = str(xecli) + str(' patch-list params=uuid uuid=') + str(uuid) + str(" --minimal")
dsiminiuk commented 10 years ago

Very good. I'll need to download and install the whole package again because I swapped out my servers for another pair and did everything manually. I won't be able to test until there is a new patch released.

dsiminiuk commented 10 years ago

Which happens to be now! I haven't opened the XenCenter console in awhile. More to come...

Fr3DBr commented 10 years ago

;)

dsiminiuk commented 10 years ago

Hmm... other problem.

I wrote a small bash script to invoke the command so I didn't have to type it all out all the time...

#!/bin/bash
./patcher.py -e ./XS62_exclusions.py

That should not be a problem.

I also updated the exclusions file with all my installed patches.

After I updated the patcher.py line "patch_upload_verify_cmd" as above (spaces ahead of the command to line it up like the old command, I know python needs this).

When I run it with the bash script or not, I get...

Error: Failed to obtain HOSTUUID from XE CLI
dsiminiuk commented 10 years ago

On a side note, the paths to the files listed on the main page for wget don't work any more. The raw.github changed to something else /.../../../raw/master/