Github user andreaturli commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/634#discussion_r30396969
  
    --- 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 --
    
    I can see why you are doing that but for providers like SoftLayer we are 
probably (mis-)using this `userMetadata`
    Look at 
[userData.value](http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject)
 it is primaily used to pass data to the `postInstallScriptUri` 
    
    I think we need to consider `templateOptions.tags` instead as it looks more 
portable in jclouds. Thoughts?
    Wdyt?


---
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.
---

Reply via email to