You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| White Glove | 4 | Requires manual intervention and special handling |
11
+
OS scoring is not hardcoded in the SQL templates. Instead, the CASE clauses are **generated at query-build time** from `OSDifficultyScores` in `pkg/estimations/complexity/complexity.go`.
20
12
21
-
## OS Classification
13
+
The template placeholder `{{.OSCaseClauses}}` in `populate_complexity.go.tmpl` is replaced with one `WHEN ... THEN '...'` clause per entry in that map, ensuring a single source of truth for OS scores across both the API response path and the ingestion path.
22
14
23
-
The OS is determined from VMware Tools or configuration file data.
15
+
## Disk size tiers in SQL
24
16
25
-
**Source of truth:**`pkg/estimations/complexity/complexity.go` — see `OSDifficultyScores` map.
17
+
The disk thresholds are expressed directly in SQL within `populate_complexity.go.tmpl`:
26
18
27
-
The SQL template (`populate_complexity.go.tmpl`) auto-generates OS CASE clauses from this map at query build time, ensuring a single source of truth.
19
+
| SQL condition | Tier label | Score |
20
+
|---|---|---|
21
+
|`total_disk_tb < 10`| Easy | 1 |
22
+
|`total_disk_tb < 20`| Medium | 2 |
23
+
|`total_disk_tb < 50`| Hard | 3 |
24
+
|`else`| White Glove | 4 |
28
25
29
-
| Score | Patterns |
30
-
|-------|----------|
31
-
| 1 (Easy) | Red Hat, Rocky Linux |
32
-
| 2 (Medium) | CentOS, Windows |
33
-
| 3 (Hard) | Ubuntu, SUSE Linux Enterprise |
34
-
| 4 (Database/White Glove) | Oracle, Microsoft SQL |
35
-
| 0 (Unsupported) | Any other OS |
26
+
Note: these thresholds are currently hardcoded in the template separately from `DiskSizeScores` in the complexity package. They must be kept in sync manually if the tier boundaries change.
36
27
37
-
## Disk Size Tiers
28
+
## Combined OS × disk matrix
38
29
39
-
Total disk capacity (sum of all vdisks) determines the disk tier:
30
+
The final per-VM score is computed in `populate_complexity.go.tmpl` by combining the OS level and disk level:
40
31
41
-
| Tier | Size Range |
42
-
|------|------------|
43
-
| Easy | 0 - 10 TB |
44
-
| Medium | 10 - 20 TB |
45
-
| Hard | 20 - 50 TB |
46
-
| White Glove | > 50 TB |
32
+
| OS level | Disk level | Final score |
33
+
|---|---|---|
34
+
| unknown | any | 0 |
35
+
| database | any | 4 |
36
+
| easy | easy / medium | 1 |
37
+
| easy | hard / white glove | 3 |
38
+
| medium | easy / medium | 2 |
39
+
| medium | hard / white glove | 3 |
40
+
| hard | easy / medium | 2 |
41
+
| hard | hard / white glove | 3 |
47
42
48
-
## Combined Complexity Matrix
43
+
The result is stored in the `OsDiskComplexity` column of the `vinfo` table during ingestion.
49
44
50
-
The final complexity is calculated by combining OS and disk levels:
45
+
## Relevant templates
51
46
52
-
| OS Level | Disk Level | Final Complexity |
53
-
|----------|------------|------------------|
54
-
| Unsupported | Any | 0 (Unsupported) |
55
-
| Database | Any | 4 (White Glove) |
56
-
| Easy | Easy/Medium | 1 (Easy) |
57
-
| Easy | Hard/WG | 3 (Hard) |
58
-
| Medium | Easy/Medium | 2 (Medium) |
59
-
| Medium | Hard/WG | 3 (Hard) |
60
-
| Hard | Easy/Medium | 2 (Medium) |
61
-
| Hard | Hard/WG | 3 (Hard) |
62
-
63
-
## Implementation
64
-
65
-
The complexity is computed via SQL in `populate_complexity.go.tmpl` during data ingestion. The computed value is stored in the `OsDiskComplexity` column of the `vinfo` table.
66
-
67
-
The distribution query (`complexity_distribution_query.go.tmpl`) aggregates VMs by complexity level for reporting.
47
+
| Template | Purpose |
48
+
|---|---|
49
+
|`populate_complexity.go.tmpl`| Computes and stores `OsDiskComplexity` for every VM row |
50
+
|`complexity_distribution_query.go.tmpl`| Aggregates VM counts by `OsDiskComplexity` for reporting |
0 commit comments