Skip to content
This repository was archived by the owner on Mar 2, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions proposals/include-metadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
- State: discussing
- Start date: ?
- End date: ?
- Docs: ?

# Summary

CPI should pass metadata information as part of create_vm, create_disk, create_snapshot call

# Motivation

To be able to use this metadata information e.g deployment_name/instance_group name during vm_creation.
VM CID can be prefixed with instance_group name so that it is easy to identify VM in vCenter.
Created disk could also be organized using this metadata information

# Details

Metadata will include basic information about director, deployment and instance_group. All the tags that is being sent as part of set_vm_metadata call right now.
E.g

```
{
director_name: "production-director",
director_uuid: "abcd-2134-5678"
deployment_name: "kafka",
instance_group: "my_instance_group",
}

```

create_vm interface will now be:

```create_vm(agent_id, stemcell_cid, cloud_properties, network_settings, disks, env, metadata)```

create_disk interface will now be:

```create_disk(size, cloud_properties, vm_locality, metadata)```

Information provided in metadata is right now passed as part of groups array inside env hash. CPI is not supposed to
rely on this information. Adding new argument metadata will make this data more reliable and useful for various IAAS.

There have been request for this from different IAAS as well. See Issue #[62](https://github.com/cloudfoundry/bosh-aws-cpi-release/issues/62), Issue #[1163](https://github.com/cloudfoundry/bosh/issues/1163)

# Drawbacks

Change to CPI contract

# Unresolved questions

How should set_vm_metadata and set_disk_metadat methods be updated?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they should (or need) to be updated. I'd expect them to remain the same and be called in the same places as they currently are. I think this is cheapest to support both older/newer CPIs and avoid director dealing with complex versioning behaviors, all with minimal impact to the actual IaaS calls. Happy to talk more about that if anyone has concerns or objections with that approach.

I think the general recommendation for CPIs should be "avoid making unnecessary metadata changes" to help cover scenarios where its going to be a no-op in the traditional create_vm + set_vm_metadata case. Although there's probably not much difference between querying for current tags and sending changed ones vs sending the full list of tags to the IaaS every time.


As suggested set_vm_metadata and set_disk_metadata could send metadata keys hich can change later after the initial create vm/disk/snapshot call.