Thanks for your quick patch and instant response.
From my testing, when no global security enabled, it works and tags have been added. But if enable the global security, it will pop out the errors like this:
=== Slave ===
$ java -jar slave.jar -jnlpUrl http://ec2-XX-XX-XX-xX.compute-1.amazonaws.com:8080/computer/XXXXXX-XXXXXX/slave-agent.jnlp
java.io.IOException: Failed to load http://ec2-XX-XX-XX-XX.compute-1.amazonaws.com:8080/computer/XXXXXX-XXXXXX/slave-agent.jnlp: 403 Forbidden
at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:261)
at hudson.remoting.Launcher.run(Launcher.java:215)
at hudson.remoting.Launcher.main(Launcher.java:189)
Waiting 10 seconds before retry
=== Master ===
INFO: While serving http://ec2-XX-XX-XX-XX.compute-1.amazonaws.com:8080/computer/XXXXXX-XXXXXX/slave-agent.jnlp: hudson.security.AccessDeniedException2: anonymous is missing the Slave/Connect permission
Besides, I also enabled the "Slave/Connect" permission for anonymous users. It still cannot work with 403 forbidden.
Then, I created one normal user with all permission, and use "-auth xxx:xxx" as a parameter in the command line. It seems that Master did not recognize the user and still consider it as anonymous.
So I am not sure whether the code has this logic now.
Thanks
Henry
Some more information about why this is happening.
Spot Instance Requests should be getting the tags assigned. The problem is that the tags do not then get passed on to the fulfilling instance. According to the AWS documentation this is the intended behavior (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-spot-instances-request-tags.html). It seems we need to manually pass on the tags from the Spot Request to the actual instance.