Wrong command `sudo -c ${CEPH_CONF_FILE} ceph`

Bug #1453055 reported by Accela Zhao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Accela Zhao

Bug Description

There looks to be a syntax error command in stable/juno devstack/lib/ceph: https://github.com/openstack-dev/devstack/blob/stable/juno/lib/ceph#L218

```
sudo -c ${CEPH_CONF_FILE} ceph osd pool set ${NOVA_CEPH_POOL} crush_ruleset ${RULE_ID}
```

Compared to another similar line 236: https://github.com/openstack-dev/devstack/blob/stable/juno/lib/ceph#L236

```
sudo ceph -c ${CEPH_CONF_FILE} osd pool set ${CINDER_CEPH_POOL} crush_ruleset ${RULE_ID}
```

The `ceph` is misplaced. Above command results below error when ./stack.sh (`PS4=':${0}:${LINENO}+' ./stack.sh`)

```
...
2015-05-08 02:14:14.052 | ::./stack.sh:344+echo -e Configuring Nova for Ceph
2015-05-08 02:14:14.052 | ::./stack.sh:24+configure_ceph_nova
2015-05-08 02:14:14.052 | ::./stack.sh:215+sudo ceph -c /etc/ceph/ceph.conf osd pool create nova 8 8
2015-05-08 02:14:14.952 | pool 'nova' created
2015-05-08 02:14:14.976 | ::./stack.sh:216+sudo ceph -c /etc/ceph/ceph.conf osd pool set nova size 3
2015-05-08 02:14:15.981 | set pool 5 size to 3
2015-05-08 02:14:16.014 | ::./stack.sh:217+[[ 3 -ne 1 ]]
2015-05-08 02:14:16.015 | ::./stack.sh:218+sudo -c /etc/ceph/ceph.conf ceph osd pool set nova crush_ruleset 1
2015-05-08 02:14:16.022 | usage: sudo -h | -K | -k | -V
2015-05-08 02:14:16.023 | usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
2015-05-08 02:14:16.023 | usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
2015-05-08 02:14:16.023 | [command]
2015-05-08 02:14:16.024 | usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
2015-05-08 02:14:16.024 | prompt] [-u user] [VAR=value] [-i|-s] [<command>]
2015-05-08 02:14:16.025 | usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
2015-05-08 02:14:16.025 | prompt] [-u user] file ...
2015-05-08 02:14:16.027 | :./stack.sh:1+exit_trap
2015-05-08 02:14:16.027 | :./stack.sh:439+local r=1
2015-05-08 02:14:16.028 | ::./stack.sh:440+jobs -p
2015-05-08 02:14:16.029 | :./stack.sh:440+jobs=
2015-05-08 02:14:16.029 | :./stack.sh:443+[[ -n '' ]]
2015-05-08 02:14:16.030 | :./stack.sh:449+kill_spinner
2015-05-08 02:14:16.030 | :./stack.sh:329+'[' '!' -z '' ']'
2015-05-08 02:14:16.030 | :./stack.sh:451+[[ 1 -ne 0 ]]
2015-05-08 02:14:16.030 | :./stack.sh:452+echo 'Error on exit'
2015-05-08 02:14:16.030 | Error on exit
2015-05-08 02:14:16.030 | :./stack.sh:453+[[ -z /opt/stack/logs ]]
2015-05-08 02:14:16.030 | :./stack.sh:456+/home/labadmin/workspace/devstack/tools/worlddump.py -d /opt/stack/logs
2015-05-08 02:14:16.084 | :./stack.sh:460+exit 1
```

The same problem exists in master branch, see https://github.com/openstack-dev/devstack/blob/master/lib/ceph#L282 vs
https://github.com/openstack-dev/devstack/blob/master/lib/ceph#L308

Revision history for this message
Accela Zhao (accelazh) wrote :

