removing a unit leaves the encrypted ephemeral drive active - reinstallation fails

Bug #1873364 reported by Andrea Ieri
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Nova Compute Charm
Triaged
Undecided
Unassigned

Bug Description

How to reproduce:
* remove a nova-compute unit
* re-add a nova-compute unit onto the same machine

Symptom:
* charm (re)installation fails with:
unit-nova-compute-kvm-sriov-6: 21:55:51 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed INFO:vaultlocker.dmcrypt:LUKS formatting /dev/disk/by-dname/bcache-ephemeral using UUID:acc229e3-923a-4916-89c0-76cd2ea0bcd4
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed Cannot use device /dev/disk/by-dname/bcache-ephemeral which is in use (already mapped or mounted).
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed vaultlocker: Command '['cryptsetup', '--batch-mode', '--uuid', 'acc229e3-923a-4916-89c0-76cd2ea0bcd4', '--key-file', '-', 'luksFormat',
 '/dev/disk/by-dname/bcache-ephemeral']' returned non-zero exit status 5.
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed Traceback (most recent call last):
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-sriov-6/charm/hooks/secrets-storage-relation-changed", line 761, in <module>
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed main()
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-sriov-6/charm/hooks/secrets-storage-relation-changed", line 754, in main
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed hooks.execute(sys.argv)
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-sriov-6/charm/hooks/charmhelpers/core/hookenv.py", line 914, in execute
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed self._hooks[hook_name]()
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-sriov-6/charm/hooks/secrets-storage-relation-changed", line 700, in secrets_storage$
changed
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed configure_local_ephemeral_storage()
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed File "/var/lib/juju/agents/unit-nova-compute-kvm-sriov-6/charm/hooks/nova_compute_utils.py", line 1004, in configure_local_ephemeral$
storage
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed dev])
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed raise CalledProcessError(retcode, cmd)
unit-nova-compute-kvm-sriov-6: 21:55:52 DEBUG unit.nova-compute-kvm-sriov/6.secrets-storage-relation-changed subprocess.CalledProcessError: Command '['vaultlocker', 'encrypt', '--uuid', 'acc229e3-923a-4916-89c0-76cd2ea0bcd4', '/dev/disk/by-dna$
e/bcache-ephemeral']' returned non-zero exit status 1.
unit-nova-compute-kvm-sriov-6: 21:55:52 ERROR juju.worker.uniter.operation hook "secrets-storage-relation-changed" failed: exit status 1

Expectation:
* the charm properly cleans up during removal

Workaround:
* cryptsetup close <crypt device>

Tags: scaleback
Changed in charm-nova-compute:
status: New → Triaged
tags: added: scaleback
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.