Updated 2018-09-20: Not creating partitions on the /dev/sdb disk.
Original Post Published: 20 November 2014.
—————————————————————————————–
It was quite a while ago i had to create a Linux based NFS share for a 2 x vCloud Director (vCD) cell setup. For some reason Windows based NFS shares have been used during my latest vCD implementations.
Below are the steps i took when creating the NFS share and mounted it on the vCD cell.
NFS Server Preparation
- Add a new 100 GB disk to the virtual machine
- create file system with label vcd-nfs
- /sbin/mkfs.ext4 -L /vcd-nfs /dev/sdb
- If you create want to create a disk partition do the following:
- fdisk /dev/sdb
- c
- u
- n
- p
- 1
- accept default (press enter 2 times)
- w (for writing the changes)
- create file system on the newly created partition by running the below command:
- /sbin/mkfs.ext4 -L /vcd-nfs /dev/sdb1
- create a mount point
- mkdir /vcd-nfs
- mount the disk
- mount /dev/sdb1 /vcd-nfs/
- Create a file to the mount point to make sure everything looks good
- echo “NFS server test file” > /vcd-nfs/nfs01-test-file
- Adding the below line to the /etc/fstab file to make sure the disk is mounted during reboot
- LABEL=/vcd-nfs /vcd-nfs ext4 defaults 1 2
- Verify if the NFS server required packages were installed
- rpm -qa | grep nfs
- output shows both nfs-utils and nfs-utils-lib were installed
- If you need to install the NFS packages you can simply run:
- yum install nfs-utils nfs-utils-lib
- rpm -qa | grep nfs
- Make sure NFS and rpcbind will start automatically after reboot:
- chkconfig –list nfs
- output should be “nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off”
- If not, run the command “chkconfig nfs on“
- chkconfig –list rpcbind
- output should be: “rpcbind 0:off 1:off 2:on 3:on 4:on 5:on 6:off”
- chkconfig –list nfs
NFS Server Setup
- Export the newly created disk by adding the following line to the /etc/exports file
- vcd-nfs 192.168.246.0/24(rw,sync,no_root_squash,no_subtree_check)
- vcd-nfs is the NFS share
- 192.168.246.0/24 is the network to which i want to export the share to.
- rw is read-write
- sync – making sure that commit is send when the changes are completed
- no_root_squash – necessary since we will be mounting the NFS as user root from the vCD cells
- vcd-nfs 192.168.246.0/24(rw,sync,no_root_squash,no_subtree_check)
- Enable the NFS export:
- exportfs -a
- Verify the directory has been exported:
- showmount -e nfs01
- output should be “/vcd-nfs 192.168.246.0/24”
- showmount -e nfs01
NFC Client (vCD Cell) Preparation
- Verify if the NFS server required packages were installed
- rpm -qa | grep nfs
- output shows both nfs-utils and nfs-utils-lib were installed
- rpm -qa | grep nfs
- If you need to install the NFS packages you can simply run:
- yum install nfs-utils nfs-utils-lib
- Make sure rpcbind will start automatically after reboot:
- chkconfig –list rpcbind
- output should be “rpcbind 0:off 1:off 2:on 3:on 4:on 5:on 6:off”
- chkconfig –list rpcbind
NFC Client (vCD Cell) Setup
- Create a directory when you want to mount the NFS share:
- mkdir /nfs-mount-test
- Mount the NFS share:
- mount -t nfs 192.168.246.162:vcd-nfs /nfs-mount-test/
- 192.168.246.162 is the NFS server
- mount -t nfs 192.168.246.162:vcd-nfs /nfs-mount-test/
- Verify you got write access to the NFS share:
- echo “vCD cell NFS test” > /nfs-mount-test/vcd01-file
Since i will not mount the NFS share to the nfs-mount-test directory after installing vCD i removed the configuration
- umount /nfs-mount-test
- rm -rf /nfs-mount-test
After installing vCD, the NFS share should be mounted as the new vCD transfer area for the vCD cells and the mount point is /opt/vmware/vcloud-director/data/transfer
2 pings