I had to create a new volume on a vfiler recently. This is a fairly straight-forward tasks for long term NetApp admins but I thought I’d write up the process for the next time that I forget. In this example the vfiler already exists and has been exported on a different subnet than the root vfiler, vfiler0. If you’re new to vfilers then you’ll immediately notice that once you change the vfiler context to the vfiler you want to add a volume to that you don’t have the option to create a new volume. The new volume needs to be created at the root vfiler level and then assigned to the vfiler you wish. In this example I am create a new ISO datastore on a vfiler context so that one of our tenants can have their own ISO datastore. We could present out the ISO datastore from vfiler0 but that would break the security model we worked hard to put in place.

The first thing to do is change the vfiler context and then run the vol command. You will see from this that it’s not possible to create the volume directly on the vfiler.

vfiler context <tenant-vfiler>
tenant-vfiler@NTAPcontroller> vol
The following commands are available; for more information
type "vol help "
offline             options             restrict            status
online
tenant-vfiler@NTAPcontroller> vol create iso01 aggr1 200g
vol: No such command "create".
The following commands are available; for more information
type "vol help "
offline             options             restrict            status
online

So go back to the parent vfiler, vfiler0, and then create the new volume. From there you can add it to the tenant-vfiler. Before transferring the volume to the tenant-vfiler I have also changed the options to make the volume thin provisioned using the “guarantee none” setting and also set fractional_reserve to 0. The commands used to create the new volume, modify the settings and add it to the tenant-vfiler were:

tenant-vfiler@NTAPcontroller> vfiler context vfiler0
NTAPcontroller> vol create iso01 -s volume aggr1 200g
NTAPcontroller> vol options iso01 guarantee none
NTAPcontroller> vol options iso01 fractional_reserve 0
NTAPcontroller> vol status iso01
  Volume State          Status            Options
  iso01 online          raid_dp, flex     create_ucode=on, convert_ucode=on,
                        mirrored  guarantee=none, fractional_reserve=0
                        64-bit
                        Volume UUID: 0df82cec-fdb8-11e4-a27a-123478563412
                Containing aggregate: 'aggr1'

NTAPcontroller> vfiler add tenant-vfiler /vol/iso01
WARNING: reassigning storage to another vfiler does not change the security information on that storage. If the security domains are not identical, unwanted access may be permitted, and wanted access may be denied.
Tue May 19 09:47:47 EST [NTAPcontroller:cmds.vfiler.path.move:notice]: Path /vol/iso01 was moved to vFiler unit "tenant-vfiler".
Tue May 19 09:47:47 EST [NTAPcontroller:export.auto.update.disabled:warning]: /etc/exports was not updated for iso01 when the vol destroy command was run. Please either manually update /etc/exports or copy /etc/exports.new to it.
NTAPcontroller>

<Update>

Another way to provision the volume is to perform the volume creation inline and enable VAAI also. Thanks to Sebastian Goetze for pointing this out.

NTAPcontroller> vol create iso01 -s none aggr1 200g

NTAPcontroller> vfiler run tenant-vfiler options nfs.vstorage.enable on

</Update>

The next thing from a vfiler perspective is to ensure that the volume is online. Change the vfiler context to the tenant the then check on the volume status.

NTAPcontroller> vfiler context tenant-vfiler
tenant-vfiler@NTAPcontroller> vol status
 Volume State       Status            Options
 iso01 online       raid_dp, flex     create_ucode=on, convert_ucode=on,
                    mirrored          guarantee=none, fractional_reserve=0
                    64-bit

The last thing you need to do from a storage perspective is to ensure the volume is presented to the correct network range with rw access, otherwise you’ll be able to mount the volume but not use write to it. Then it’s off to vCenter to make sure you can add the new volume. The set to edit the exports file for the vfiler involves going to the root vfiler and entering the advanced mode. Then you’ll need to read the /etc/exports from the vfiler, copy to notepad and add the address range for access, write a new /etc/exports for the vfiler and lastly you’ll need to push the update out after the write has taken place.

NTAPcontroller> priv set advanced
Warning: These advanced commands are potentially dangerous; use
         them only when directed to do so by NetApp
         personnel.
NTAPcontroller*> rdfile /vol/tenant-vfiler/etc/exports
/vol/nfs01      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs02      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs03      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs04      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/iso01      -sec=sys,rw=
NTAPcontroller*> wrfile /vol/tenant-vfiler/etc/exports
/vol/nfs01      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs02      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs03      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs04      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/iso01      -sec=sys,rw=192.168.1.0/24,anon=0
read: error reading standard input: Interrupted system call
NTAPcontroller*> rdfile /vol/tenant-vfiler/etc/exports
/vol/nfs01      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs02      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs03      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/nfs04      -sec=sys,rw=192.168.1.0/24,anon=0
/vol/iso01      -sec=sys,rw=192.168.1.0/24,anon=0
NTAPcontroller*>

NTAPcontroller*> vfiler run tenant-vfiler exportfs -av
===== tenant-vfiler
Export did not change for /vol/nfs01
re-exported /vol/nfs01
Export did not change for /vol/nfs02
re-exported /vol/nfs02
Export did not change for /vol/nfs03
re-exported /vol/nfs03
Export did not change for /vol/nfs04
re-exported /vol/nfs04
unexported /vol/iso01
re-exported /vol/iso01
NTAPcontroller*> priv set

Next go to vCenter and select the ESX host you want to mount the ISO to. Select he Configuration tab, and then select Storage. Lastly click Add Storage. Select Network File System and click Next.

Add NFS Storage

Enter the vfiler IP/hostname, enter the volume name you just created and enter a datastore name for the new volume. Click Next.

Add NFS Storage path

Check the summary and click Finish

Add NFS Datastore

The new volume will be mounted as an NFS datastore from the tenant-vfiler.

Add NFS datastore

One thing to check before closing out the volume creation is to check the settings from your backup solution to ensure that the ISO datastore is backed up or not depending on your requirements. In my instance I’ve ensured the ISO folder wasn’t being backed up as it mainly contains VM templates and ISOs stored elsewhere and SnapProtect struggles to back up VM templates.

3 thoughts on “NetApp – Create a new volume on vFiler (7-mode)

  1. Pingback: NetApp – Create a new volume on vFiler (7-mode) « Virtual Notions | drewreeves

  2. Just a tiny suggestion: You create the volume explicitly with volume space guarantee and in the next line change it to ‘none’.
    Instead just do

    NTAPcontroller> vol create iso01 -s none aggr1 200g

    And don’t forget to enable VAAI if you haven’t done so yet:
    NTAPcontroller> vfiler run tenant-vfiler options nfs.vstorage.enable on

    Sebastian
    NCI (NetApp Certified Instructor)

    • Thanks very much for pointing that out Sebastian. I’ve updated the post to show this other method. I appreciate the feedback, I’m still getting to grips with 7-mode.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.