The local.conf I've been using is below. Devstack in stable/juno branch.
[[local|localrc]]
GIT_BASE=${GIT_BASE:-https://git.openstack.org}

ADMIN_PASSWORD=secrete
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=secrete
RECLONE=no

FIXED_RANGE=192.168.120.0/24
NETWORK_GATEWAY=192.168.120.1
FLOATING_RANGE=10.13.182.224/27
PUBLIC_NETWORK_GATEWAY=10.13.182.225
HOST_IP=10.13.182.120

# misc
API_RATE_LIMIT=False

# log
DEBUG=True
VERBOSE=True
DEST=/opt/stack
LOGFILE=$DEST/logs/stack.sh.log
SCREEN_LOGDIR=$DEST/logs/screen

SYSLOG=False
LOG_COLOR=False
LOGDAYS=7

# enable pre-requisites
enable_service rabbit
enable_service mysql
enable_service key

# keystone
KEYSTONE_CATALOG_BACKEND=sql

# enable ceph
enable_service ceph
CEPH_LOOPBACK_DISK_SIZE=10G
CEPH_CONF=/etc/ceph/ceph.conf
CEPH_REPLICAS=3
GLANCE_CEPH_USER=glance
GLANCE_CEPH_POOL=glance
CINDER_DRIVER=ceph
CINDER_CEPH_USER=cinder
CINDER_CEPH_POOL=cinder
CINDER_CEPH_UUID=65B06887-B0EA-427F-B8BD-829AC2E18FF6
CINDER_BAK_CEPH_POOL=cinder_bak
CINDER_BAK_CEPH_USER=cind_bak
CINDER_ENABLED_BACKENDS=ceph,lvm
NOVA_CEPH_POOL=nova

# adjust scheduler to balance VMs
SCHEDULER=nova.scheduler.simple.SimpleScheduler

# disable nova compute on controller node
disable_service n-cpu

# enable swift
enable_service s-proxy
SWIFT_HASH=E75834B828A54832B8AF2294FD8F5C5D
SWIFT_REPLICAS=3
SWIFT_DATA_DIR=$DEST/data/swift

# cinder
enable_service cinder
enable_service c-api
enable_service c-vol
enable_service c-sch
enable_service c-bak

VOLUME_GROUP="stack-volumes"
VOLUME_NAME_PREFIX="volume-"
VOLUME_BACKING_FILE_SIZE=10250M

# enable neutron
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-fwaas
enable_service q-lbaas
#enable_service q-vpn
enable_service neutron

# VLAN configuration
Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True

# GRE tunnel configuration
Q_PLUGIN=ml2
ENABLE_TENANT_TUNNELS=True

# VXLAN tunnel configuration
Q_PLUGIN=ml2
Q_ML2_TENANT_NETWORK_TYPE=vxlan

# enable ceilometer
enable_service ceilometer-acentral
enable_service ceilometer-collector
enable_service ceilometer-alarm-singleton
enable_service ceilometer-alarm-notifier
enable_service ceilometer-alarm-evaluator
enable_service ceilometer-api
CEILOMETER_BACKEND=mongodb

# enable heat
enable_service heat
enable_service h-api
enable_service h-api-cfn
enable_service h-api-cw
enable_service h-eng

# enable horizon
enable_service horizon

# enable tempest
enable_service tempest

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

Fix proposed to branch: master
Review: https://review.openstack.org/181469

Changed in devstack:
assignee: nobody → Accela Zhao (accelazh)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to devstack (master)

Reviewed: https://review.openstack.org/181469
Committed: https://git.openstack.org/cgit/openstack-dev/devstack/commit/?id=99de7cc1782ed00905068d0ec894ac08db5aa06f
Submitter: Jenkins
Branch: master

commit 99de7cc1782ed00905068d0ec894ac08db5aa06f
Author: Accela Zhao <email address hidden>
Date: Fri May 8 18:14:11 2015 +0800

    Fix wrong `sudo ceph -c` command in lib/ceph

    The `sudo -c ${CEPH_CONF_FILE} ceph ...` in lib/ceph misplaced
    `ceph`. The correct syntax is `sudo ceph -c ${CEPH_CONF_FILE} ...`,
    see lib/ceph:308.

    While installing ./stack.sh with ceph enabled, the above malformed
    command raises a `usage: sudo -h | -K | -k | -V ...` error and stops
    the installation.

    This patch fixes `sudo -c ${CEPH_CONF_FILE} ceph ...` by moving
    `ceph` to the right place.

    Change-Id: I3da943d5a353d99b09787f804b79c1d006a09d96
    Closes-bug: #1453055

Changed in devstack:
status: In Progress → Fix Released
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.