]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-daemon: make deploy work for osd (do a c-v prepare)
authorSage Weil <sage@redhat.com>
Mon, 30 Sep 2019 17:56:29 +0000 (12:56 -0500)
committerSage Weil <sage@redhat.com>
Fri, 4 Oct 2019 19:37:28 +0000 (14:37 -0500)
This is sufficient to deploy an OSD that is based on ceph-volume lvm.
YMMV if it's not an lvm-based OSD.

Run the OSD container privileged so we can open the raw block device.

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph-daemon

index 2177c0c81f2fd12301ba301efbde75cd15d64253..22ba52ecc0b5f0330790658b2312b7d3fca2c39e 100755 (executable)
@@ -169,6 +169,8 @@ def get_container(fsid, daemon_type, daemon_id):
     else:
         dname = daemon_type
     podman_args = []
+    if daemon_type == 'osd':
+        podman_args += ['--privileged']
     return CephContainer(
         image=args.image,
         entrypoint='/usr/bin/ceph-' + daemon_type,
@@ -239,6 +241,21 @@ def deploy_daemon(fsid, daemon_type, daemon_id, c, uid, gid,
             uid, gid,
             config, keyring)
 
+    if daemon_type == 'osd' and args.osd_fsid:
+        pc = CephContainer(
+            image=args.image,
+            entrypoint='/usr/sbin/ceph-volume',
+            args=[
+                'lvm', 'activate',
+                daemon_id, args.osd_fsid,
+                '--no-systemd'
+            ],
+            podman_args=['--privileged'],
+            volume_mounts=get_container_mounts(fsid, daemon_type, daemon_id),
+            cname='ceph-%s-activate-%s.%s' % (fsid, daemon_type, daemon_id),
+        )
+        pc.run()
+
     deploy_daemon_units(fsid, daemon_type, daemon_id, c)
 
 def deploy_daemon_units(fsid, daemon_type, daemon_id, c):
@@ -931,6 +948,9 @@ parser_deploy.add_argument(
 parser_deploy.add_argument(
     '--mon-ip',
     help='mon IP')
+parser_deploy.add_argument(
+    '--osd-fsid',
+    help='OSD uuid, if creating an OSD container')
 
 args = parser.parse_args()