Bug 1618460 - restorecon calls break OSD provisioning
Summary: restorecon calls break OSD provisioning
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Volume
Version: 3.1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: 3.*
Assignee: Alfredo Deza
QA Contact: Parikshith
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-16 17:23 UTC by Alfredo Deza
Modified: 2019-03-18 02:27 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-18 02:27:08 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1609427 0 urgent CLOSED ceph-volume does not set SELinux context of newly mounted filesystems 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1609430 0 urgent CLOSED [ceph 3.0] ceph-volume does not set SELinux context of newly mounted filesystems 2021-04-27 12:48:40 UTC
Red Hat Bugzilla 1636196 1 None None None 2024-06-27 07:40:34 UTC

Internal Links: 1609427 1609430 1636196

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


Note You need to log in before you can comment on or make changes to this bug.