Github user ahgittin commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/634#discussion_r30518698
--- Diff:
locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
---
@@ -596,21 +599,35 @@ protected JcloudsSshMachineLocation
obtainOnce(ConfigBag setup) throws NoMachine
userCredentials = initTemplateForCreateUser(template,
setup);
}
- //FIXME initialCredentials =
initUserTemplateOptions(template, setup);
- for (JcloudsLocationCustomizer customizer :
getCustomizers(setup)) {
- customizer.customize(this, computeService, template);
- customizer.customize(this, computeService,
template.getOptions());
+ templateTimestamp = Duration.of(provisioningStopwatch);
+ // "Name" metadata seems to set the display name; at least
in AWS
+ // TODO it would be nice if this salt comes from the
location's ID (but we don't know that yet as the ssh machine location isn't
created yet)
+ // TODO in softlayer we want to control the suffix of the
hostname which is 3 random hex digits
+ template.getOptions().getUserMetadata().put("Name",
cloudMachineNamer.generateNewMachineUniqueNameFromGroupId(setup, groupId));
+
+ if
(setup.get(JcloudsLocationConfig.INCLUDE_BROOKLYN_USER_METADATA)) {
+
template.getOptions().getUserMetadata().put("brooklyn-user",
System.getProperty("user.name"));
+
+ Object context = setup.get(CALLER_CONTEXT);
+ if (context instanceof Entity) {
+ Entity entity = (Entity)context;
+
template.getOptions().getUserMetadata().put("brooklyn-app-id",
entity.getApplicationId());
+
template.getOptions().getUserMetadata().put("brooklyn-app-name",
entity.getApplication().getDisplayName());
+
template.getOptions().getUserMetadata().put("brooklyn-entity-id",
entity.getId());
+
template.getOptions().getUserMetadata().put("brooklyn-entity-name",
entity.getDisplayName());
+
template.getOptions().getUserMetadata().put("brooklyn-server-creation-date",
Time.makeDateSimpleStampString());
+ }
}
--- End diff --
SL userdata is not metadata. i think user metadata is different, possibly
ignored in softlayer? it does not seem to end up on a VM disk like userdata
does.
in any case user metadata isn't visible in the gui for softlayer, so i
added a tweak there to convert user metadata to tags. i think that's best for
clouds which don't support user metadata. (would be nice if jclouds could
communicate this!)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---