RAID always renames itself to /dev/md127 after rebooting
Solution:
mdadm --detail --scan /dev/md127 >> /etc/mdadm/mdadm.conf
vim /etc/mdadm/mdadm.conf, edit the appended line to look like this:
ARRAY /dev/md0 metadata=1.2 UUID=XXXXXXXX:XXXXXXXX:XXXXXXXX:XXXXXXXX
In other words, remove the name part, and set the device to /dev/md0.
update-initramfs -u
reboot