we currently have two separate cpi methods for creating vms (create_vm) and setting metadata on the vms (set_vm_metadata). create_vm call does not receive necessary metadata to apply tags to the vm at creation time. potentially such functionality could be added in future. i would recommend adding an issue to https://github.com/cloudfoundry-incubator/bosh-aws-cpi-release.


On Thu, Aug 31, 2017 at 4:02 PM, ram sajja <s_vrk@outlook.com> wrote:
Hello Every one,

we are currently using bosh version 262.3. The question I have is on how bosh provisions ec2 instances in AWS through bosh-aws-cpi.

To give a little context on how provisioning on AWS used to happen

In March, AWS Blog announced two new features we’re implementing:
Ability to enforce required tags on RunInstances with IAM policy
Ability to include tags on RunInstances with API and CLI

Which means, before this date all provisioning was done in two steps:

ec2 run-instances --image-id <ami-id> --count 1 --instance-type t2.micro --subnet-id <subnet-id>

ec2-create-tags <instanceid> --tag "Name=<name_value>" --tag "App=<app_value>" --tag "AppOwner=<app_owner_value>" --tag "Environment=<env_value>"

The new workflow assured that instance creation and tag management can be done in a single call.

ec2 run-instances --image-id <ami-id> --count 1 --instance-type t2.micro --subnet-id <subnet-id> --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=<name_value>},{Key=App,Value=<app_value>},{Key=AppOwner,Value=<app_owner_value>},{Key=Environment,Value=<env_value>}]'

Bosh ( tested with version 262.3 ) still seem to be provisioning instances in multiple calls instead of a single one. Bosh is issuing 1 api call just to create the instance, and then following that up with a 2nd api call to create-tags.

Does anyone know if this is addressed in newer versions of bosh ? I looked at the code but did not seem like it and am not sure if this can be easily done ? any thoughts ?