Hi,
I'm seeing an issue where two nodes, on a fresh Razor 1.7.0 install,
both think they're the same node. So the first boots and creates a new
node, then the second boots and Razor thinks it's the same one and
merges the details, rather than creating a new node. Here's an excerpt
from the log which shows what's going on:
18:14:46,508 INFO [razor.sequel] (http-/0.0.0.0:8150-1) (0.004000s) SELECT * FROM "nodes" WHERE ("hw_info" && ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-61-dc-6e'])
18:14:46,530 INFO [razor.sequel] (http-/0.0.0.0:8150-1) (0.007000s) INSERT INTO "nodes" ("hw_info", "dhcp_mac") VALUES (ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-61-dc-6e','serial=456c604b-cf58-4ccc-b152-c2c4a56512cc','uuid=55760d85-238a-43ad-b59a-5400eb3b803f']::text[], 'fa-16-3e-61-dc-6e') RETURNING *
18:14:46,590 INFO [razor.sequel] (http-/0.0.0.0:8150-1) (0.003000s) UPDATE "nodes" SET "hw_info" = ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-61-dc-6e','serial=456c604b-cf58-4ccc-b152-c2c4a56512cc','uuid=55760d85-238a-43ad-b59a-5400eb3b803f']::text[], "dhcp_mac" = 'fa-16-3e-61-dc-6e', "policy_id" = NULL, "facts" = NULL, "hostname" = NULL, "root_password" = NULL, "boot_count" = 0, "last_checkin" = NULL, "ipmi_hostname" = NULL, "ipmi_username" = NULL, "ipmi_password" = NULL, "last_power_state_update_at" = NULL, "metadata" = '{}', "installed" = NULL, "installed_at" = NULL, "desired_power_state" = NULL, "last_known_power_state" = NULL, "name" = 'node5' WHERE ("id" = 5)
18:14:46,664 INFO [razor.web.log] (http-/0.0.0.0:8150-1) 1.2.3.4 - - [01/Feb/2018:18:14:46 +0000] "GET /svc/boot?net0=fa-16-3e-61-dc-6e&net1=&net2=&net3=&dhcp_mac=fa-16-3e-61-dc-6e&serial=456c604b-cf58-4ccc-b152-c2c4a56512cc&asset=&uuid=55760d85-238a-43ad-b59a-5400eb3b803f&fact_boot_type=pcbios " 200 569 0.2040
18:14:49,214 INFO [razor.sequel] (http-/0.0.0.0:8150-2) (0.001000s) SELECT * FROM "nodes" WHERE ("hw_info" && ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-ac-14-de'])
18:14:49,266 INFO [razor.sequel] (http-/0.0.0.0:8150-2) (0.001000s) UPDATE "nodes" SET "hw_info" = ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-61-dc-6e','serial=456c604b-cf58-4ccc-b152-c2c4a56512cc','uuid=55760d85-238a-43ad-b59a-5400eb3b803f']::text[], "dhcp_mac" = 'fa-16-3e-ac-14-de', "policy_id" = NULL, "facts" = NULL, "hostname" = NULL, "root_password" = NULL, "boot_count" = 0, "last_checkin" = NULL, "ipmi_hostname" = NULL, "ipmi_username" = NULL, "ipmi_password" = NULL, "last_power_state_update_at" = NULL, "metadata" = '{}', "installed" = NULL, "installed_at" = NULL, "desired_power_state" = NULL, "last_known_power_state" = NULL, "name" = 'node5' WHERE ("id" = 5)
18:14:49,349 INFO [razor.sequel] (http-/0.0.0.0:8150-2) (0.006000s) UPDATE "nodes" SET "hw_info" = ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-61-dc-6e','serial=456c604b-cf58-4ccc-b152-c2c4a56512cc','uuid=55760d85-238a-43ad-b59a-5400eb3b803f']::text[], "dhcp_mac" = 'fa-16-3e-ac-14-de', "policy_id" = NULL, "facts" = NULL, "hostname" = NULL, "root_password" = NULL, "boot_count" = 0, "last_checkin" = NULL, "ipmi_hostname" = NULL, "ipmi_username" = NULL, "ipmi_password" = NULL, "last_power_state_update_at" = NULL, "metadata" = '{}', "installed" = NULL, "installed_at" = NULL, "desired_power_state" = NULL, "last_known_power_state" = NULL, "name" = 'node5' WHERE ("id" = 5)
18:14:49,393 INFO [razor.web.log] (http-/0.0.0.0:8150-2) 1.2.3.5 - - [01/Feb/2018:18:14:49 +0000] "GET /svc/boot?net0=fa-16-3e-ac-14-de&net1=&net2=&net3=&dhcp_mac=fa-16-3e-ac-14-de&serial=456c604b-cf58-4ccc-b152-c2c4a56512cc&asset=&uuid=5455b562-a970-4054-89e5-0ccf7f4700af&fact_boot_type=pcbios " 200 569 0.2520
Looking at that SELECT I see that it always matches, regardless of MAC
address:
razor=> SELECT id,name FROM "nodes" WHERE ("hw_info" && ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-61-dc-6e']);
id | name
----+-------
5 | node5
(1 row)
razor=> SELECT id,name FROM "nodes" WHERE ("hw_info" && ARRAY['fact_boot_type=pcbios','mac=fa-16-3e-ac-14-de']);
id | name
----+-------
5 | node5
(1 row)
razor=> SELECT id,name FROM "nodes" WHERE ("hw_info" && ARRAY['fact_boot_type=pcbios','mac=anything-i-want']);
id | name
----+-------
5 | node5
(1 row)
Is this a problem with both systems having fact_boot_type=pcbios?
Looking at the change log for 1.7.0 I see this is a new thing, so could
be that not many people have had a chance to use this code yet?
This is my first jump in to the "new" razor after the rewrite a good
number of years ago, and I've started with 1.7.0, so I can't say if this
happened in earlier versions.
Any advice on how to proceed?
Tim.
--
Tim Bishop
http://www.bishnet.net/tim/
PGP Key: 0x6C226B37FDF38D55