public class CollectdServiceController extends OpsTreeBase {
private static final Logger log = LoggerFactory.getLogger(CollectdServiceController.class);
@Override
protected void addChildren() throws OpsException {
CollectdService model = OpsContext.get().getInstance(CollectdService.class);
if (Strings.isNullOrEmpty(model.dnsName)) {
throw new IllegalArgumentException("dnsName must be specified");
}
// We'd like to auto-gen the disk image, but we have to fix the problems involving pre-installing collectd (see
// below)
InstanceBuilder instance = InstanceBuilder.build(model.dnsName,
DiskImageRecipeBuilder.loadDiskImageResource(getClass(), "DiskImageRecipe.xml"), model.getTags());
instance.minimumMemoryMb = 512; // Make sure we have a bit more RAM, so that we can queue up a fair amount of
// RRD data
addChild(instance);
// We have some problems using collectd with debootstrap; I think it's when we're using FQDN and we can't