done
systemctl | grep system-ceph | grep -q .slice # naming is escaped and annoying
+# check ceph -s works (via shell w/ passed config/keyring)
+$SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \
+ ceph -s | grep $FSID
+
## ls
$SUDO $CEPH_DAEMON ls | jq '.[]' | jq 'select(.name == "mon.a").fsid' \
| grep $FSID
$SUDO $CEPH_DAEMON ls | jq '.[]' | jq 'select(.name == "mgr.x").fsid' \
| grep $FSID
-## exec (and ceph -s works)
-$SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \
- ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. -s | grep $FSID
-
## deploy
# add mon.b
$SUDO $CEPH_DAEMON --image $IMAGE deploy --name mon.b \
done
# add mgr.y
-$SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \
- ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. \
- auth get-or-create mgr.y \
+$SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \
+ ceph auth get-or-create mgr.y \
mon 'allow profile mgr' \
osd 'allow *' \
mds 'allow *' > $TMPDIR/keyring.mgr.y
systemctl is-active $u
done
for f in `seq 1 30`; do
- if $SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \
- ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. -s -f json-pretty \
+ if $SUDO $CEPH_DAEMON shell --fsid $FSID \
+ --config $CONFIG --keyring $KEYRING -- \
+ ceph -s -f json-pretty \
| jq '.mgrmap.num_standbys' | grep -q 1 ; then break; fi
sleep 1
done
-$SUDO $CEPH_DAEMON exec --fsid $FSID -n mon.a -- \
- ceph -k /var/lib/ceph/mon/ceph-a/keyring -n mon. -s -f json-pretty \
+$SUDO $CEPH_DAEMON shell --fsid $FSID --config $CONFIG --keyring $KEYRING -- \
+ ceph -s -f json-pretty \
| jq '.mgrmap.num_standbys' | grep -q 1
## run
##################################
-def command_exec():
- (daemon_type, daemon_id) = args.name.split('.')
- c = get_container(args.fsid, daemon_type, daemon_id,
- privileged=args.privileged)
- return subprocess.call(c.exec_cmd(args.command))
-
-##################################
-
def command_ceph_volume():
make_log_dir(args.fsid)
default=['bash'],
help='command')
-parser_exec = subparsers.add_parser(
- 'exec', help='run command inside a running daemon container')
-parser_exec.set_defaults(func=command_exec)
-parser_exec.add_argument(
- '--fsid',
- required=True,
- help='cluster FSID')
-parser_exec.add_argument(
- '--name', '-n',
- required=True,
- help='daemon name (type.id)')
-parser_exec.add_argument(
- '--privileged',
- action='store_true',
- help='use a privileged container')
-parser_exec.add_argument(
- 'command', nargs='+',
- help='command')
-
parser_ceph_volume = subparsers.add_parser(
'ceph-volume', help='run ceph-volume inside a container')
parser_ceph_volume.set_defaults(func=command_ceph_volume)