For CPU hot-plug, IIRC you can add a udev rule to set them online automatically I didn’t test it on LXD, but this was working well on Proxmox or Libvirt.
# /etc/udev/rules.d/90-cpu-hotplug.rules
SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"