Skip to content

Instantly share code, notes, and snippets.

@misterdjules
Last active October 10, 2017 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misterdjules/9aabceee5a942d306831cde200834b74 to your computer and use it in GitHub Desktop.
Save misterdjules/9aabceee5a942d306831cde200834b74 to your computer and use it in GitHub Desktop.

Use triton.system_role tag

pros

  • Easy to implement.

cons

  • Tags are not used to express internal properties. A customer could set the smartdc_role=nfsvolumestorage tag at in stance creation time. So we'd have to special case this tag to not allow customers to set. This feels inconsistent with other tags.

Use VMs' internal_metadata

pros

  • Is actually internal, so cannot be set by customers.

cons

  • Not sure if the semantics would be clear with regards to internal_metadata properties that are arrays and objects. What would it mean to search on e.g the docker:cmd, docker:env or sdc:volumes internal_metadata properties?

Would a request like:

sdc-vmapi /vms?internal_metadata.docker:cmd=ls

match a docker:cmd internal_metadata of "[\"ls\",\"/data\"]"?

What about wanting to match the whole ls /data command? How would that work?

tasks

  • Implement searchable internal_metadata in VMAPI. That would require storing a copy of internal metadata in Moray that is searchable. Similar to what ZAPI-737 would be for tags.

Introduce new internal_role property

This was the original design for RFD 26, but we moved to using the smartdc_role tag due to a misunderstanding. See https://github.com/joyent/rfd/commit/933cef2bdcd2fb1a13cd7cb70e3b6cdb3c691c58 for the commits that changed that.

pros

  • Is actually internal, so cannot be set by customers.
  • Simple to implement, without potential issues that tags and internal_metadata would have.

cons

  • Not clear whether all the semantics are well defined and whether this should be applied to other VMs: would NAT and core services zone use that field?

    If so, would we need to move existing NAT and core services' VMs from using tags to using the new internal_role field? If yes, we'd need to have a data migration mechanism for this, which IIUC is not currently done by any service of Triton and would require a significant amount of work given all usage of smartdc_role: https://github.com/search?p=10&q=org%3Ajoyent+smartdc_role&type=Code.

    Would that need to be designed at the same time this feature is added, or could these use cases be implemented later?

Introduce new nfsvolumestorage boolean property

pros

  • Internal, cannot be set by customers.
  • Simple to implement.

cons

  • Seems too specific.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment