+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
Home Access Plus+ Thread, FSRM Quota in Projects:; x86 is for Windows Server 2003 or where the Drive Quota System is used. The x64 should be the one ...
  1. #16
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    x86 is for Windows Server 2003 or where the Drive Quota System is used. The x64 should be the one to use on most new servers.

    The Service Meta Data is on port 8011

  2. #17

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    The one attached to this thread won't install and both versions on the skydrive are x86, despite the name.

  3. #18
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    O, how odd, they shouldn't be, if they are installing that's a start

  4. #19

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    The file "HAP Quota Service Setup x86" from your skydrive is the only one that installs. Does this contain the test code?

    When I test with http://192.168.1.26:8011/HAPQuotaService using the test client, the function GetQuotaFromPath always returns -1 (for Free, Total and Used), with the path specified as e:\home\teststudent, or \\srv01\home\teststudent (or any other path).

    (BTW, if I enable the old disk quotas, the function GetQuota returns Total & Used (but Free as -1)).

    Thanks
    Moby
    Last edited by mobybrick; 5th August 2012 at 08:13 PM.

  5. #20

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    Hi Nick,

    I built a standalone EXE to test operation of the FSRM quota code and verified correct operation.

    If a UNC is entered in the string below in the following console application, the console works correctly. So as long as a full UNC is passed to GetQuota then everything should be fine. This makes me think that so far the WCFClientTest I have done is against a wrong build of the quota server. Could you rebuild this for me for x64 for another test?

    Hope this helps,
    Moby.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using DiskQuotaTypeLibrary;
    using Microsoft.Storage;
    using System.Runtime.InteropServices;
    using System.IO;
    using System.Management;

    namespace FSFRMAPITest1
    {
    class Program
    {
    static void Main(string[] args)
    {
    string path="\\\\srv01\\home\\teststudent";
    Console.WriteLine("{0}", path);
    IFsrmQuotaManager FSRMQuotaManager = new FsrmQuotaManager();
    IFsrmQuota Quota = null;
    long qFree = 0;
    long qTotal = 0;
    long qUsed = 0;
    try
    {
    Quota = FSRMQuotaManager.GetQuota(path);

    qFree = (int)Quota.QuotaLimit - (int)Quota.QuotaUsed;
    qUsed = (int)Quota.QuotaUsed;
    qTotal = (int)Quota.QuotaLimit;
    Console.WriteLine("1: {0} {1} {2}",qFree,qUsed,qTotal);
    }
    catch
    {
    try
    {
    Quota = FSRMQuotaManager.GetQuota(GetPath(path));

    qFree = (int)Quota.QuotaLimit - (int)Quota.QuotaUsed;
    qUsed = (int)Quota.QuotaUsed;
    qTotal = (int)Quota.QuotaLimit;
    Console.WriteLine("2: {0} {1} {2}", qFree, qUsed, qTotal);
    }
    catch
    {
    Console.WriteLine("3: Failed");
    }
    Console.WriteLine("This would return NULL");
    }

    }

    public static string GetPath(string uncPath)
    {
    try
    {
    // remove the "\\" from the UNC path and split the path
    uncPath = uncPath.Replace(@"\\", "");
    string[] uncParts = uncPath.Split(new char[] {'\\'}, StringSplitOptions.RemoveEmptyEntries);
    if (uncParts.Length < 2)
    return "[UNRESOLVED UNC PATH: " + uncPath + "]";
    // Get a connection to the server as found in the UNC path
    ManagementScope scope = new ManagementScope(@"\\" + uncParts[0] + @"\root\cimv2");
    // Query the server for the share name
    SelectQuery query = new SelectQuery("Select * From Win32_Share Where Name = '" + uncParts[1] + "'");
    ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
    Console.WriteLine("Here tom");
    // Get the path
    string path = string.Empty;
    foreach (ManagementObject obj in searcher.Get())
    {
    path = obj["path"].ToString();
    }

    // Append any additional folders to the local path name
    if (uncParts.Length > 2)
    {
    for (int i = 2; i < uncParts.Length; i++)
    path = path.EndsWith(@"\") ? path + uncParts[i] : path + @"\" + uncParts[i];
    }

    return path;
    }
    catch (Exception ex)
    {
    return "[ERROR RESOLVING UNC PATH: " + uncPath + ": "+ex.Message+"]";
    }
    }
    }
    }
    Last edited by mobybrick; 7th August 2012 at 11:29 PM.

  6. #21
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    Ok, I've rebuilt the Quota Service x64, in x64 mode, give it a try, it's on my skydrive: http://sdrv.ms/MCcsmf

  7. #22

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10

    Still won't install

    Hi Nick,

    Latest build still calls itself x86 version and still won't install with same message as before

    Moby

    FSRM Quota-hap-fail-install.jpg

  8. #23
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    Hmm, I can't see anything wrong with the installer, I've rebuilt it, and readded the references. HAP.Data.Quota should be 32bit, but the actual service should be 64bit.

  9. #24

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    There's something up with the installer I'm afraid. Even trying to install on a fresh new machine fails. Because the installer fails (and deletes any files it tried to copy) with the bad image format error, I can't test anything

    Event viewer shows:

    The description for Event ID 11001 from source MsiInstaller cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    If the event originated on another computer, the display information had to be saved with the event.

    The following information was included with the event:

    Product: HAP Quota Service x86 -- Error 1001. Error 1001. Exception occurred while initializing the installation:
    System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files\nb development\HAP Quota Service x86\HAP Quota Service.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format..
    (NULL)
    (NULL)
    (NULL)
    (NULL)
    (NULL)

    the message resource is present but the message is not found in the string/message table


    Do you need x64 versions of the dependancy dlls, or has there been any other change?

    M

  10. #25
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    Try this again, I've removed the custom action that was being used to register the service. You will need to browse to %programfiles%\nb development\HAP Quota Service and run Register.vbs.

    You will need to run Remove.vbs before you uninstall. I'm looking into why this is happening

  11. #26

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    Thanks for this. Now tested - but running GetQuotaFromPath and specifying either a local directory and a UNC both return -1 still

    Specifying an invalid UNC (e.g. \\madeupservername\share) causes a delay, which tells us that the code to switch to the UNC server search is working, but the code is returning -1 all of the time.

    In my working code above, the returns from the FSRM API are of type 'long' not int/double. Are we looking at a integer overload?

    M

  12. #27
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    Ok, give http://sdrv.ms/NgWSe1 a try, it's just the HAP.Data.Quota dll, it replaces the existing one in c:\pf\nbdev\hapqs

    -1 means either no quota or an error.

    If it still gives -1 check the application event log on the server, it should write the errors out to that

  13. #28

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    Hi Nick,

    Two entries are logged for both UNC or local path:

    If local path specified:

    System.Runtime.InteropServices.COMException (0x80045306): Exception from HRESULT: 0x80045306
    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 47

    Exception from HRESULT: 0x80045306

    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 47

    System.ArgumentException: Value does not fall within the expected range.
    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 34

    Value does not fall within the expected range.

    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 34


    If UNC path specified:

    System.Runtime.InteropServices.COMException (0x80045306): Exception from HRESULT: 0x80045306
    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 47

    Exception from HRESULT: 0x80045306

    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 47

    System.ArgumentException: Value does not fall within the expected range.
    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 34

    Value does not fall within the expected range.

    at Microsoft.Storage.FsrmQuotaManagerClass.GetQuota(S tring Path)
    at HAP.Data.Quota.WCFService.GetQuotaFromPath(String path) in h:\Documents\Visual Studio 2010\Projects\CHS Extranet\HAP.Data.Quota\WCFService.cs:line 34

  14. #29
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,468
    Thank Post
    37
    Thanked 483 Times in 415 Posts
    Rep Power
    109
    Give http://sdrv.ms/OWrnGt a try, I think I've gotten it working now :-)

    When using the WCF Test, you need to escape the backslashes, so \\server\share becomes \\\\server\\share

    I've tested it on one of my servers and it seems to work

  15. #30

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    10
    Hi Nick,

    All looks good on the latest.

    Thanks - let me know if you want me to test anything else

    Moby

SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [fsrm] set quota for sub dir by cmd line
    By RabbieBurns in forum Windows Server 2008 R2
    Replies: 7
    Last Post: 20th June 2011, 11:23 PM
  2. FSRM Disk Quotas
    By Newton in forum Windows Server 2000/2003
    Replies: 6
    Last Post: 16th June 2009, 09:25 PM
  3. Quotas and File type Blocking like FSRM
    By amfony in forum *nix
    Replies: 2
    Last Post: 18th May 2008, 05:49 AM
  4. Quotas
    By british-wave in forum How do you do....it?
    Replies: 7
    Last Post: 14th February 2006, 05:31 PM
  5. User Disk Quotas 2K3 Server
    By Roger in forum Wireless Networks
    Replies: 2
    Last Post: 2nd November 2005, 11:56 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •