Volume create fails if old signature is found when using LVM driver

Bug #2023073 reported by Facundo Ciccioli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Incomplete
Medium
Unassigned

Bug Description

Volume creation fails with this traceback on cinder's logs (removed timestamps to ease a tad with readability):

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
    res = self.dispatcher.dispatch(message)
  File "/usr/lib/python3/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)
  File "/usr/lib/python3/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
    result = func(ctxt, **new_args)
  File "<decorator-gen-719>", line 2, in create_volume
  File "/usr/lib/python3/dist-packages/cinder/objects/cleanable.py", line 208, in wrapper
    result = f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cinder/volume/manager.py", line 815, in create_volume
    _run_flow()
  File "/usr/lib/python3/dist-packages/cinder/volume/manager.py", line 807, in _run_flow
    flow_engine.run()
  File "/usr/lib/python3/dist-packages/taskflow/engines/action_engine/engine.py", line 247, in run
    for _state in self.run_iter(timeout=timeout):
  File "/usr/lib/python3/dist-packages/taskflow/engines/action_engine/engine.py", line 340, in run_iter
    failure.Failure.reraise_if_any(er_failures)
  File "/usr/lib/python3/dist-packages/taskflow/types/failure.py", line 339, in reraise_if_any
    failures[0].reraise()
  File "/usr/lib/python3/dist-packages/taskflow/types/failure.py", line 346, in reraise
    six.reraise(*self._exc_info)
  File "/usr/lib/python3/dist-packages/six.py", line 719, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
    result = task.execute(**arguments)
  File "/usr/lib/python3/dist-packages/cinder/volume/flows/manager/create_volume.py", line 1203, in execute
    model_update = self._create_raw_volume(
  File "/usr/lib/python3/dist-packages/cinder/volume/flows/manager/create_volume.py", line 1166, in _create_raw_volume
    with excutils.save_and_reraise_exception():
  File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
    self.force_reraise()
  File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
    raise self.value
  File "/usr/lib/python3/dist-packages/cinder/volume/flows/manager/create_volume.py", line 1164, in _create_raw_volume
    ret = self.driver.create_volume(volume)
  File "/usr/lib/python3/dist-packages/cinder/volume/drivers/lvm.py", line 379, in create_volume
    self._create_volume(volume['name'],
  File "/usr/lib/python3/dist-packages/cinder/volume/drivers/lvm.py", line 208, in _create_volume
    vg_ref.create_volume(name, size, lvm_type, mirror_count)
  File "/usr/lib/python3/dist-packages/cinder/brick/local_dev/lvm.py", line 589, in create_volume
    self._run_lvm_command(cmd)
  File "/usr/lib/python3/dist-packages/cinder/utils.py", line 664, in _wrapper
    return r(f, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 423, in __call__
    do = self.iter(retry_state=retry_state)
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 360, in iter
    return fut.result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/lib/python3/dist-packages/tenacity/__init__.py", line 426, in __call__
    result = fn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cinder/brick/local_dev/lvm.py", line 173, in _run_lvm_command
    (out, err) = self._execute(*cmd_arg_list,
  File "/usr/lib/python3/dist-packages/os_brick/executor.py", line 53, in _execute
    result = self.__execute(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cinder/utils.py", line 172, in execute
    return processutils.execute(*cmd, **kwargs)
  File "/usr/lib/python3/dist-packages/oslo_concurrency/processutils.py", line 438, in execute
    raise ProcessExecutionError(exit_code=_returncode,
oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate -n volume-5ce6fdb6-9f34-4351-9bd6-839be36341b2 cinder-volumes-slow -L 12958g
Exit code: 5
Stdout: ''
Stderr: 'WARNING: dos signature detected on /dev/cinder-volumes-slow/volume-5ce6fdb6-9f34-4351-9bd6-839be36341b2 at offset 510. Wipe it? [y/n]: [n]\n Aborted wiping of dos.\n 1 existing signature left on the device.\n Failed to wipe signatures on logical volume cinder-volumes-slow/volume-5ce6fdb6-9f34-4351-9bd6-839be36341b2.\n Aborting. Failed to wipe start of new LV.\n'

This is the backend's configuration:

[LVM-something-slow]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir = /var/lib/cinder/volumes
volume_name_template = volume-%s
volume_group = cinder-volumes-slow
volume_backend_name = LVM-something-slow
lvm_type = default
volume_clear = zero
volume_clear_size = 50
target_helper = lioadm

This happens on a jammy/yoga deployment, cinder's version is 2:20.2.0-0ubuntu1.

One possible workaround if root access to the computes is available, is to set this:

wipe_signatures_when_zeroing_new_lvs = 0

on /etc/lvm/lvm.conf (default is 1).

A possible fix for this is to pass either --yes or --wipesignatures n to the lvcreate command issued by the driver on cinder/brick/local_dev/lvm.py [1].

[1] https://opendev.org/openstack/cinder/src/commit/c4b8956763c2759bd2b9fe511efac5b3edfb226d/cinder/brick/local_dev/lvm.py#L575

Tags: drivers lvm sts
tags: added: lvm
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
Rodrigo Barbieri (rodrigo-barbieri2010) wrote :

Facundo, could you please elaborate on steps to reproduce the issue?

I have deployed an env with cinder-lvm, applied the same settings, but volume creation succeeds for me

tags: added: sts
Changed in cinder:
status: New → Incomplete
tags: added: drivers
Revision history for this message
Erlon R. Cruz (sombrafam) wrote :

Hi Facundo,

The error is happening because the volume wasn't properly formated before being added to LVM. Or the LVM VGs are not cleaned built.

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.