From: Varsha Rao Date: Wed, 4 Aug 2021 10:35:47 +0000 (+0530) Subject: src/vstart: create rgw export for nfs X-Git-Tag: v17.1.0~1152^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8a77e017fd2110ec9d7fbc0a33de0fb85f14cbca;p=ceph.git src/vstart: create rgw export for nfs Fixes: https://tracker.ceph.com/issues/51800 Signed-off-by: Varsha Rao --- diff --git a/src/vstart.sh b/src/vstart.sh index ec59790ce7223..b550bb882278f 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -1459,21 +1459,6 @@ osd pool create ec erasure ec-profile EOF fi -# Ganesha Daemons -if [ $GANESHA_DAEMON_NUM -gt 0 ]; then - pseudo_path="/cephfs" - if [ "$cephadm" -gt 0 ]; then - cluster_id="vstart" - prun ceph_adm nfs cluster create $cluster_id - prun ceph_adm nfs export create cephfs "a" $cluster_id $pseudo_path - port="2049" - else - start_ganesha - port="" - fi - echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint" -fi - do_cache() { while [ -n "$*" ]; do p="$1" @@ -1505,13 +1490,34 @@ EOF } do_hitsets $hitset +do_rgw_create_bucket() +{ + # Create RGW Bucket + local rgw_python_file='rgw-create-bucket.py' + echo "import boto +import boto.s3.connection + +conn = boto.connect_s3( + aws_access_key_id = '$s3_akey', + aws_secret_access_key = '$s3_skey', + host = '$HOSTNAME', + port = 80, + is_secure=False, + calling_format = boto.s3.connection.OrdinaryCallingFormat(), + ) + +bucket = conn.create_bucket('nfs-bucket') +print('created new bucket')" > "$CEPH_OUT_DIR/$rgw_python_file" + prun python $CEPH_OUT_DIR/$rgw_python_file +} + do_rgw_create_users() { # Create S3 user - local akey='0555b35654ad1656d804' - local skey='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==' + s3_akey='0555b35654ad1656d804' + s3_skey='h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q==' debug echo "setting up user testid" - $CEPH_BIN/radosgw-admin user create --uid testid --access-key $akey --secret $skey --display-name 'M. Tester' --email tester@ceph.com -c $conf_fn > /dev/null + $CEPH_BIN/radosgw-admin user create --uid testid --access-key $s3_akey --secret $s3_skey --display-name 'M. Tester' --email tester@ceph.com -c $conf_fn > /dev/null # Create S3-test users # See: https://github.com/ceph/s3-tests @@ -1542,8 +1548,8 @@ do_rgw_create_users() echo "" echo "S3 User Info:" - echo " access key: $akey" - echo " secret key: $skey" + echo " access key: $s3_akey" + echo " secret key: $s3_skey" echo "" echo "Swift User Info:" echo " account : test" @@ -1612,8 +1618,30 @@ if [ "$CEPH_NUM_RGW" -gt 0 ]; then do_rgw fi +# Ganesha Daemons +if [ $GANESHA_DAEMON_NUM -gt 0 ]; then + pseudo_path="/cephfs" + if [ "$cephadm" -gt 0 ]; then + cluster_id="vstart" + port="2049" + prun ceph_adm nfs cluster create $cluster_id + if [ $CEPH_NUM_MDS -gt 0 ]; then + prun ceph_adm nfs export create cephfs "a" $cluster_id $pseudo_path + echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint" + fi + if [ "$CEPH_NUM_RGW" -gt 0 ]; then + pseudo_path="/rgw" + do_rgw_create_bucket + prun ceph_adm nfs export create rgw "nfs-bucket" $cluster_id $pseudo_path + echo "Mount using: mount -t nfs -o port=$port $IP:$pseudo_path mountpoint" + fi + else + start_ganesha + echo "Mount using: mount -t nfs -o port= $IP:$pseudo_path mountpoint" + fi +fi - docker_service(){ +docker_service(){ local service='' #prefer podman if command -v podman > /dev/null; then @@ -1633,7 +1661,7 @@ fi else echo "cannot find docker or podman, please restart service and rerun." fi - } +} echo "" if [ $with_jaeger -eq 1 ]; then