Xsanity Sanity for Apple's Xsan and Final Cut Server.
  
Wednesday, May 22 2013 @ 06:18 AM EDT
Topics
Storage (39)
People (1)
Xsan (103)
How To (26)
User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User
Who's Online
Guest Users: 7
Sponsorship

Xsanity is proudly sponsored by:

Tekserve
The Old Reliable Mac Shop

Xsan quota from OD

 
Post new topic   Reply to topic    Xsanity Forums Forum Index -> Resharing
View previous topic :: View next topic  
Author Message
rstasel
Xsan Master
Xsan Master


Joined: 03 Aug 2007
Posts: 120

PostPosted: Fri Aug 03, 2007 12:18 pm    Post subject: Xsan quota from OD Reply with quote

Hey all,

So, unless I'm missing something completely obvious, it doesn't look like xsan will grab quota info from OD. This is somewhat perplexing and annoying, since I already have quota's set up for home directories that existed pre-san and I want to move them over.

At this point, is there anything left for me but to code up a shell script to plow through the directory, and then apply that quota to xsan using cvadmin?

Thanks!
Back to top
View user's profile Send private message Visit poster's website
soward
Could work for Apple
Could work for Apple


Joined: 30 Dec 2007
Posts: 42

PostPosted: Sun Dec 30, 2007 10:01 am    Post subject: Xsan quota from OD Reply with quote

Unfortunately you are not missing anything. A script to set the quota is pretty simple though, and probably best anyway if you have more than a handful of users.

However checking the quota is also problematic, especially if your users aren't CLI-savvy, or like many of mine, are using the storage remotely from windows, web, etc. I wound up writing a C wrapper for cvadmin to get a users quota so it could be used in a variety of ways -- cli, as a web cgi, inside 'dfree' so that the reported disk size of a users home directory is their quota (when mounted via SMB)
Back to top
View user's profile Send private message
rstasel
Xsan Master
Xsan Master


Joined: 03 Aug 2007
Posts: 120

PostPosted: Sat Feb 23, 2008 2:36 am    Post subject: Reply with quote

great. Yeah, this script was pretty easy.

Now the odd thing is that, the finder doesn't report quota. We have a 10TB Xsan, with 8.65TB available, and the finder for a user with a quota (hard and soft) set at 4GB reports "8.65TB available".

Of course, if the user tries to copy anything to their home folder and hits the hard limit, the finder chokes and says "you've hit quota", so obviously AFP knows what's going on (otherwise it would report something like "error writing file" or something like that).

Anyone have any ideas? Is this what others are seeing?

And why the hell did Apple still not give Xsan 2 the ability to pull quota info from OD?!? Unless it's there and they just don't talk about it in any of the manuals.
Back to top
View user's profile Send private message Visit poster's website
MattG
Xsan Master
Xsan Master


Joined: 15 Apr 2005
Posts: 456

PostPosted: Sat Feb 23, 2008 9:33 am    Post subject: Reply with quote

A bit of a copout workaround, but...

Autolaunch the Xsan User Quota app that is found on every node inside of /Applications/Server.

This way, the user refers to that app to get info on their quota.
Back to top
View user's profile Send private message Visit poster's website
rstasel
Xsan Master
Xsan Master


Joined: 03 Aug 2007
Posts: 120

PostPosted: Mon Feb 25, 2008 12:17 pm    Post subject: Reply with quote

these users aren't Xsan nodes... they're accessing the SAN over AFP, so I'm not sure that'll work. =/
Back to top
View user's profile Send private message Visit poster's website
rstasel
Xsan Master
Xsan Master


Joined: 03 Aug 2007
Posts: 120

PostPosted: Thu Feb 28, 2008 1:28 am    Post subject: Reply with quote

So seemingly, Quotas on an Xsan being reshared via AFP are a very bad thing.

Xsan knows about the quotas, but doesn't really tell anything else.

Example:

SAN is connected to an Intel Xserve, which reshares the volume over AFP. Quotas are set on the SAN, since you can't use normal quotas on the SAN. Connecting to the AFP server with a user that has a quota shows the user has some odd TB available (even though the quota is, say, 4 gig). Writing files on the AFP share until that limit is fine, then you get a "can't write file, you're at quota". Great! Except, the finder still says you have several TB available. So, basically, the finder and the rest of the OS has no idea you're at quota, only the AFP server knows that, but doesn't share that info with the client.

That's all great, except when the AFP server comes crashing down because the client starts flailing wildly trying to write temp files, or spotlight files, or cache files, preferences, etc, only to have the server say "no". But, the finder and OS just keep trying, over and over and over. AFP server slows to a crawl, and all clients are impacted (situation obviously becomes worse when you have multiple users logged in that are all over quota).

