«

»

Nov 20 2014

Create CentOS based NFS Share for vCloud Director

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 primary disk partition
    • fdisk /dev/sdb
    • c
    • u
    • n
    • p
    • 1
    • accept default (press enter 2 times)
    • w (for writing the changes)
  • create file system with label vcd-nfs
    • /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
  • 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”

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
  • 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”

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
  • 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”

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
  • 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 comments

  1. amyruby

    good….http://www.nfcbusinesscards.us/nfc-disc-tags/

  2. amyruby

    super….thanks for the post…
    http://www.nfcbusinesscards.us/nfc-disc-tags/

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">