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

Failed to obtain HOSTUUID from XE CLI #16

Closed ways closed 9 years ago

ways commented 9 years ago

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

This may be related to having more than one IP on the host.

If I run the command that's failing I get: [root@x ~]# xe host-list address=ip addr show | awk /"scope global"/\'{print$2}\' | awk -F/ \'{print$1}\' | head -n1 params=uuid --minimal awk: awk: '{print}' /scope global/'{print}'awk: ^ invalid char ''' in expressionawk: ^ invalid char ''' in expression

List of IPs: [root@x ~]# ip addr show | awk /"scope global"/{print$2} inet 10.47.77.78/24 brd 10.47.77.255 scope global xenbr1 inet 10.47.47.22/24 brd 10.47.47.255 scope global xenbr0 inet 10.253.1.161/24 brd 10.253.1.255 scope global xapi0

If I clean up the line I get: [root@x ~]# xe host-list address=ip addr show | awk /"scope global"/{print$2} | awk -F/ {print$1} | head -n1 params=uuid --minimal [root@x ~]#

Not all IPs will give a UUID: [root@xstest1005 ~]# xe host-list address=10.47.47.22 params=uuid --minimala091610e-e4f3-4935-93cb-1c2382f40707 [root@xstest1005 ~]# xe host-list address=10.47.77.78 params=uuid --minimal

So should we change how UUID is found, or add an optional parameter to set UUID?

dalgibbard commented 9 years ago

I've managed to actually replicate this, this morning, whilst trying to build out a test env. I'll look into it and report back.

dalgibbard commented 9 years ago

I've totally scrapped trying to pull the host UUID via IPs - it's far too flaky/subject to change for my liking- and that's before IPv6 is even heavily used/taken into consideration.

I've replaced the checking method to use the Xenserver allocated hostname/name-label instead. So this issue should now be resolved.

74kumi commented 8 years ago

I found with the newest version I'm still getting this error

sethmiller-millersystems commented 7 years ago

me too

Mattz0r commented 7 years ago

A new issue was raised relating to this, #64