[Starcluster] auto-mounting scratch drive in AMI creation

Dan Yamins dyamins at gmail.com
Tue Jul 27 18:13:47 EDT 2010


> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/starcluster/attachments/20100727/0e5e780a/attachment.htm


More information about the StarCluster mailing list