Bug 1618460

Summary: restorecon calls break OSD provisioning
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Alfredo Deza <adeza>
Component: Ceph-VolumeAssignee: Alfredo Deza <adeza>
Status: CLOSED NOTABUG QA Contact: Parikshith <pbyregow>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 3.1CC: ceph-eng-bugs, ceph-qe-bugs, kdreyer, vumrao
Target Milestone: rc   
Target Release: 3.*   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-18 02:27:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alfredo Deza 2018-08-16 17:23:41 UTC
Description of problem: When BZ 1609430 was addressed, the patches were added without other pieces that are required for that to work. This means that any user trying to create a new OSD will not be able to do so


Version-Release number of selected component (if applicable): 3.0z5


How reproducible: 100% all the time


Steps to Reproduce:
1. Try to create an OSD with `ceph-volume lvm prepare` or `ceph-volume lvm create`

Actual results: The OSD is not created (or prepared), operation results in a non-zero exit status:

[2018-08-15 17:48:24,063][ceph_volume.devices.lvm.prepare][ERROR ] lvm prepare was unable to complete
[2018-08-15 17:48:24,064][ceph_volume.devices.lvm.prepare][INFO  ] will rollback OSD ID creation
[2018-08-15 17:48:24,064][ceph_volume.process][INFO  ] Running command: ceph osd purge osd.0 --yes-i-really-mean-it
[2018-08-15 17:48:24,925][ceph_volume.process][INFO  ] stderr purged osd.0
[2018-08-15 17:48:24,951][ceph_volume][ERROR ] exception caught by decorator
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 59, in newfunc
    return f(*a, **kw)
  File "/usr/lib/python2.7/site-packages/ceph_volume/main.py", line 153, in main
    terminal.dispatch(self.mapper, subcommand_args)
  File "/usr/lib/python2.7/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/main.py", line 38, in main
    terminal.dispatch(self.mapper, self.argv)
  File "/usr/lib/python2.7/site-packages/ceph_volume/terminal.py", line 182, in dispatch
    instance.main()
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/create.py", line 74, in main
    self.create(args)
  File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/create.py", line 26, in create
    prepare_step.safe_prepare(args)
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/prepare.py", line 217, in safe_prepare
    self.prepare(args)
  File "/usr/lib/python2.7/site-packages/ceph_volume/decorators.py", line 16, in is_root
    return func(*a, **kw)
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/prepare.py", line 278, in prepare
    osd_fsid,
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/prepare.py", line 64, in prepare_filestore
    prepare_utils.mount_osd(device, osd_id)
  File "/usr/lib/python2.7/site-packages/ceph_volume/util/prepare.py", line 193, in mount_osd
    system.set_context(destination)
  File "/usr/lib/python2.7/site-packages/ceph_volume/util/system.py", line 243, in set_context
    if which('restorecon').startswith('/'):
NameError: global name 'which' is not defined



Additional info: I am not sure what chain of commits would be needed for everything to work (one commit might require other dependent code) but at the very least this commit is the one that adds the `which()` function:

https://github.com/ceph/ceph/commit/293841271e806ee9fc641bf1d9999a407f1d4451

Comment 4 Alfredo Deza 2018-08-20 15:06:30 UTC
This ticket might not be a problem for 3.1 given that BZ 1609427 was ported correctly and doesn't show any symptoms of this problem