Access a sharedv4 volume outside of a Portwrox cluster

Access a sharedv4 volume outside of a Portwrox cluster
Photo by Ali Yasar isgoren / Unsplash

To access a sharedv4 volume outside of the Portworx cluster, add the allow_ips label to the volume you wish to export, specifying a semi-colon separated list of IP addresses of non-Portworx nodes you wish to mount your sharedv4 volume to:

$ /opt/pwx/bin/pxctl -j volume create datavol --sharedv4 --label name=data --size 500 --fs ext4 --repl 2 --nodes node1,node2
$ /opt/pwx/bin/pxctl -j volume update datavol --sharedv4_mount_options="vers=4.0"
$ /opt/pwx/bin/pxctl volume update datavol --label "allow_ips=<node3_ip>"
$ /opt/pwx/bin/pxctl host attach datavol
$ mkdir /mnt/datavol
$ /opt/pwx/bin/pxctl host mount --path /mnt/datavol datavol

$ mount | grep datavol
/dev/pxd/pxd229379759785727331 on /mnt/datavol type ext4 (rw,relatime,discard,data=ordered)

$ cat /etc/exports
/var/lib/osd/pxns/229379759785727331 node1(fsid=123e4567-e89b-12d3-002e-ebad1cb15563,rw,no_root_squash,no_subtree_check) node3(fsid=123e4567-e89b-12d3-002e-ebad1cb15563,rw,no_root_squash,no_subtree_check)

To mount the NFS shared volume on non-Portworx node(node3):

$ showmount -e node1
Export list for node1:
/var/lib/osd/pxns/229379759785727331 node1,node3

$ mkdir /mnt/data
$ mount -t nfs node1:/var/lib/osd/pxns/229379759785727331 /mnt/data
$ mount | grep data
node1:/var/lib/osd/pxns/229379759785727331 on /mnt/data type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=node3,local_lock=none,addr=node1)