This repository was archived by the owner on Mar 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Include metadata as part of create_vm and create_disk #48
Open
nehagjain15
wants to merge
2
commits into
cloudfoundry-attic:master
Choose a base branch
from
nehagjain15:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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? | ||
|
|
||
| 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. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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_metadatacase. 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.