Metadata Widget Multivalue Selection Support

Registered by Pawel Skowron on 2014-10-15

Summary:

During Juno time frame the following blueprint was introduced:
    https://blueprints.launchpad.net/horizon/+spec/tagging (Widget for managing glance metadata dictionary).

Concept is described here:
    http://docs.openstack.org/developer/glance/metadefs-concepts.html

The feature was succesfully merged and provided unified and simplfied way of defining and applying metadata onto Images, Flavors, and Host Aggregates.

This particular blueprint enhances the feature to let a user select more than one value for given property.

Example I

    /etc/glance/metadefs/compute-host-capabilities.json consists of different host capabilities including including CPU featgures:

        cpu_info:features: {
            title: "Features",
            description: "Specifies CPU flags/features. Using this property you can specify the required set of instructions supported by a vm.",
            type: "array",
            items: {
                type: "string",
                enum: [
                    "aes",
                    "vme",
                    "de",
                    "pse",
                    "tsc",
                    "msr",
                    ....
                        ]
                    }
            }

Currently user can select only one feature e.g. "aes". This feature will allow user to select more than one feature thus force scheduler to pick up a host a host with additional features.

Example II

    /etc/glance/metadefs/compute-host-capabilities.json consists of different host capabilities including CPU models:

        "cpu_info:model": {
            "title": "Model", "
            description": "Specifies the CPU model. Use this property to ensure that your vm runs on a a specific cpu model.", "
            type": "string",
            "enum": [
                "Conroe",
                "Core2Duo",
                "Penryn",
                "Nehalem",
                "Westmere",
                "SandyBridge",
                "IvyBridge",
                "Haswell",
                "Broadwell",
                "Delhi",
                "Seoul",
                "Abu Dhabi",
                "Interlagos",
                "Kabini",
                "Valencia",
                "Zurich",
                "Budapest",
                "Barcelona",
                "Suzuka",
                "Shanghai",
                "Istanbul",
                "Lisbon",
                "Magny-Cours",
                "Valencia",
                "Cortex-A57",
                "Cortex-A53",
                "Cortex-A12",
                "Cortex-A17",
                "Cortex-A15",
                "Coretx-A7",
                "X-Gene"
                ]
            }

Currently user can select only one model. This feature will allow user to select alternative of different models e.g. "SandyBridge or IvyBridge". It will result with picking up a host with Cortex-A53 or Cortex-A57 CPU model.

Example III

The third example is the "advance usage scenario" where user is able to express the following written in pseudocode condition:

cpu_info:features = (avx or xop) and lm

The intention of the above statement is to select a host with enhanced vector instruction Intel or AMD 64 bits capable.

Today extra specs does not support that kind of compund expression that is why the example III is out of the scope of this blueprint.

Motivation:

The proposed change is important missing part of already included feature. Please see examples.

UX:

The feauture will use multi-value select boxes from Select2 library combined with bootstrap styling. Example can be find at https://fk.github.io/select2-bootstrap-css/, the second multivalue dropdown list.
Based on JSON schema information, in particular "operator" field a user will be informed which operator will be used accross seleted values.

Outside Dependencies:

Additional blueprints will be created:

Glance:

]Current JSON metadata schema will be updated to specify that a particular property is multi-value capable and what operator should be used:
- OR (or)
- AND (all-in).

glance/glance/api/v2/metadef_namespaces.py:

"operator": {
"type": "string",
"enum": [
"or",
"all-in",
None
]
},

The cpu_info:model property would be modified in the following way:

"cpu_info:model": {
    "title": "Model",
    "description": "Specifies the CPU model. Use this property to ensure that your vm runs on a specific cpu model.",
    "operator":"or",
    "type": "string",
    "enum": [
        "Conroe",
        "Core2Duo",
        "Penryn",
        "Nehalem",
        "Westmere",
        "SandyBridge",
        "IvyBridge",
        "Haswell",
        "Broadwell",
        "Delhi",
        "Seoul",
        "Abu Dhabi",
        "Interlagos",
        "Kabini",
        "Valencia",
        "Zurich",
        "Budapest",
        "Barcelona",
        "Suzuka",
         "Shanghai",
         "Istanbul",
         "Lisbon",
         "Magny-Cours",
         "Valencia",
         "Cortex-A57",
         "Cortex-A53",
         "Cortex-A12",
         "Cortex-A17",
         "Cortex-A15",
         "Coretx-A7",
         "X-Gene"
      ]
 },

Glance-client

No changes required,

Nova

Patches from the following bp need to be fully merged.

https://blueprints.launchpad.net/nova/+spec/add-all-in-list-operator-to-extra-spec-ops

Requirements Update Required:

Requirements will be upated to include http://ivaynberg.github.io/select2/

Doc Impact:

Currently existing documentation should be enhanced to provide additional information about multi-value select of Glance Metadata Catalog:

doc/source/metadefs-concepts.rst

Blueprint information

Status:
Complete
Approver:
David Lyle
Priority:
Low
Drafter:
Pawel Skowron
Direction:
Approved
Assignee:
Pawel Skowron
Definition:
Approved
Series goal:
Accepted for liberty
Implementation:
Implemented
Milestone target:
None
Started by
Pawel Skowron on 2014-11-20
Completed by
David Lyle on 2016-05-04

Related branches

Sprints

Whiteboard

amotoki (Nov 27, 2014) Generally looks good. Only a few questions below.
- I am not sure we need to cover multi-select and and/or features in a single blueprint? If the support of and/or is simple, it is not a problem. Let me just clarify.
- Does the related nova blueprint have a dependency to glance blueprint? If not, please share the link of the glance blueprint so that we can track the progress of the required blueprints?

Amotoki please have a look here:
https://blueprints.launchpad.net/glance/+spec/metadata-multivalue-operators-support
https://review.openstack.org/#/c/148213/

Gerrit topic: https://review.openstack.org/#q,topic:bp/metadata-widget-multivalue-selection,n,z

Addressed by: https://review.openstack.org/153210
    Metadata widget multivalue selection support

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.