diff options
author | Gary Wu <gary.wu@futurewei.com> | 2019-06-21 16:16:18 -0700 |
---|---|---|
committer | Gary Wu <gary.wu@futurewei.com> | 2019-06-21 16:45:58 -0700 |
commit | 9bb778b5b90235e2136f75dcc43b6c9cb0266572 (patch) | |
tree | 142dddd26e43f4f76ccb036290f418f7c55e1fbe /deployment/heat/onap-rke/nfs_vm_entrypoint.sh | |
parent | 17797b454abdffc0815f919f556c93bf7339288d (diff) |
Make /dockerdata-nfs a ZFS volume with compression
Issue-ID: INT-1117
Signed-off-by: Gary Wu <gary.wu@futurewei.com>
Change-Id: I2b5cdb332702a3599b2faa4d180f68decb7a199b
Diffstat (limited to 'deployment/heat/onap-rke/nfs_vm_entrypoint.sh')
-rw-r--r-- | deployment/heat/onap-rke/nfs_vm_entrypoint.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/deployment/heat/onap-rke/nfs_vm_entrypoint.sh b/deployment/heat/onap-rke/nfs_vm_entrypoint.sh index 9dada99bc..b307023be 100644 --- a/deployment/heat/onap-rke/nfs_vm_entrypoint.sh +++ b/deployment/heat/onap-rke/nfs_vm_entrypoint.sh @@ -20,7 +20,9 @@ echo $HOST_IP `hostname` >> /etc/hosts printenv mkdir -p /opt/config +echo "__nfs_volume_id__" > /opt/config/nfs_volume_id.txt echo "__nfs_ip_addr__" > /opt/config/nfs_ip_addr.txt +echo "__nfs_private_ip_addr__" > /opt/config/nfs_private_ip_addr.txt echo "__k8s_vm_ips__" > /opt/config/k8s_vm_ips.txt echo "__k8s_private_ips__" > /opt/config/k8s_private_ips.txt echo "__public_net_id__" > /opt/config/public_net_id.txt @@ -83,11 +85,15 @@ sed -i 's|http://archive.ubuntu.com|http://nova.clouds.archive.ubuntu.com|g' /et while ! hash jq &> /dev/null; do apt-get -y update - apt-get -y install curl jq make nfs-kernel-server moreutils + apt-get -y install curl jq make nfs-kernel-server moreutils zfsutils-linux sleep 10 done -mkdir -p /dockerdata-nfs +nfs_volume_dev="/dev/disk/by-id/virtio-$(echo "__nfs_volume_id__" | cut -c -20)" + +zpool create -f -m /dockerdata-nfs dockerdata-nfs $nfs_volume_dev +zfs set compression=lz4 dockerdata-nfs +zfs set sharenfs="rw=*" dockerdata-nfs # update and initialize git git config --global user.email root@nfs @@ -102,11 +108,6 @@ git init git add -A git commit -m "initial commit" -# export NFS mount -echo "/dockerdata-nfs *(rw,fsid=1,async,no_root_squash,no_subtree_check)" | tee /etc/exports -exportfs -a -systemctl restart nfs-kernel-server - cd ~ |