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

Error: Failed to obtain HOSTUUID from XE CLI #64

Closed ivolauro closed 7 years ago

ivolauro commented 7 years ago

Hi, in a few hosts I get the Error: Failed to obtain HOSTUUID from XE CLI error.

I change the get_host_uuid_cmd setting into: get_host_uuid_cmd = str(xecli) + str(' host-list name-label=grep "^HOSTNAME=" /etc/sysconfig/network | awk -F= \'{print$2}\' params=uuid --minimal')

and it is working with all the hosts

Is it a good improvement?

Have a nice day, Ivo

Mattz0r commented 7 years ago

I had that error before, there were existing patches pending, rebooted the host, re-ran the patcher.py and then the error didn't appear.

landonstewart commented 7 years ago

I also had this error. A simple reboot of all the hosts in the pool worked.

ivolauro commented 7 years ago

I have to reduce the reboot events, so I need to install all the available updates before restart the server because I can reboot it only once. This is why I looked for a workaround.

dalgibbard commented 7 years ago

I don't currently have XenServer machines available for testing; nor did I actually ever encounter this particular problem (seems to be disparateness between the xenserver hostname, and the network configured hostname perhaps? Hence why reboot would resolve...)

I'm happy to accept a pull request with the suggested fix, and even happier for others to test :)

bpbp-boop commented 7 years ago

Ran into this today on a 7.1 pool. You can resolve this with hostnamectl set-hostname full-fqdn.whatever.com and xe-toolstack-restart on all the hosts in the pool if you want to avoid a reboot.

dalgibbard commented 7 years ago

Side note, possibly worth mentioning here - I created a test machine named xenserver7.1 and found that this was set in /etc/sysconfig/network - but it was truncated to xenserver7 in both xe host-list and /etc/hostname. Got to be careful with the inconsistancies XenServer can throw with hostname configuration...

dalgibbard commented 7 years ago

Commit 968c9cf adds 2 additional tests for identifying the host's UUID. That should stop this with any luck. Closing.