Comment 3 for bug 1853642

Revision history for this message
Bob Church (rchurch) wrote :

Directory permissions for/opt/platform/sysinv/19.09 are as follows.

controller-0:~$ ls -al /opt/platform/sysinv
total 12
drwxr-xr-x 3 root root 4096 Nov 21 22:40 .
drwxr-xr-x 12 root root 4096 Nov 21 23:01 ..
drwxr-xr-x 2 root root 4096 Nov 22 14:46 19.09

The traceback shows the sysinv-api is executing this ceph command:

Command: ceph osd getcrushmap -o /opt/platform/sysinv/19.09/crushmap_rule_update.bin
Exit code: 1
Stdout: ''
Stderr: "Can't open output file /opt/platform/sysinv/19.09/crushmap_rule_update.bin: [Errno 13] Permission denied: '/opt/platform/sysinv/19.09/crushmap_rule_update.bin'\n"". Detail:
Traceback (most recent call last):

  File "/usr/lib/python2.7/site-packages/wsmeext/pecan.py", line 85, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib64/python2.7/site-packages/sysinv/api/controllers/v1/storage_tier.py", line 257, in post
    new_tier = _create(self, tier)

  File "/usr/lib64/python2.7/site-packages/sysinv/api/controllers/v1/storage_tier.py", line 533, in _create
    self._ceph.crushmap_tiers_add()

  File "/usr/lib64/python2.7/site-packages/sysinv/common/ceph.py", line 407, in crushmap_tiers_add
    self._crushmap_add_tier(t)

  File "/usr/lib64/python2.7/site-packages/sysinv/common/ceph.py", line 390, in _crushmap_add_tier
    self._crushmap_rule_add(tier.name, replicate_by=replicate_by)

  File "/usr/lib64/python2.7/site-packages/sysinv/common/ceph.py", line 285, in _crushmap_rule_add
    stdout, __ = cutils.execute(*cmd, run_as_root=False)

  File "/usr/lib64/python2.7/site-packages/sysinv/common/utils.py", line 226, in execute
    cmd=' '.join(cmd))

ProcessExecutionError: Unexpected error while running command.
Command: ceph osd getcrushmap -o /opt/platform/sysinv/19.09/crushmap_rule_update.bin
Exit code: 1
Stdout: ''
Stderr: "Can't open output file /opt/platform/sysinv/19.09/crushmap_rule_update.bin: [Errno 13] Permission denied: '/opt/platform/sysinv/19.09/crushmap_rule_update.bin'\n"
: ProcessExecutionError: Unexpected error while running command.

With https://opendev.org/starlingx/config/commit/089cd3f420b7e9d5897fe4b811e4678432652ef4, the sysinv-api is no longer running with root group and this commit https://opendev.org/starlingx/ansible-playbooks/commit/dcdeea0254149233f1c0e5a6536a561cf7453cec has set permissions that will not allow the sysinv-api to write to this directory.

We need to do one of the following: change dir permissions or have the sysinv-api call the sysinv conductor to execute the command (the conductor has root permission).