vFiler tunneling is a feature that enables an API to be invoked on a vFiler through the physical storage system on which the vFiler is contained. To access a vFiler, a user requires the IP address, user name, and password of the physical storage system alone.
This feature is supported by the -v option of the ontapi utility in the SDK.
vFiler tunneling is supported by Data ONTAP 7.2.1 and later. While using the API na_server_set_vfiler, the client has to specify the ONTAPI version 1.7 or later.
Before this feature was introduced, a user needed the IP address, user name, and password of both the actual storage system and the vFiler on which an API was to be invoked. It was a difficult task to maintain the details of the storage system and all the vFiler units on a network with a large number of vFiler units.
Example:
Vfiler tunneling in HTTP mode:
=======================
$ontapi filer1 -v vfiler1 root btcsmqa system-get-version
<results status="passed">
<version>NetApp Release 7.2.3: Thu Jul 5 11:21:28 PDT 2007</version>
</results>
Vfiler tunneling in HTTPS mode:
========================
$ontapi filer1 -v vfiler1 -s root btcsmqa system-get-version
<results status="passed">
<version>NetApp Release 7.2.3: Thu Jul 5 11:21:28 PDT 2007</version>
</results>
It allows any "vfiler-enabled" API to be used from the physical filer's (hosting-filer) IP address, which may be useful in some scenarios including when separate ipspaces are used.
Where can you locate the sample code for vFiler tunneling in SDK 3.0?
You can find the sample source code (vfiler_tunnel ) under
"src" folder written in three languages (C,Java&Perl)
While its great to be able to run the api equivalent of the vfiler context command, the reason given was because in order to issue API calls to a vfiler you needed both the IP and user information for both the vfiler and the hosting filer. I just did some tests with zexplore directly to a vfiler IP address and it worked exactly the way I would expect. I didnt need any infomation about/for the hosting filer.
Am I misreading things here, or is the information out of date ?
HTTP protocol is available in vfiler context, hence if API query has to be done using the default transport type(HTTP) then vFiler tunneling feature need not be used.
If the HTTPS transport type needs to be used for API query then direct connection to vfiler cannot be established. HTTPS is not supported in vFiler's context. In this scenario vFiler tunneling feature helps to use HTTPS transport type to make the API request on the vFiler via the hosting filer. The hosting filer intially accepts the API request and then it will forward the request to the vFiler. vFiler would send the response back to the hosting filer, and the hosting filer would send the API response to the client using HTTPS transport type.
I have an application that I origianlly wrote to apply quotas to a windows server. We have since migrated all the users to NetApp filers that are using vFilers to house the home directories.
I have followed the information in this thread and in the sample code supplied. When I try to set the quotas, it is still applying them to the phiscial filer and not the vFiler. I have traced thru the program and watched the elements as the variables are being assigned and all looks correct. Due to securtiy in our environment, HTTP has been disabled on all our filers and my applications use RPC for the API style.
Any suggestions?
Here is the code. I am reading a file to get the user and quota info. for this code i removed that part.
int CSetNetAppQuotasDlg::OnBnClickedButton1()
{
na_server_t* s = NULL;
na_elem_t* out = NULL;
char err[256];
int use_rpc = 0;
char szFilerName[32];
char szVFiler[32];
char* pVFiler;
char szUserName[128];
char szQtree[32];
char szQtreeType[16];
char szVol[32];
char *szFileBuf;
char szQuota[32];
char szQuotaThreshold[32];
long iRcdLen;
int retval;
m_bRestart = false;
long x=0;
strcpy( szUserName, "domain
unsername");
strcpy( szQtree, "");
strcpy( szQtreeType, "user");
strcpy( szFilerName, "pfilename");
strcpy( szVFiler, "vFilername");
strcpy( szVol, "vol1" );
strcpy( szQuota, "400000");
strcpy( szQuotaThreshold, "350000");
if( !bServerOpen)
{
bServerOpen = na_startup(err, sizeof(err));
return 2;
}
else
{
s= na_server_open(szFilerName,1,7); // API ver 1.7
na_server_style(s, NA_STYLE_RPC);
na_server_set_transport_type(s, NA_SERVER_TRANSPORT_HTTPS, 0);
if( strlen(szVFiler) >= 1 )
{
pVFiler = szVFiler;
retval = na_server_set_vfiler(s, szVFiler);
}
if( !retval )
{
CString szError;
szError.Format("\nError %d: %s\n", na_results_errno(out),
na_results_reason(out));
}
out = na_server_invoke( s, "quota-get-entry",
"qtree", szQtree,
"quota-target", szUserName,
"quota-type", szQtreeType,
"volume", szVol,
NULL);
int iResCode = na_results_errno(out);
if(na_results_errno(out) == EQUOTADOESNOTEXIST) // quota not found
{
out = na_server_invoke( s, "quota-add-entry",
"qtree", szQtree,
"quota-target", szUserName,
"quota-type", szQtreeType,
"volume", szVol,
"disk-limit", szQuota,
"threshold", szQuotaThreshold,
"soft-disk-limit", szQuotaThreshold,
NULL);
if(na_results_status(out) != NA_OK) // quota not found
{
CString szError;
szError.Format("\nError %d: %s\n", na_results_errno(out),
na_results_reason(out));
m_bRestart = true;
}
else
m_bRestart = true;
}
else
{
out = na_server_invoke( s, "quota-modify-entry",
"qtree", szQtree,
"quota-target", szUserName,
"quota-type", szQtreeType,
"volume", szVol,
"disk-limit", szQuota,
"threshold", szQuotaThreshold,
"soft-disk-limit", szQuotaThreshold,
NULL);
if(na_results_status(out) != NA_OK) // quota not found
{
CString szError;
szError.Format("\nError %d: %s\n", na_results_errno(out),
na_results_reason(out));
m_bRestart = true;
}
else
m_bRestart = true;
}
na_elem_free(out);
}
na_server_close(s);
fApplyQuotas.Close();
}
Thank you for your help.
Andy
vfiler tunneling feature is supported from Data ONTAP 7.2.1 onwards. Please make sure you are using the right version of ONTAP.
Thank you for the reply
The filers I'm working against are 3050Cs running OnTap 7.2.3
Andy