LXD containers not starting in Ubuntu 18.04 upon upgrade from 16.04

Error: Common start logic: Set volatile.last_state.idmap config key on container “mail” (id 6): Failed to write backup file: open /var/lib/lxd/containers/mail/backup.yaml: read-only file system

Error: root@xxxxxx:~# btrfs scrub start -Bf /dev/md3
ERROR: scrubbing /dev/md3 failed for device id 1: ret=-1, errno=30 (Read-only file system)
scrub canceled for 1ab9b6cd-ccdc-422b-b185-dfe1c5f201db
scrub started at Mon Jul 1 10:49:46 2019 and was aborted after 00:00:00
total bytes scrubbed: 0.00B with 0 errors
dmesg : [25752825.641678] BTRFS error (device md3): parent transid verify failed on 236271091712 wanted 1451217 found 1450823
[25752825.646371] BTRFS error (device md3): parent transid verify failed on 236271091712 wanted 1451217 found 1450823

Your filesystem appears corrupted and switched to read-only mode.
That’s unrelated to LXD and you should follow some of the guides available for btrfs repair and disaster recovery to get your filesystem back to writable mode and back to a consistent state.