This is duplication of https://github.com/brooklyncentral/brooklyn/pull/812
Happy to merge this PR and then rebase my own pull request.