> + public boolean apply(VirtualAppliance input) {
> + return input.getName().equals(group);
> + }
> + });
> +
> + // Create the group if still does not exist
> + if (!vapp.isPresent()) {
> + logger.debug(">> Creating group %s", group);
> + VirtualAppliance newVapp = VirtualAppliance.builder(context,
> vdc).name(group).build();
> + newVapp.save();
> + logger.debug("<< group(%s) created", newVapp.getId());
> + } else {
> + logger.debug(">> Using existing group(%s)", vapp.get().getId());
> + }
> +
> + return super.execute(group, count, template, goodNodes, badNodes,
> customizationResponses);
Thanks for the idea @demobox. I've been trying to implement this approach, but
the Template object is immutable and there is no way to inject new options to
it. Building a new Template seems to be not an option, as it would require
using the template builder and that will go through the entire image selection
process again, which is not good.
One possible option would be to expose a `virtualDatacenter` and
`virtualAppliance` method in the `AbiquoTemplateOptions`, but I'd prefer to
avoid that. The virtual datacenter should be configured through the location of
the selected hardware profile, and the virtual appliance should be read from
the group name. Exposing those methods could end in an inconsistent
configuration, and will make it too easy to do "the bad thing".
The more I think about it, the more I believe the cleanest approach might be
the second point mentioned in the PR description. WDYT?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/25/files#r6073514