Project

General

Profile

Bug #36249

activate option --auto-detect-objectstore ignores --no-systemd

Added by Sébastien Han 3 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/28/2018
Due date:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

Running in a container, the command:

[root@osd0 /]# ceph-volume  lvm activate  1 840de0c9-bb63-479e-a42b-1a083570bac5 --auto-detect-objectstore
Running command: ln -snf /dev/journals/journal1 /var/lib/ceph/osd/ceph-1/journal
Running command: chown -h ceph:ceph /dev/journals/journal1
Running command: chown -R ceph:ceph /dev/dm-4
Running command: systemctl enable ceph-volume@lvm-1-840de0c9-bb63-479e-a42b-1a083570bac5
 stderr: Operation failed: No such file or directory
-->  RuntimeError: command returned non-zero exit status: 1

ceph-volume log file:

[root@osd0 /]# cat /var/log/ceph
[2018-09-28 13:45:49,075][ceph_volume.main][INFO  ] Running command: ceph-volume  lvm activate --no-systemd 1 840de0c9-bb63-479e-a42b-1a083570bac5 --auto-detect-objectstore
[2018-09-28 13:45:49,076][ceph_volume.process][INFO  ] Running command: /usr/sbin/lvs --noheadings --readonly --separator=";" -o lv_tags,lv_path,lv_name,vg_name,lv_uuid,lv_size
[2018-09-28 13:45:49,302][ceph_volume.process][INFO  ] stdout ";"/dev/VolGroup00/LogVol00";"LogVol00";"VolGroup00";"gqFct1-q2eW-5I7a-IQl2-g2Vm-Nsiq-B2CqHo";"<37.47g
[2018-09-28 13:45:49,302][ceph_volume.process][INFO  ] stdout ";"/dev/VolGroup00/LogVol01";"LogVol01";"VolGroup00";"T8lHub-uZnx-CX9A-354Z-Jd3P-fTPq-dve374";"1.50g
[2018-09-28 13:45:49,302][ceph_volume.process][INFO  ] stdout ceph.cephx_lockbox_secret=,ceph.cluster_fsid=769d3685-5ef4-4b81-a548-08c77342747b,ceph.cluster_name=ceph,ceph.crush_device_class=None,ceph.data_device=/dev/test_group/data-lv2,ceph.data_uuid=BjYhr6-5y9u-ORPd-I5OW-LuaM-KfPT-uxQftF,ceph.encrypted=0,ceph.journal_device=/dev/journals/journal1,ceph.journal_uuid=wFRPlY-k6RT-sLtF-OQ4p-nEU6-4GFD-PbTf9E,ceph.osd_fsid=840de0c9-bb63-479e-a42b-1a083570bac5,ceph.osd_id=1,ceph.type=journal,ceph.vdo=0";"/dev/journals/journal1";"journal1";"journals";"wFRPlY-k6RT-sLtF-OQ4p-nEU6-4GFD-PbTf9E";"<25.00g
[2018-09-28 13:45:49,302][ceph_volume.process][INFO  ] stdout ceph.cephx_lockbox_secret=,ceph.cluster_fsid=769d3685-5ef4-4b81-a548-08c77342747b,ceph.cluster_name=ceph,ceph.crush_device_class=None,ceph.data_device=/dev/test_group/data-lv1,ceph.data_uuid=eeLcye-0QTs-EKFN-o0Z8-8OuA-UoBN-eoLJGu,ceph.encrypted=0,ceph.journal_device=/dev/sdc1,ceph.journal_uuid=1c0d4350-127d-4dd0-bdd7-7fe7b14588eb,ceph.osd_fsid=0043c2ce-cea0-4530-a552-e3816663471c,ceph.osd_id=0,ceph.type=data,ceph.vdo=0";"/dev/test_group/data-lv1";"data-lv1";"test_group";"eeLcye-0QTs-EKFN-o0Z8-8OuA-UoBN-eoLJGu";"<25.00g
[2018-09-28 13:45:49,302][ceph_volume.process][INFO  ] stdout ceph.cephx_lockbox_secret=,ceph.cluster_fsid=769d3685-5ef4-4b81-a548-08c77342747b,ceph.cluster_name=ceph,ceph.crush_device_class=None,ceph.data_device=/dev/test_group/data-lv2,ceph.data_uuid=BjYhr6-5y9u-ORPd-I5OW-LuaM-KfPT-uxQftF,ceph.encrypted=0,ceph.journal_device=/dev/journals/journal1,ceph.journal_uuid=wFRPlY-k6RT-sLtF-OQ4p-nEU6-4GFD-PbTf9E,ceph.osd_fsid=840de0c9-bb63-479e-a42b-1a083570bac5,ceph.osd_id=1,ceph.type=data,ceph.vdo=0";"/dev/test_group/data-lv2";"data-lv2";"test_group";"BjYhr6-5y9u-ORPd-I5OW-LuaM-KfPT-uxQftF";"12.50g
[2018-09-28 13:45:49,302][ceph_volume.devices.lvm.activate][INFO  ] auto detecting objectstore
[2018-09-28 13:45:49,302][ceph_volume.devices.lvm.activate][INFO  ] found a journal associated with the OSD, assuming filestore
[2018-09-28 13:45:49,305][ceph_volume.util.system][INFO  ] /dev/test_group/data-lv2 detected as mounted, exists at destination: /var/lib/ceph/osd/ceph-1
[2018-09-28 13:45:49,305][ceph_volume.process][INFO  ] Running command: ln -snf /dev/journals/journal1 /var/lib/ceph/osd/ceph-1/journal
[2018-09-28 13:45:49,512][ceph_volume.process][INFO  ] Running command: chown -h ceph:ceph /dev/journals/journal1
[2018-09-28 13:45:49,719][ceph_volume.process][INFO  ] Running command: chown -R ceph:ceph /dev/dm-4
[2018-09-28 13:45:49,926][ceph_volume.process][INFO  ] Running command: systemctl enable ceph-volume@lvm-1-840de0c9-bb63-479e-a42b-1a083570bac5
[2018-09-28 13:45:50,135][ceph_volume.process][INFO  ] stderr Operation failed: No such file or directory
[2018-09-28 13:45:50,135][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 156, 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 40, 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/activate.py", line 332, in main
    self.activate(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/activate.py", line 252, in activate
    return activate_filestore(lvs)
  File "/usr/lib/python2.7/site-packages/ceph_volume/devices/lvm/activate.py", line 75, in activate_filestore
    systemctl.enable_volume(osd_id, osd_fsid, 'lvm')
  File "/usr/lib/python2.7/site-packages/ceph_volume/systemd/systemctl.py", line 59, in enable_volume
    return enable(volume_unit % (device_type, id_, fsid))
  File "/usr/lib/python2.7/site-packages/ceph_volume/systemd/systemctl.py", line 19, in enable
    process.run(['systemctl', 'enable', unit])
  File "/usr/lib/python2.7/site-packages/ceph_volume/process.py", line 153, in run
    raise RuntimeError(msg)
RuntimeError: command returned non-zero exit status: 1

History

#1 Updated by Alfredo Deza 3 months ago

  • Status changed from New to Verified

The problem here is that ``--auto-detect-objectstore`` was not meant to be run directly on the commandline, it was meant to be used by systemd. That explains why this wouldn't work: it doesn't make sense for the systemd unit not make sure this is enabled and running.

Sebastien: in what context do you need to have the objectstore automatically detected, vs passed-in ? Is this a custom systemd unit?

#2 Updated by Sébastien Han 3 months ago

If it's not meant to run on the commandline then please make sure it's not displayed as an argument.
I tried to use this command so I wouldn't need to pass --bluestore (even though it's the default) or --filestore on the osd activation.

If we can have this autodetection then perhaps we can remove --bluestore and --filestore so the activation will detect everything automatically when pointing to a specific OSD.
Thanks.

#3 Updated by Alfredo Deza 3 months ago

It is meant to be run on the commandline, but by systemd. It needs to be an argument because the systemd unit doesn't know.

Auto-detection of the objectstore requires some assumptions and it is entirely possible to get it wrong, which is why the flags exist: they would ensure correct activation
regardless of any assumption in-code.

I would suggest you use --filestore/--bluestore always, even though this is a valid issue.

#4 Updated by Sébastien Han 3 months ago

Yes, in the end, I used --bluestore and --filestore, but it would be nice to embed this in the code.
If we have this assumption for systemd then perhaps we should expose it wider.

#5 Updated by Alfredo Deza 2 months ago

  • Status changed from Verified to In Progress

#7 Updated by Alfredo Deza 2 months ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF