StarCluster is a convenient way to manage HPC clusters on Amazon Web Services (AWS). If you use Billing docs.the same AWS account for multiple tasks such as hosting your web servers and its associated databases, running StarCluster how can you tell how much of your bill is from StarCluster? AWS lets you tag your detailed billing information, this can be used to get a feel* for how much you spent on a specific tag. You need to enable detailed billing and pick your allocation tags, start by reading the
There is also another reason to tag your resources in StarCluster - to utilize IAM resource-level permissions to restrict access, e.g. a IAM StarCluster user can only start/stop StarCluster, not terminate every EC2 instance in your account. This is a topic for another blog post, but requires tagging to help restrict permissions.
There are three steps to enable tagging within StarCluster:
- Save a custom plugin
- Configure the plugin in your config
- Add the plugin to your cluster stanza
First, save this custom plugin, which we call tagger, to $HOME/.starcluster/plugins/tagger.py
Finally, get your cluster to call the new plugin, by editing your cluster stanza:
# Various other settings
# Enable the following plugins
PLUGINS = tagger
Now when you launch your next cluster you will see a few extra lines in the output confirming tagger has run and you can check on the AWS Management console that EC2 instances and ELB volumes are now tagged.
*It is not possible to tag every resource or the resource is shared so how do you split the cost? The actual cost will likely be higher than just the resources you tag.