Alon Bar-Lev has uploaded a new change for review.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
bootstrap: node id: consider bonding MAC addresses as well
The node id is constructed using the lowest MAC address.
If bonding is applied after initial node id was taken, it may shade the minimal address.
This change adds to the MAC addresses of bonding interfaces to the MAC address addresses to consider.
Sync with engine command used for same purpose.
Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Signed-off-by: Alon Bar-Lev alonbl@redhat.com --- M vdsm_reg/deployUtil.py.in 1 file changed, 26 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/7596/1
diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in index e22bfb5..fc7df29 100644 --- a/vdsm_reg/deployUtil.py.in +++ b/vdsm_reg/deployUtil.py.in @@ -290,13 +290,36 @@ return strReturn
def getMacs(): + + # ( + # find /sys/class/net/*/device | while read f; do \ + # cat "$(dirname "$f")/address"; \ + # done; \ + # [ -d /proc/net/bonding ] && \ + # find /proc/net/bonding -type f -exec cat '{}' ; | \ + # grep 'Permanent HW addr:' | \ + # sed 's/.* //' + # ) | sed -e '/00:00:00:00/d' -e '/^$/d' + macs = [] for b in glob.glob('/sys/class/net/*/device'): - nic = b.split('/')[-2] - addr = '/sys/class/net/' + nic + '/address' - mac = file(addr).readlines()[0].split()[0] + mac = file(os.path.join(os.path.dirname(b), "address")). \ + readline().replace("\n", "") macs.append(mac)
+ for b in glob.glob('/proc/net/bonding/*'): + lines = file(b).readlines() + try: + line = (string for i, string in enumerate(lines) \ + if "Permanent HW addr: " in string).next() + macs.append(line.split(": ")[1].replace("\n", "")) + except StopIteration: + pass + + for r in ("", "00:00:00:00:00:00"): + while macs.count(r): + macs.remove(r) + return macs
def getHostID():
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com
Alon Bar-Lev has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 1: Verified
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/763/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Douglas Schilling Landgraf has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 1: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm_reg/deployUtil.py.in Line 307: readline().replace("\n", "") Line 308: macs.append(mac) Line 309: Line 310: for b in glob.glob('/proc/net/bonding/*'): Line 311: lines = file(b).readlines() I find this code a bit too complicated for our needs. how about
for line in file(b) if line.startswith("Permanent HW addr: "): macs.append(line.split(": ")[1].replace("\n", ""))
return set(macs) - set(["", "00:00:00:00:00:00"]) Line 312: try: Line 313: line = (string for i, string in enumerate(lines) \ Line 314: if "Permanent HW addr: " in string).next() Line 315: macs.append(line.split(": ")[1].replace("\n", ""))
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm_reg/deployUtil.py.in Line 307: readline().replace("\n", "") Line 308: macs.append(mac) Line 309: Line 310: for b in glob.glob('/proc/net/bonding/*'): Line 311: lines = file(b).readlines() The for loop is what I wrote initially... I thought you won't like it... :)
The set thing is nice. Line 312: try: Line 313: line = (string for i, string in enumerate(lines) \ Line 314: if "Permanent HW addr: " in string).next() Line 315: macs.append(line.split(": ")[1].replace("\n", ""))
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Alon Bar-Lev has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 2: Verified
Applied Dan's comments.
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/770/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
(it's not fair to give +2 immediately)
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Barak Azulay has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Douglas Schilling Landgraf has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 2: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 2: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
bootstrap: node id: consider bonding MAC addresses as well
The node id is constructed using the lowest MAC address.
If bonding is applied after initial node id was taken, it may shade the minimal address.
This change adds to the MAC addresses of bonding interfaces to the MAC address addresses to consider.
Sync with engine command used for same purpose.
Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Signed-off-by: Alon Bar-Lev alonbl@redhat.com --- M vdsm_reg/deployUtil.py.in 1 file changed, 19 insertions(+), 4 deletions(-)
Approvals: Alon Bar-Lev: Verified Douglas Schilling Landgraf: Looks good to me, but someone else must approve Barak Azulay: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 3:
Ahhh, I should not have taken this patch. We are stupid enough to have a competing implementation of this function in utils.getHostUUID(), that has to change, too.
Furthermore, there is an upgrade issue. When a host is upgraded or reinstalled, its uuid may change.
That's bad.
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Barak Azulay has posted comments on this change.
Change subject: bootstrap: node id: consider bonding MAC addresses as well ......................................................................
Patch Set 3:
1 - only caps.py uses the utils.getHostUUID and I'm almost certain the engine does not act on a change in the host UUID reported in caps (need to check)
2 - even when we are talking about upgrade in case the upgraded machine has bond (that actually had this issue in the past ... change the UUID) will have that affect and this is a fix for that problem.
3 - when reinstalled, again it will effect only bonded machines that had this issue in the past, and would have suffered this issue again with or without the new patch
4 - we should also change the implementation of the utils.getHostUUID.
-- To view, visit http://gerrit.ovirt.org/7596 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Iae0713f95c25e3e05b24bf8254499e4cd8e64d10 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Alon Bar-Lev alonbl@redhat.com Gerrit-Reviewer: Barak Azulay bazulay@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Douglas Schilling Landgraf dougsland@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org