StarCluster is a convenient way to manage HPC clusters on Amazon Web Services (AWS). If you use 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 1 for how much you spent on a specific tag. You need to enable detailed billing and pick your allocation tags, start by reading the Billing docs.
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
Second, at the bottom of your StarCluster configuration (typically
define the tags you want to attach. Take care in picking your tags, you
want everyone using the same tag key/values.
Finally, get your cluster to call the new plugin, by editing your cluster stanza:
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. ↩