I a plan to use Aegir (part of a BOA server) to host many sales sites, one site for one product.

I would like to know how to bulk-create 1000 sites using an existing platform in Aegir.

This apparently is not included in the Aegir handbook

If it may be more efficient, the other approach would be to clone 1000 sites from one existing site in Aegir.

I suppose that this can be accomplished either way using Drush, but how? It should use a list of domain names.

I've used software-as-a-service modules before to test this. This is what I use because I worked on/with these modules a lot so it's the most efficient route for me, but I don't think it would take anyone more than an hour to set up.

(This is a clone-based approach.)

Go to your hostmaster site and download the important modules:

drush dl hosting_variables hosting_saas
git clone --branch no-specifics https://github.com/PraxisLabs/hosting_restapi.git

Enable the modules, and set the site nid and platform nid in Hosting -> SaaS. (You can find the nid of a site or platform in the URL of their "edit" tab.)

Test the site creation with this bash command:

curl --data "url=test1.example.com&invoice=1" http://yourhostmasterurl/hosting/api/site

If this works, from there you can easily create 1000 sites with a simple bash script:

for ((i=2;i<=1000;i++));
do
   curl --data "url=test$i.example.com&invoice=$i" http://yourhostmasterurl/hosting/api/site
done

This would queue up clone creation for test2.example to test1000.example.com

Here's an article I wrote on using Aegir SaaS in production.

Alternatively, you can set up Hosting Services and use the REST API to queue up site creation tasks. I think this could take a few hours if you've never used it before.

  • what version of BOA/Aegir needs to be used for this SaaS setup? I'm currently using the recent [version BOA-3.0.1] – Yuri Apr 25 '16 at 1:02
  • Site creation test is not working: this is the command line output: see i.imgur.com/WpOWVxD.png – Yuri Apr 25 '16 at 5:18
  • Each 'product site' has its own unique domain name, not a subdomain so the cloning feature should read the domain names from a provided list in a file. The site names are the same as the domain names. Is that possible ? – Yuri Apr 25 '16 at 9:57
  • I use standard Aegir 3.4. I don't know how BOA interferes with this, could be due to nginx but I doubt it (I've mostly tested this on Apache). (Sorry I didn't see this in time, simpler to just follow up on drupal.org) – gboudrias Apr 30 '16 at 2:52
  • I don't have permission to comment on the above blog post, but most of the code necessary has recently been merged into Aegir SaaS (now a submodule of Aegir Services) and refined. – colan Nov 28 '16 at 15:24

Yes Drush is your friend here.

Examples from the import handbook and context import should be helpful.

There once was a feeds integration to create sites based uppon cvs or rss. But it has not been updated for Aegir 3.x.

Updates to the docs pages are always welcome ;)

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.