Skip to content

Commit 3b54544

Browse files
committed
feat(hardware categorization): add description field to flavors
Allow flavors to have a user friendly description in them.
1 parent a64cf81 commit 3b54544

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

ansible/roles/nova_flavors/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ See the [UnderStack Flavors Design Guide](https://rackerlabs.github.io/understac
2323
```yaml
2424
name: m1.small.nicX
2525
resource_class: m1.small
26+
description: Small compute flavor with NICX network hardware - 16 cores, 128GB RAM, dual 480GB drives
2627
traits:
2728
- trait: NICX
2829
state: required
@@ -53,6 +54,7 @@ resource_class:
5354
- **vCPUs**: 16 (from device-type cpu.cores)
5455
- **RAM**: 131072 MB (from device-type memory.size)
5556
- **Disk**: 480 GB (from device-type drives[0].size)
57+
- **Description**: "Small compute flavor with NICX network hardware - 16 cores, 128GB RAM, dual 480GB drives" (from flavor.description)
5658
- **Extra Specs**:
5759
- `resources:VCPU='0'` - bare metal doesn't consume virtual CPU
5860
- `resources:MEMORY_MB='0'` - bare metal doesn't consume virtual memory

ansible/roles/nova_flavors/tasks/nova_flavors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
# Scheduling properties
8888
extra_specs: "{{ combined_extra_specs }}"
8989
is_public: true
90+
description: "{{ flavor_item.description | d('') }}"
9091
async: "{{ flavor_creation_timeout }}"
9192
poll: 0
9293
register: flavor_job

docs/design-guide/flavors.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Flavor definitions are YAML files validated against `schema/flavor.schema.json`.
4848

4949
### Optional Fields
5050

51+
* **description**: Human-readable description shown in Nova flavor details
5152
* **traits**: Array of trait requirements for hardware matching
5253
* **trait**: Trait name without `CUSTOM_` prefix (e.g., `NICX`, `GPU`, `NVME`)
5354
* Pattern: `^[A-Z][A-Z0-9_]*$` (uppercase alphanumeric and underscores)
@@ -61,6 +62,7 @@ Flavor definitions are YAML files validated against `schema/flavor.schema.json`.
6162
# yaml-language-server: $schema=https://rackerlabs.github.io/understack/schema/flavor.schema.json
6263
name: m1.small
6364
resource_class: m1.small
65+
description: Small compute flavor with 16 cores, 128GB RAM, and dual 480GB drives
6466
```
6567
6668
This matches all Ironic nodes with `resource_class=m1.small`, regardless of traits. Nova flavor properties (vCPUs, RAM, disk) come from the device-type's `m1.small` resource class definition.
@@ -72,6 +74,7 @@ This matches all Ironic nodes with `resource_class=m1.small`, regardless of trai
7274
# yaml-language-server: $schema=https://rackerlabs.github.io/understack/schema/flavor.schema.json
7375
name: m1.small.nicX
7476
resource_class: m1.small
77+
description: Small compute flavor with NICX network hardware - 16 cores, 128GB RAM, dual 480GB drives
7578
traits:
7679
- trait: NICX
7780
state: required

docs/operator-guide/flavors.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,30 @@ Start with the YAML language server directive for editor validation:
4343
# yaml-language-server: $schema=https://rackerlabs.github.io/understack/schema/flavor.schema.json
4444
name: m1.small
4545
resource_class: m1.small
46+
description: Small compute flavor with 16 cores, 128GB RAM, and dual 480GB drives
4647
```
4748
4849
**Required Fields**:
4950
5051
* `name`: Unique flavor name (e.g., `m1.small`, `compute.standard`)
5152
* `resource_class`: Must match a resource class defined in a device-type
5253

54+
**Optional Fields**:
55+
56+
* `description`: Human-readable description shown in Nova flavor details
57+
* `traits`: Hardware trait requirements for filtering nodes (see below)
58+
5359
**Note**: Nova flavor properties (vCPUs, RAM, disk) are automatically derived from the device-type resource class specification for convenience. Nova performs scheduling by matching the resource class and traits on Ironic nodes. See the [OpenStack Ironic flavor configuration documentation](https://docs.openstack.org/ironic/latest/install/configure-nova-flavors.html) for details.
5460

55-
### 3. Add Trait Requirements (Optional)
61+
### 3. Add Optional Description and Trait Requirements
5662

57-
Define hardware trait requirements to filter which nodes match this flavor:
63+
Add a description and/or hardware trait requirements to filter which nodes match this flavor:
5864

5965
```yaml
6066
# yaml-language-server: $schema=https://rackerlabs.github.io/understack/schema/flavor.schema.json
6167
name: m1.small.nicX
6268
resource_class: m1.small
69+
description: Small compute flavor with NICX network hardware - 16 cores, 128GB RAM, dual 480GB drives
6370
traits:
6471
- trait: NICX
6572
state: required
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# yaml-language-server: $schema=https://rackerlabs.github.io/understack/schema/flavor.schema.json
22
name: m1.small.nicX
33
resource_class: m1.small
4+
description: Small compute flavor with NICX network hardware - 16 cores, 128GB RAM, dual 480GB drives
45
traits:
56
- trait: NICX
67
state: required
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# yaml-language-server: $schema=https://rackerlabs.github.io/understack/schema/flavor.schema.json
22
name: m1.small
33
resource_class: m1.small
4+
description: Small compute flavor with 16 cores, 128GB RAM, and dual 480GB drives

schema/flavor.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"type": "string",
1616
"minLength": 1
1717
},
18+
"description": {
19+
"description": "Human-readable description of the flavor shown in Nova",
20+
"type": "string"
21+
},
1822
"traits": {
1923
"description": "Hardware traits for node matching (CUSTOM_ prefix added automatically)",
2024
"type": "array",

0 commit comments

Comments
 (0)