Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

NFS EFS

Discussion in 'Workarounds and Optimization' started by NDC Support Team, Feb 15, 2018.

Tags:
  1. NDC Support Team

    NDC Support Team Registered

    Joined:
    Feb 15, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Nelson BC, Canada
    cPanel Access Level:
    Root Administrator
    We've been doing some testing trying to get WHM/cPanel working in a modern cloud environment workflow like one would use on AWS, while taking advantage of the more advanced pieces like using EFS, S3, and more.

    Our findings have been mixed and I wanted to report back here and discuss with others interested in similar ventures.

    -------------------------------------------------------------
    Backups directly to S3 (100%) [positive: +]

    Mounting an s3 bucket as a drive directly at the backup directory location works flawlessly, all our backups go directly to the s3 bucket without any issue eliminating the pain and cost of keeping decent retention or eating up system drive space. Major win.
    (Needed for 100%: Nothing. It works.)
    -------------------------------------------------------------

    -------------------------------------------------------------
    Home directories on EFS (90%) [mixed: +/-]

    Mounting the home directory to efs not so well.
    cPanels official support response is that they don't support nfs and require flock support.
    All my direct flock tests on efs work and come back properly.

    Digging deeper into the actual errors whm and cpanel fail creating the users etc on efs.

    Creating an account on an EBS (virtual regular drive) home directory works and rearranging the account to the EFS, then copying the etc directory back to the original location and symlinking it into the efs account directory makes everything work like a charm again. Just make sure permissions all match between the two directories. I'm assuming that a cpanel postwwwacct script could do this process automatically but haven't looked into writing one yet. (can anyone help with that piece?)

    Really the main pain point in the process is that cpanel doesn't allow the specifying of which home directory to use manually from the mounted home directories when creating an account (why? wtf?) not sure how such a crucial feature got missed, but this isn't the first time or reason we've needed it. automatically using the largest home then having to rearrange is a very lame workflow. so with whm as it is, you have to change the home directory settings to only use the EBS, create the account, then change the settings back and rearrange, then move and link the etc. the reason is that the efs is unlimited and will always have more free space, but we only want to make accounts on the EBS as cPanel fails on the EFS. we don't always want to create accounts on the home with the most free space, that is a horrid assumption to force.

    Testing everything there are two whm/cpanel files need minor patching in order to be able to show the proper quota usage/reporting. This allows most quota features to work except hard quota enforcement. It will show if a user is over and warn them and you, but they can still add files. (This is acceptable for us, but might be a deal breaker for larger companies.)
    (Needed for 100%: Ability to specify which home directory to create a new account it, ability to automatically keep users etc directories in a second location and symlink them in., patching the two files for cpanel quota reporting, using NFSv4 soft quotas and soft locking, which the underlying tools cpanel uses already support, it appears to just be the cpanel/whm pieces that need to have the same changes made and check to make sure that versions of the underlying tools with the necessary support are installed aka old system checks.)
    -------------------------------------------------------------

    -------------------------------------------------------------
    Cloning WHM Instance Images (90%) [mixed: +/-]
    Everything works as expected except licensing. We've cloned several WHM AMI images during our discovery phase. Changing the configuration on the system and all the underlying technology that cPanel/WHM shoehorns together gets the server working just fine. We could not license the new server without contacting cPanel support directly because of various whm cpanel caching and how the licensing works. Once they clear whatever they need to on their end, the server can generate a new trial license and be licensed without issue. This could be resolved if whm/cPanel implemented a button to clear their internal caching, and a way to clear and force a relicense. running "/usr/local/cpanel/cpkeyclt" didn't fix anything for us until after they reset things on their end. some whm and cpanel caches only clear daily. There aren't any show stoppers here technology wise, just a few engineering changes would easily fix these issues.
    (Needed for 100%: Clear all internal server caches button, Licensing button)
    -------------------------------------------------------------

    Anyone had any success in these areas, or have any tips or tricks or scripts they'd like to share?
    Anyone hit any deal breakers or issues when trying these types of integrations?

    Discuss... :) Cheers.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,182
    Likes Received:
    1,756
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Thank you for taking the time to write up the well-detailed post. First, I encourage you to copy each request to an individual feature request using our feature request system at:

    Submit A Feature Request

    The forums are an excellent resource for user-feedback, but our feature request website is better if you'd like Development to see your requests and consider them for the addition of a new feature in the product.

    That said, there might be an existing solution for the following point:

    The following option is available in "WHM >> Basic WebHost Manager Setup":

    Enter the location where you wish for new users’ home directories to be created. By default all directories matching the "Home Directory Prefix" are checked for available disk space and the directory with the most free space will be used.

    Additional home directories matching the following value will also be used for new home directory creations. (Leaving this value blank disables the feature.) This option only takes one value.


    You could define the home directory you want to use with the first option, and then leave the second option blank if you don't want to have additional home directories matching the prefix in the first option to be scanned and utilized.

    Thank you.
     
  3. NDC Support Team

    NDC Support Team Registered

    Joined:
    Feb 15, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Nelson BC, Canada
    cPanel Access Level:
    Root Administrator
    Thanks for the tips. :)
    I will take the time to submit feature requests so that the dev team has access to them.

    The home directories we have:
    /home <= on EBS (smaller). accounts need to be made here
    /efs/home <= on EFS (larger). accounts need to be rearranged here after being made, not made here

    Is there any way to specify to make new accounts on the smaller home directory and still have both home directories set in the settings? (A manual selection drop down in the new account form would be ideal.)

    The EFS always reports max possible free space since it is unlimited, whereas the EBS reports actual size.
    Problem is when creating a new account cPanel automatically uses the largest home without providing any option to manually select one. The larger home is the incorrect one. If we don't have both in the settings we can't rearrange, hence we have to change the whm settings before and after each account creation in order to make this work. Does that make sense?
     
  4. NDC Support Team

    NDC Support Team Registered

    Joined:
    Feb 15, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Nelson BC, Canada
    cPanel Access Level:
    Root Administrator
    -------------------------------------------------------------
    AWS RDS MySQL/Aurora (0%) [none: -]
    You can't use an AWS RDS as a MySQL profile because the whm/cpanel script looks for superuser privilege which you can't get on an AWS RDS. All cpanel actually needs is the ability to create users and GRANT them ownership of their new databases, both of which are available to the AWS RDS user level. AWS RDS have everything the validation check in cPanel just don't know because it isn't actually checking for the specific permissions it needs rather is taking a shortcut and only checking for superuser.

    We had to setup and EC2 MySQL 5.6 server manually to be used as our MySQL profile which works well, just wish we could use an AWS RDS db server.

    cPanel / WHM won't work with MySQL 5.7 and looks like that isn't an easy fix and will require some more serious dev work.
    Can't test with Aurora the way whm validates permissions is changed.

    I think this piece could easily be resolved if the verification check is changed to check permissions instead of userlevel.

    (Needed for 100%: Check for GRANT instead of superuser)
    -------------------------------------------------------------

    Other Notes:
    Mounting the s3 bucket directly as a drive at /backup eliminates backups using up space on the local system and hence is a huge improvement to doing the backups on the system and using the built in s3 link to copy them.

    EFS performance is tied to size, so if your EFS is slow and you want better performance, make sure you have at least 1TB on your EFS and if not copy 1tb of dummy files onto the volume until you do.
     
  5. NDC Support Team

    NDC Support Team Registered

    Joined:
    Feb 15, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Nelson BC, Canada
    cPanel Access Level:
    Root Administrator
    Looks like this is done and on the way, hurray dev team, big highfives all around!
    Add support for MySQL 5.7
     
    cPanelMichael likes this.
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,182
    Likes Received:
    1,756
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can force the use of "/home" as part of the account creation, but only by disabling the "Additional home directories matching the following value will also be used for new home directory creations. (Leaving this value blank disables the feature.) This option only takes one value." option by entering a blank value. However, as you mentioned, that will then require you to enable the value you again when it comes time to rearrange the account. Thus, there's currently no support to do exactly what you are looking to do. We do have an existing feature request for this functionality at:

    Set home directory for reseller

    Note that it references "reseller" in the title, but the body actually notes the desire to do this for both resellers and roots (as part of a package feature). I encourage you to vote and add additional feedback to that request.

    Regarding the use of AWS RDS as a remote MySQL server, we have an existing feature request for this at the following URL (Note: I see you found it already, but linking it to increase awareness and votes from other users who see this thread):

    Support for AWS RDS as Remote MySQL Server

    Thank you.
     

Share This Page