StarCluster - Mailing List Archive

Re: [Starcluster] auto-mounting scratch drive in AMI creation

From: Dan Yamins <no email>
Date: Tue, 27 Jul 2010 18:13:47 -0400

> Right now I have created an AMI, but whenever I launch starcluster using
> that AMI, I have to manually log into that machine,
> mount that scratch drive, change permissions etc. (probably something like
> just write a script that runs when booting a new instance)
>

Abhijit, one way to solve your problem (and others like it ) is to use
starcluster's "plugin" feature.

See http://web.mit.edu/stardev/cluster/docs/plugins.html

This feature will allow you to write a short python script and configure
your cluster setup so that the script runs each time a cluster is started.


In your case, you might might want something like:


#######FILE $STARCLUSTER_HOME/plugins/myplugin.py######

from starcluster import clustersetup as cs

class mySetup(cs.ClusterSetup):

    def run(self, nodes, master, user, user_shell, volumes):

        master.ssh.execute("mount /dev/sdb scratch/") ##<- I'm
guessing about this line, it might not be quite right

######END FILE########################################

If you follow the online instructions and configure your cluster to use this
plugin like this:

[plugin MountSetup]
SETUP_CLASS = muplugin.mySetup

.
.
.

[cluster mycluster]
.
.
.

PLUGINS=MountSetup


.... then the plugin will be run whenver you start a cluster.

Obviously, there might be other better ways to solve your problem in
specific, but in general, any time you find that you haven't quite set up
your AMI right, you can always use a plugin as a faster and more flexible
way to solve the problem than recreating the AMI.



Dan
Received on Tue Jul 27 2010 - 18:13:48 EDT
This archive was generated by hypermail 2.3.0.

Search:

Sort all by:

Date

Month

Thread

Author

Subject