Add tags to virtual machines #114
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As part of #113, with group support, we will want functionality to limit a group to a particular subset of VMs, for instance allowing a group to only manage a specific set of VMs.
Implement tags for VMs, which will provide groupings usable by the cluster for other purposes.
This can also have wider uses, for instance allowing search limits to be based off tags instead of VM names/UUIDs to simplify a larger fleet of VMs.
mentioned in issue #113
Should probably be implemented before #114, done based on existing VM meta configs. Worry about the integration with user RBAC later.
Tag support for VMs implemented in the forthcoming 0.9.26.
Tags can be manipulated like any other VM metadata feature via their own API endpoint (
/vm/{vm}/tags
) and CLI interface (pvc vm tag
). Tags can be added (pvc vm tag add
) or removed (pvc vm tag remove
) one-at-a-time, and in the CLI can be shown independent of other information withpvc vm tag get
. They can also be specified at VM definition time with the-g
/--tag
or-G
/--protected-tag
options which can be specified any number of times for multiple tags.Tags names are included in the main
pvc vm list
output, and more detailed information (identical to thepvc vm tag get
output) is shown in thepvc vm info
output if any tags are configured.Tags themselves are divided into two "types": "user" tags are all those set by the user via the API; "system" tags are not yet used, and will be reserved for those tags added by PVC itself. Only "user" tags can be manipulated via the API; "system" tags imply "protected" (below).
An additional field, "protected", allows users to define tags which cannot be removed except by very low-level manipulation of Zookeeper, or by undefining/removing the VM. The usecase here would be, for instance, tags to mark authorization, or immutable facts about the VM.
VM lists can be filtered by tag, similar to how they can be filtered by node or by state. The API field "tag" to the
/vm
endpoint provides this function, and the CLI exposes it via the-g
/--tag
option topvc vm list
.This fairly simple setup should provide plenty of flexibility for the use of tags going forward.
closed