This is all with Xsan 1.4.2. Hopefully, because Apple is touting Xsan 2 as a valid storage solution for Home Directories, they will fix these quota issues. But, as it stands now, Xsan 1.x quotas suck for Network Home Directory storage. But, looking at the documentation for Xsan 2, it doesn't look like my initial issue has been addressed (Xsan grabbing quota info from OD). Here's hoping this issue is addressed.
Back to top
View user's profile Send private message Visit poster's website
mrtubz
RAID 5
RAID 5


Joined: 19 Mar 2008
Posts: 18

PostPosted: Wed Mar 19, 2008 5:41 pm    Post subject: Reply with quote

I am looking to setup XSan as a shared storage system for large design department.

The seem to be running out of space quite rapidly and need additional 'easy add' storage.

Im looking at porting their home directories onto the SAN and assigning AFP quota's to them on the primary OD server as some users are getting 80GB plus home directories and using all the space.

Question is: Does anyone know if home directory quotas set in OD are correctly enforced under Xsan 2. I know from past experience that they never worked properly under XSan 1.4. Has anyone tried this yet?

I be happy to hear from anyone that has.
Back to top
View user's profile Send private message Visit poster's website
staze
Been around the blocks
Been around the blocks


Joined: 15 Oct 2007
Posts: 25

PostPosted: Thu Mar 20, 2008 2:38 pm    Post subject: Reply with quote

From what I can see in the documentation, they are not... but, I haven't yet tried. =/ Upgrading to Xsan 2 I think is a summer break project... I would really like to see a point release before I make the plunge.

For what it's worth... an Apple rep did tell me that they wanted to implement pulling Quota info from OD, but he/she wasn't sure if it would make it into 2.0. The only issue I could see would be, which quota would the OD quota be... hard or soft?

I have a pretty easy php script that scrapes the OD for quota info, and then sets the quotas on the Xsan... (it sets the OD quota tot he soft quota, then I have a multiplier that sets the hard quota). I did PHP because I'm more familiar with how do deal with arrays in php than I am in sh.

Doh, apparently I have two accounts on the forums... staze == rstasel. =/
Back to top
View user's profile Send private message Visit poster's website
mrtubz
RAID 5
RAID 5


Joined: 19 Mar 2008
Posts: 18

PostPosted: Fri Mar 21, 2008 6:34 am    Post subject: Reply with quote

Thanks for the info staze, ill keep an eye out for any other posts on this. I really need to use a quota system for the users as they are beginning to have stupidly large homes full of junk.

Ill take a look at the php scripting as you suggested and see how I get on with that.
Back to top
View user's profile Send private message Visit poster's website
staze
Been around the blocks
Been around the blocks


Joined: 15 Oct 2007
Posts: 25

PostPosted: Fri Mar 21, 2008 4:28 pm    Post subject: Reply with quote

Here's what I have, sanitized (and yeah, I'm sure it could be optimized a bit more, but ultimately, the speed is entirely bottlenecked cvadmin... the creation of all the commands takes only a few seconds)...

Code:

#!/usr/bin/php
<?php

$parsed = array();
$i = 0;
$hardMultiplier = 1.5;
$timelimit = 4320;
$SAN = "youSANname";

exec('dscl /LDAPv3/you.ldap.server -list /Users HomeDirectoryQuota', $dsclOutput);

foreach ($dsclOutput as $thisUser) {
   $thisUser = (preg_split("/[\s]+/", $thisUser, -1));
   $parsed[$i]['username'] = $thisUser[0];
   $parsed[$i]['quota'] = $thisUser[1];
   $i++;
}

foreach ($parsed as $user) {
   $username = $user['username'];
   $softquota = $user['quota'];
   $hardquota = $softquota * $hardMultiplier;
   $command = 'cvadmin -F ' . $SAN . ' -e "quotas set user ' . "$username $hardquota $softquota $timelimit" . '"';
   //Uncomment line below (echo), and comment exec to make sure commands are created correctly.
        //echo $command . "\n";
   exec($command);
}
?>


Basically, it query's the OD server via dscl, grabs all the quota information. Then it takes that information and builds cvadmin commands, and runs them one at a time. I haven't tested to see if this is better or worse than using the cvadmin command file ability (to feed cvadmin a file full of commands). I'd imagine the file option would be faster since it isn't having to keep spawning cvadmin run a command, quit, spawn, run, quit, etc. But rather just start cvadmin once, then run everything. On our system, which has about 4600 users, it takes about 3-5 minutes for this script to run and do it's thing.

Good luck! Let me know if you have any questions about how it works.

-staze/rstasel
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Xsanity Forums Forum Index -> Resharing All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Best Viewed on a Mac | Suggested Browser: Whatever floats yer boat.