2013-11-04 03:16 PM
You could use a 'human readable' style function to convert into from mb or gb into kb.
I've attached one I use, once imported replace the size variables you use in the quota command with humanReadableKb(input_size) instead of input_size.
Users can then pass in "2gb" or "100mb" or "1t" as valid values which are converted to kb for the command.
If you want users to enter just a number in Gb use something like this instead, humanReadableKb(input_size_gb + "Gb").
2013-11-05 05:23 AM
Mike..Thanks for the response.
I tried using your function but need some help. I have attached the workflows.
In both of the workflows, there is a field either called Share Size (GB) or Default Qtree Disk Quota (GB). In this field I just need the user to enter the value as a plain number on how much gig they want.
As of Now if I specify "1" in the fields, the quotas file shows as 1048576
I need it in this way though. If I enter 1, the quotas file to show as 1g . Can you help ?
2013-11-06 05:34 PM
Have you tried doing a string add instead, and passing the quota size parameter as input_size + 'g'?
I couldn't see which quota set command you were using from the attachments, but the default 7mode command assume integers so you can't pass strings. The powershell commands take strings so you could clone the existing command, and adjust the type from [int] to [string] and pass '1g' in and see if that works.
What's the reasoning for the formatting needing to be '1g' rather than a kilobyte value anyway? Could you just convert back in the WFA UI instead? Or does the quota file contents matter? I ask because you will loose any reservations cloning the in-built commands so will have a time-lag between set's and get's (one collection cycle of DFM+WFA).
2013-11-07 06:35 AM
Yes I did a string add. For some reason whatever I specify, it just converts in KB. Is it something to do with the API for quota ?
$DiskLimitOut = [string]$DiskLimit + "g"
Set-NaQuota -Type tree -Target $QtreePath -Volume $VolumeName -DiskLimit $DiskLimitOut
Our quotas contents do matter. We prefer it in "g" and it is easier for the eyes.