Hi all,

I'm using jclouds (currently with EC2) and was wondering about the
ability to add tags to my compute nodes which I can then later
inspect. I tried the following, but that didn't work:

  TemplateBuilder templateBuilder = compute.templateBuilder();
  templateBuilder.hardwareId(InstanceType.T1_MICRO)
    .osFamily(OsFamily.AMZN_LINUX)
    .locationId(locationId)
    .options(TemplateOptions.Builder.tags(Arrays.asList("tag1", "tag2")))
    .options(TemplateOptions.Builder.inboundPorts(22, 8080))
    .options(TemplateOptions.Builder.runScript(AdminAccess.standard()));
  compute.createNodesInGroup("mygroup", 1, templateBuilder.build())

I would like to be able to read the tags from my nodes later, e.g.:
  for(ComputeMetadata node : compute.listNodes()) {
    Set<String> tags = node.getTags();
    if (!tags.contains("tag1"))
      continue;
  }

The node launches fine, but I find that the 'tags' I get from
node.getTags() never contains the tags I set on it...
Am I doing this wrong? Or is there another way to attach metadata to a node?

Thanks,

David

Reply via email to