ONTAP Discussions
ONTAP Discussions
Hi,
I'm trying to mount a volume on a deep hierarchy. For example: /a/long/mount/path/vol1.
If I use vserver setup -vserver vserver1 -storage I can create this long junction path, but I don't want to use the interactive wizard.
Without mounting the root volume from a client, how do I create the parent directories on the vserver root volume?
Cheers,
Greg
Solved! See The Solution
Sorry to drag up an old thread, but I've found nothing more recent than this discussion and I've also checked the KB and 8.3 Best Practice CIFS guide without finding anything useful.
I too have been trying to overcome this problem today, and here's what I've come up with instead of using API calls and works entirely within the CLI.
# Create a QTree in the SVM root volume
qtree create -vserver VS1 -volume VS1_root -qtree SUBFOLDER
# Mount a volume to the QTree
mount -vserver VS1 -volume volData -junction /SUBFOLDER/volData
This allows you to create a second level mount against a folder (QTree) rather than creating a stub volume and also without resorting to API calls or PowerShell scripts to overcome it. Hope this is of use to someone.
Create a new 20MB volume and mount it to /namespace.
Then mount all of your volumes under that.
So they would be /namespace/volname.
Thanks for the quick response. Although what you propose will work, I don't want to waste my valuable number of volumes creating mount points. I'm sure that there is a cleaner way to do this.
System manager creates a vol folder under the root vol that could be used.
Otherwise, you're stuck with mounting the vsroot and adding the folder manually.
That can't be the only way. The vserver setup command will create parent paths as deep as you want:
cstor-001::*> vserver setup -vserver vserver1 -storage
Welcome to the Vserver Setup Wizard, which will lead you through
the steps to create a virtual storage server that serves data to clients.
You can enter the following commands at any time:
"help" or "?" if you want to have a question clarified,
"back" if you want to change your answers to previous questions, and
"exit" if you want to quit the Vserver Setup Wizard. Any changes
you made before typing "exit" will be applied.
You can restart the Vserver Setup Wizard by typing "vserver setup". To accept a default
or omit a question, do not enter a value.
Step 1. Create a Vserver.
You can type "back", "exit", or "help" at any question.
Choose the Vserver data protocols to be configured {nfs, cifs, fcp, iscsi} [nfs]:
Choose the Vserver client services to be configured {ldap, nis, dns}:
Vserver vserver1's allowed protocol list has been modified to nfs
Step 2: Create a data volume
You can type "back", "exit", or "help" at any question.
Do you want to create a data volume? {yes, no} [yes]:
Enter the volume name [vol1]:
Enter the name of the aggregate to contain this volume {aggr1_stor001, aggr1_stor002, aggr1_stor003, aggr1_stor004} [aggr1_stor002]:
Enter the volume size: 2G
Enter the volume junction path [/vol/vol1]: /this/junction/path
It can take up to a minute to create a volume...
Volume vol1 of size 2GB created on aggregate aggr1_stor002 successfully.
Do you want to create an additional data volume? {yes, no} [no]: no
cstor-001::*> volume show -fields junction-path
vserver volume junction-path
-------- ------ -------------
vserver1
vol1 /this/junction/path
I'm pretty sure that the vserver setup wizard doesn't mount the volume and create a directory, so it must be doing something that creates directories on the rootvol.
Yep, it creates folders in the root vol.
That seems like a valid workaround for what you'd want to do.
You can re-run vserver setup on the same vserver at any time without worrying about losing stuff.
The problem is that it's a workaround. I don't want this to be interactive. All I want to know is the magic behind the vserver create wizard that creates directories in the rootvol.
The vserver setup command is using ZAPI calls. There is a ZAPI that allows folder creation, but no commands that I know of.
I'd suggest opening a support case and having the engineer file an RFE for this. Sounds like it could be a useful feature.
In the meantime, we have an SDK that might allow you to do what you want (though I prefer the apitest found with DFM/OnCommand). The ZAPI call is "file-create-directory."
Example:
[root@nfsv4-host /]# mount 10.61.100.102:/ /mnt
[root@nfsv4-host mnt]# ls | grep testdir
[root@nfsv4-host mnt]#
::*> vol create -vserver win2k8 -volume testdir -aggregate aggr2 -size 20MB -state online -type RW -policy default -junction-path /testdir/testdir
(volume create)
[Job 7026] Job is queued: Create testdir.
Error: command failed: [Job 7026] Job failed: Volume created successfully but not mounted. Reason: Failed to create or determine if a junction exists within volume 'root'. Error occurred with the
remaining junction path of '/testdir/testdir' for the given path of '/testdir/testdir' Reason: Junction create failed (2).
C:\Program Files\NetApp\DataFabric Manager\DFM\bin>apitest -t filer -h 10.61.100.100 -u vsadmin -p XXXXXXXX file-create-directory path /vol/root/testdir perm 0777
Testing: file-create-directory(path=/vol/root/testdir, perm=0777) Success (0.047 seconds)
[root@nfsv4-host mnt]# ls -la | grep testdir
drwxrwxrwx 2 root unixadmins 4096 Mar 19 10:32 testdir
::*> vol create -vserver win2k8 -volume testdir -aggregate aggr2 -size 20MB -state online -type RW -policy default -junction-path /testdir/testdir
(volume create)
[Job 7028] Job succeeded: Successful
::*> vol show -vserver win2k8 -volume testdir -fields junction-path
(volume show)
vserver volume junction-path
------- ------- ----------------
win2k8 testdir /testdir/testdir
I can also create directories inside of the directories:
C:\Program Files\NetApp\DataFabric Manager\DFM\bin>apitest -t filer -h 10.61.100.100-u vsadmin -p XXXXXXXX file-create-directory path /vol/root/testdir/testdir2 perm 0777
Testing: file-create-directory(path=/vol/root/testdir/testdir2, perm=0777) Success (0.313 seconds)
So you could get creative... or open a case and ask for an RFE.
Thanks for your response. This is what I was expecting.
I'll certainly create that RFE.
Thanks again.
I was at customer site and we had to tweak the apitest syntax in order to get it to work.
apitest -t filer -v <SVM_NAME> -s <CLUSTER-NAME> admin <PASSWORD> file-create-directory path /vol/<SVM_ROOT_VOL_NAME>/<FOLDER1> perm 0777
Thank you for posting...did you use OnCommand 5.2 ? This might be a good reason to have an older DFM install along with 6 to get this functionality for systems without a NAS protocol to mkdir.
We used the apitest.exe from the NetappSDK. The version of apitest was 5.2.1r1.
Right. The syntax with the DFM apitest vs the SDK will differ. Good find though!
Mount command should create the full path
Sent from my iPhone 5
I'm afraid that I already tried this:
cluster1::*> volume mount -vserver vstor-001 -volume vol3 -junction-path /a/long/junction/path
Error: command failed: Failed to create or determine if a junction exists within volume 'rootvol1'. Error occurred with the remaining junction
path of '/a/long/junction/path' for the given path of '/a/long/junction/path' Reason: Junction create failed (2).
Yep, the path has to exist.
I know this is an old thread, but a similar problem in 8.3. This time there is no "vserver setup" anymore. So thought of sharing a solution I found for creating /vol on SVMs:
Power Shell:
Import-Module DataONTAP
Connect-NcController -Name
New-NcDirectory -VserverContext <vservername> -Permission 777 /vol/<vserverrootvolumename>/vol
Credit to the following threads:
http://community.netapp.com/t5/Data-ONTAP-Discussions/ls-command-on-C-Mode/td-p/32593
Sorry to drag up an old thread, but I've found nothing more recent than this discussion and I've also checked the KB and 8.3 Best Practice CIFS guide without finding anything useful.
I too have been trying to overcome this problem today, and here's what I've come up with instead of using API calls and works entirely within the CLI.
# Create a QTree in the SVM root volume
qtree create -vserver VS1 -volume VS1_root -qtree SUBFOLDER
# Mount a volume to the QTree
mount -vserver VS1 -volume volData -junction /SUBFOLDER/volData
This allows you to create a second level mount against a folder (QTree) rather than creating a stub volume and also without resorting to API calls or PowerShell scripts to overcome it. Hope this is of use to someone.
Yep, I agree that creating qtrees in the root volume is cleaner than creating useless stub volumes. Can be done from both CLI and GUI without having to rely on API.
I just mount vserver:/.admin from a Linux admin host and then you can create a directory. The admin host has to have 777 rights to / in the default export policy for the SVM.