summaryrefslogtreecommitdiffstats
path: root/src/ceph-volume/ceph_volume/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/ceph-volume/ceph_volume/devices')
-rw-r--r--src/ceph-volume/ceph_volume/devices/lvm/activate.py2
-rw-r--r--src/ceph-volume/ceph_volume/devices/lvm/batch.py2
-rw-r--r--src/ceph-volume/ceph_volume/devices/lvm/common.py2
-rw-r--r--src/ceph-volume/ceph_volume/devices/lvm/migrate.py6
-rw-r--r--src/ceph-volume/ceph_volume/devices/lvm/zap.py8
-rw-r--r--src/ceph-volume/ceph_volume/devices/raw/common.py2
6 files changed, 16 insertions, 6 deletions
diff --git a/src/ceph-volume/ceph_volume/devices/lvm/activate.py b/src/ceph-volume/ceph_volume/devices/lvm/activate.py
index feb91053b..17c66194c 100644
--- a/src/ceph-volume/ceph_volume/devices/lvm/activate.py
+++ b/src/ceph-volume/ceph_volume/devices/lvm/activate.py
@@ -69,6 +69,8 @@ def activate_bluestore(osd_lvs, no_systemd=False, no_tmpfs=False):
raise RuntimeError('could not find a bluestore OSD to activate')
is_encrypted = osd_block_lv.tags.get('ceph.encrypted', '0') == '1'
+ if is_encrypted and conf.dmcrypt_no_workqueue is None:
+ encryption_utils.set_dmcrypt_no_workqueue()
dmcrypt_secret = None
osd_id = osd_block_lv.tags['ceph.osd_id']
conf.cluster = osd_block_lv.tags['ceph.cluster_name']
diff --git a/src/ceph-volume/ceph_volume/devices/lvm/batch.py b/src/ceph-volume/ceph_volume/devices/lvm/batch.py
index 69a3f672b..2118ce47a 100644
--- a/src/ceph-volume/ceph_volume/devices/lvm/batch.py
+++ b/src/ceph-volume/ceph_volume/devices/lvm/batch.py
@@ -256,7 +256,7 @@ class Batch(object):
)
parser.add_argument(
'--dmcrypt',
- action='store_true',
+ action=arg_validators.DmcryptAction,
help='Enable device encryption via dm-crypt',
)
parser.add_argument(
diff --git a/src/ceph-volume/ceph_volume/devices/lvm/common.py b/src/ceph-volume/ceph_volume/devices/lvm/common.py
index 35e53181a..198ba9417 100644
--- a/src/ceph-volume/ceph_volume/devices/lvm/common.py
+++ b/src/ceph-volume/ceph_volume/devices/lvm/common.py
@@ -73,7 +73,7 @@ common_args = {
'default': "",
},
'--dmcrypt': {
- 'action': 'store_true',
+ 'action': arg_validators.DmcryptAction,
'help': 'Enable device encryption via dm-crypt',
},
'--no-systemd': {
diff --git a/src/ceph-volume/ceph_volume/devices/lvm/migrate.py b/src/ceph-volume/ceph_volume/devices/lvm/migrate.py
index 64589a2d6..474b479de 100644
--- a/src/ceph-volume/ceph_volume/devices/lvm/migrate.py
+++ b/src/ceph-volume/ceph_volume/devices/lvm/migrate.py
@@ -167,7 +167,11 @@ class VolumeTagTracker(object):
aux_dev.lv_api.set_tags(tags)
def remove_lvs(self, source_devices, target_type):
- remaining_devices = [self.data_device, self.db_device, self.wal_device]
+ remaining_devices = [self.data_device]
+ if self.db_device:
+ remaining_devices.append(self.db_device)
+ if self.wal_device:
+ remaining_devices.append(self.wal_device)
outdated_tags = []
for device, type in source_devices:
diff --git a/src/ceph-volume/ceph_volume/devices/lvm/zap.py b/src/ceph-volume/ceph_volume/devices/lvm/zap.py
index d4d78ad01..f512a3bde 100644
--- a/src/ceph-volume/ceph_volume/devices/lvm/zap.py
+++ b/src/ceph-volume/ceph_volume/devices/lvm/zap.py
@@ -10,6 +10,7 @@ from ceph_volume.api import lvm as api
from ceph_volume.util import system, encryption, disk, arg_validators, str_to_int, merge_dict
from ceph_volume.util.device import Device
from ceph_volume.systemd import systemctl
+from typing import List
logger = logging.getLogger(__name__)
mlogger = terminal.MultiLogger(__name__)
@@ -201,8 +202,11 @@ class Zap(object):
"""
if device.is_encrypted:
# find the holder
- holders = [
- '/dev/%s' % holder for holder in device.sys_api.get('holders', [])
+ pname = device.sys_api.get('parent')
+ devname = device.sys_api.get('devname')
+ parent_device = Device(f'/dev/{pname}')
+ holders: List[str] = [
+ f'/dev/{holder}' for holder in parent_device.sys_api['partitions'][devname]['holders']
]
for mapper_uuid in os.listdir('/dev/mapper'):
mapper_path = os.path.join('/dev/mapper', mapper_uuid)
diff --git a/src/ceph-volume/ceph_volume/devices/raw/common.py b/src/ceph-volume/ceph_volume/devices/raw/common.py
index 89ee285be..4863b9e18 100644
--- a/src/ceph-volume/ceph_volume/devices/raw/common.py
+++ b/src/ceph-volume/ceph_volume/devices/raw/common.py
@@ -46,7 +46,7 @@ def create_parser(prog, description):
)
parser.add_argument(
'--dmcrypt',
- action='store_true',
+ action=arg_validators.DmcryptAction,
help='Enable device encryption via dm-crypt',
)
parser.add_argument(