Scott and I debugged this further, and the best hint so far is bug 1620780. In Scott's local instances he gets "systemctl is-system-running" == "starting" with
JOB UNIT TYPE STATE
2 dev-sda2.device start running
postgresql-9.5.postinst calls "invoke-rc.d postgresql start", and since the system is not booted yet (according to is-system-running) it starts the postgresql.service wrapper job with --job-mode=ignore-dependencies, and thus it never starts the @9.5-main instance.
I suggest to handle this bit (which is LXD specific) in bug 1620780, and keep this bug for the cloud-init change.
Scott and I debugged this further, and the best hint so far is bug 1620780. In Scott's local instances he gets "systemctl is-system-running" == "starting" with
JOB UNIT TYPE STATE
2 dev-sda2.device start running
postgresql- 9.5.postinst calls "invoke-rc.d postgresql start", and since the system is not booted yet (according to is-system-running) it starts the postgresql.service wrapper job with --job-mode= ignore- dependencies, and thus it never starts the @9.5-main instance.
I suggest to handle this bit (which is LXD specific) in bug 1620780, and keep this bug for the cloud-init change.