DEPLOYMENT
bionic-stein, DVR, barbican + octavia, external Ceph cluster (ceph-proxy charm deployed), Vault.
PROBLEM DESCRIPTION
As soon as Vault is unlocked, all nova-compute-kvm units go into 'error' state with status message 'hook failed: "secrets-storage-relation-changed"'.
Inspecting juju debug-log of nova-compute-kvm units I find the following error:
unit-nova-compute-kvm-1: 23:19:52 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Making dir /var/lib/charm/nova-compute-kvm root:root 555
unit-nova-compute-kvm-1: 23:19:52 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Making dir /etc/ceph root:root 555
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/libvirt/qemu.conf
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/default/qemu-kvm
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/libvirt/libvirtd.conf
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/default/libvirt-bin
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/init/libvirt-bin.override
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/nova/nova.conf
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/nova/vendor_data.json
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/apparmor.d/usr.bin.nova-compute
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /etc/ceph/secret.xml
unit-nova-compute-kvm-1: 23:19:53 INFO unit.nova-compute-kvm/1.juju-log secrets-storage:277: Registered config file: /var/lib/charm/nova-compute-kvm/ceph.conf
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed Traceback (most recent call last):
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/secrets-storage-relation-changed", line 763, in <module>
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed main()
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/secrets-storage-relation-changed", line 756, in main
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed hooks.execute(sys.argv)
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/charmhelpers/core/hookenv.py", line 914, in execute
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed self._hooks[hook_name]()
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/secrets-storage-relation-changed", line 702, in secrets_storage_changed
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed configure_local_ephemeral_storage()
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/nova_compute_utils.py", line 973, in configure_local_ephemeral_storage
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed context = vault_kv()
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/charmhelpers/contrib/openstack/vaultlocker.py", line 60, in __call__
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed token=token
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-1/charm/hooks/charmhelpers/contrib/openstack/vaultlocker.py", line 121, in retrieve_secret_id
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed import hvac
unit-nova-compute-kvm-1: 23:19:53 DEBUG unit.nova-compute-kvm/1.secrets-storage-relation-changed ModuleNotFoundError: No module named 'hvac'
unit-nova-compute-kvm-1: 23:19:53 ERROR juju.worker.uniter.operation hook "secrets-storage-relation-changed" failed: exit status 1
WORKAROUND
1. Manually install python3-hvac on nova-compute-kvm nodes (apt install python3-hvac)
2. juju resolved nova-compute-kvm/N
3. nova-compute-kvm units go into 'active' state with status message 'Unit is ready'
BUNDLE
https://pastebin.canonical.com/p/7cXhnHXZhM/
CHARMS REVISIONS
https://pastebin.canonical.com/p/mhprgzbkw7/
During discussion with Alex, we discovered that my bundle contains unnecessary relation:
"vault:secrets" - "nova-compute- kvm:secrets- storage"
The relation is not needed, because encryption of ephemeral storage is disabled (encrypt: false).
After removing the relation, the error goes away.