Hi,
I have a drive mounted at C:\mountpoint\Kdrive. C:\ is not a cluster disk. I am trying to use Cluster API to add this disk to the cluster but it fails with the following errors:-
00000928.00000ce8::2016/03/10-04:59:51.637 INFO [RCM] rcm::RcmApi::CreateResource: (SQL Server (MSSQLSERVER), Disk Drive C:\mountpoint\KDrive\, 8836dfef-fa51-419d-960f-75965fed6cfd, Physical Disk)
00000928.00000ce8::2016/03/10-04:59:51.637 INFO [RCM] rcm::RcmGum::CreateResource(Disk Drive C:\mountpoint\KDrive\,8836dfef-fa51-419d-960f-75965fed6cfd,SQL Server (MSSQLSERVER))
00000304.00000554::2016/03/10-04:59:51.678 ERR [RES] Physical Disk <Disk Drive C:\mountpoint\KDrive\>: Open: Unable to get disk identifier. Error: 5023.
00000928.00000dc8::2016/03/10-04:59:51.678 INFO [RCM] HandleMonitorReply: OPENRESOURCE for 'Disk Drive C:\mountpoint\KDrive\', gen(0) result 0.
00000304.00000554::2016/03/10-05:00:12.208 ERR [RHS] Error 13 from ResourceControl for resource Disk Drive C:\mountpoint\KDrive\.
00000928.00000ce8::2016/03/10-05:00:12.208 WARN [RCM] ResourceControl(SET_PRIVATE_PROPERTIES) to Disk Drive C:\mountpoint\KDrive\ returned 13
I tried with various syntax for the Disk Drive path (with single \ and double \\) but nothing works. If I execute the same code with path like K:\ it works fine.
Code snippet:
try
{
// Create the resource. The resource name is "Disk Drive @:"
// where @ is the drive letter of a disk partition.
bstr_t bstr;
UTIL_Utf8ToWideChar (szDiskPath.data(), bstr);
int length = bstr.length ();
lpstrDiskPathW = new WCHAR[length + 1];
wcsncpy (lpstrDiskPathW, (const wchar_t*)bstr, length);
lpstrDiskPathW[length] = L'\0';
String strResName = "Disk Drive " + szDiskPath;
UTIL_Utf8ToWideChar(strResName.data(), bstr);
length = bstr.length ();
lpstrResourceNameW = new WCHAR[length + 1];
wcsncpy (lpstrResourceNameW, (const wchar_t*)bstr, length);
lpstrResourceNameW[length] = L'\0';
hResource = m_funcCreateClusterResource(hClusterGroup,
(LPCWSTR)lpstrResourceNameW,
L"Physical Disk",
0);
if( hResource == NULL )
{
m_log.error("CreateDiskResource: failed to create disk resource %s", strResName);
throw -1;
}
else
{
m_log.info("CreateDiskResource: created disk resource %s", strResName);
}
// Set the diskpath private property
// Begin property list used to set the DiskPath private property.
WCHAR szPropName[] = CLUSREG_NAME_PHYSDISK_DISKPATH;
typedef struct _DiskPathControl
{
DWORD dwPropCount;
CLUSPROP_PROPERTY_NAME_DECLARE(PropName,sizeof(szPropName)/sizeof(WCHAR));
CLUSPROP_SZ_DECLARE(DiskPathValue, sizeof(lpstrDiskPathW)/sizeof(WCHAR));
CLUSPROP_SYNTAX Endmark;
} DiskPathControl;
DiskPathControl DPC;
// Property Count
DPC.dwPropCount = 1;
// Property Name
DPC.PropName.Syntax.dw = CLUSPROP_SYNTAX_NAME;
DPC.PropName.cbLength = sizeof( szPropName );
wcsncpy (DPC.PropName.sz, (const wchar_t*)szPropName, DPC.PropName.cbLength);
// Property Value
DPC.DiskPathValue.Syntax.dw = CLUSPROP_SYNTAX_LIST_VALUE_SZ;
DPC.DiskPathValue.cbLength = sizeof( lpstrDiskPathW );
wcsncpy (DPC.DiskPathValue.sz, (const wchar_t*)lpstrDiskPathW, DPC.DiskPathValue.cbLength);
// Endmark
DPC.Endmark.dw = CLUSPROP_SYNTAX_ENDMARK;
DWORD cbSize = sizeof( DiskPathControl );
// End property list creation
// Set the diskpath private property
dwRC = m_funcClusterResourceControl( hResource,
NULL,
CLUSCTL_RESOURCE_SET_PRIVATE_PROPERTIES,
( void* ) &DPC,
cbSize,
NULL,
0,
NULL );
if( dwRC != ERROR_SUCCESS )
{
String err(dwRC);
m_log.error("AA_ClusterBase:: CreateDiskResource: failed to set the DiskPath property, error %s", err);
m_funcDeleteClusterResource( hResource );
m_funcCloseClusterResource( hResource );
hResource = NULL;
throw -1;
}
}
catch (...)
{
}
Is there a know limitation with the Cluster API for not supporting disks mounted on mountpoints?
BTW this works fine:
C:\>cluster res “Disk W:\Mount” /priv DiskPath=”W:\Mount”
Thanks,
Aditya