Skip to content

Commit 0764e98

Browse files
mbuechsegarloff
andauthored
Bugfix: image-md-check.py too lenient, scs-0102-v1 too strict (#914)
Signed-off-by: Matthias Büchse <[email protected]> Co-authored-by: Kurt Garloff <[email protected]>
1 parent fd0d2c5 commit 0764e98

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Standards/scs-0102-v1-image-metadata.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,22 @@ in the [OpenStack Image documentation](https://docs.openstack.org/glance/latest/
5252

5353
The following properties are considered mandatory:
5454

55-
- `architecture`, `hypervisor_type`
55+
- `architecture`
5656
- `min_disk` (in GiB), `min_ram` (in MiB)
5757
- `os_version`, `os_distro`
58-
- `hw_rng_model`, `hw_disk_bus` (`scsi` recommended, and then setting `hw_scsi_model` is also recommended)
58+
- `hw_disk_bus` (`scsi` recommended, and then setting `hw_scsi_model` is also recommended)
5959

6060
**Note**: Disk sizes tend to be measured in GB = 10^9 and not GiB = 2^30 in the disk industry, but OpenStack uses GiB.
6161

62-
The following properties are recommended (if the features are supported):
62+
The value given vor `min_ram` MUST be sufficient for the VM to boot and survive (for at least 10 s).
6363

64+
The following property is recommended:
65+
66+
- `hypervisor_type`
67+
68+
The following further properties are recommended (if the features are supported):
69+
70+
- `hw_rng_model`
6471
- `os_secure_boot`, `hw_firmware_type`
6572
- `hw_watchdog_action`, `hw_mem_encryption`, `hw_pmu`, `hw_video_ram`, `hw_vif_multiqueue_enabled`
6673

Tests/iaas/image-metadata/image-md-check.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,16 @@ def validate_imageMD(img, outd_list):
282282
if img.min_ram < 64:
283283
print(f'WARNING: Image "{imgnm}": min_ram == {img.min_ram} MiB < 64 MiB', file=sys.stderr)
284284
warnings += 1
285-
# errors += 1
286-
if img.min_disk * GIB < img.size:
287-
print(f'WARNING: Image "{imgnm}": img size == {img.size / MIB:.0f} MiB, but min_disk == {img.min_disk * GIB / MIB:.0f} MiB',
285+
if not img.min_ram:
286+
print(f'ERROR: Image "{imgnm}": min_ram == 0', file=sys.stderr)
287+
errors += 1
288+
if not img.min_disk:
289+
print(f'ERROR: Image "{imgnm}": min_disk == 0', file=sys.stderr)
290+
errors += 1
291+
elif img.min_disk * GIB < img.size:
292+
print(f'ERROR: Image "{imgnm}": img size == {img.size / MIB:.0f} MiB, but min_disk == {img.min_disk * GIB / MIB:.0f} MiB',
288293
file=sys.stderr)
289-
warnings += 1
290-
# errors += 1
294+
errors += 1
291295
# (6) tags os:*, managed_by_*
292296
# Nothing to do here ... we could do a warning if those are missing ...
293297

0 commit comments

Comments
 (0)