erigones/esdc-ce

Change UUID of a compute node

Opened this issue · 1 comments

Creating issue on behalf of @klebed from Gitter chat:

hi, everyone! We have changed motherboard on one of the servers. There is no tool that allows to change serial on this type of MB, so now node came online, but we can't collect data about it, because it tries to register new entry, but can't because nodename already there. In fact binding to serial number is very confusing in many ways. It's better to use nodename or UUID saved somewhere, rather than getting it from HW every time.

Can you advise what to do with that node to change it's UUID to the new one leaving all the machines on that node intact? I don't even know how to get new UUID of the node.

...

also. after MB change I had to make a complex transaction to set new UUID of the node.

BEGIN;
update vms_node SET uuid = 'e0334d7b-dad7-dd11-a4de-c860001bd8fa' where hostname = 'node01...';
update vms_nodestorage SET node_id = 'e0334d7b-dad7-dd11-a4de-c860001bd8fa' where node_id = 'c07b95ba-c1d7-dd11-8a3e-4e0b68d2380c';
update vms_vm SET node_id = 'e0334d7b-dad7-dd11-a4de-c860001bd8fa' where node_id = 'c07b95ba-c1d7-dd11-8a3e-4e0b68d2380c';
update vms_dcnode SET node_id = 'e0334d7b-dad7-dd11-a4de-c860001bd8fa' where node_id = 'c07b95ba-c1d7-dd11-8a3e-4e0b68d2380c';
update vms_backupdefine SET node_id = 'e0334d7b-dad7-dd11-a4de-c860001bd8fa' where node_id = 'c07b95ba-c1d7-dd11-8a3e-4e0b68d2380c';
update vms_backup SET node_id = 'e0334d7b-dad7-dd11-a4de-c860001bd8fa' where node_id = 'c07b95ba-c1d7-dd11-8a3e-4e0b68d2380c';
COMMIT;

if someone would have such case... Either do this transaction with proper uuids, or delete the node and add it from scratch.

And also update UUID in Zabbix.

The UUID is a SmartOS thing received from sysinfo. There's a override_uuid=... bootparam:
https://github.com/TritonDataCenter/smartos-live/blob/release-20220407/src/sysinfo#L126
You can add it to /boot/loader.conf or /mnt/usbkey/boot/loader.conf in case of diskboot or usbboot respectively.