Repository navigation
fix: real-mode boot on current QEMU/libvirt hosts, plus four Horizon dashboard fixes - #114
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The plural metadefs schema endpoints return individual-resource schemas instead of collection schemas, exposing incorrect response contracts to schema consumers.
1 open issue
What changed in this PR
This PR addresses real-mode boot failures on current QEMU/libvirt hosts and four Horizon dashboard issues. It also updates the RGW test fixture for SELinux-enforcing hosts, without schema changes or new dependencies.
Changes:
- Use a portable QEMU machine type and prepare QEMU-owned instance directories.
- Correct Horizon role and upload settings, add Glance metadata schemas, and consistently return Nova’s
imagefield. - Add regression tests and update deployment guidance and compatibility records.
| File | Description |
|---|---|
pkg/hypervisor/xml_template.go |
Use the current pc machine alias. |
pkg/hypervisor/xml_template_test.go |
Test portable machine-type generation. |
pkg/hypervisor/libvirt.go |
Store cached QEMU ownership. |
pkg/hypervisor/disk.go |
Prepare QEMU-owned instance directories. |
pkg/hypervisor/disk_test.go |
Test real and stub directory preparation. |
pkg/hypervisor/console_dir.go |
Cache ownership from libvirt capabilities. |
internal/nova/server_image_field_test.go |
Test server image-field representations. |
internal/nova/handlers.go |
Prepare boot directories and consistently include image. |
internal/glance/metadefs.go |
Add metadata-definition schema handlers. |
internal/glance/metadefs_schema_test.go |
Test schema endpoint responses. |
internal/glance/images.go |
Register metadata-definition schema routes. |
docs/testing/rook-rgw-fixture.md |
Align accepted roles with seeded roles. |
docs/REAL_LIBVIRT_MODE.md |
Update the machine-type example. |
docs/HORIZON_DEPLOYMENT.md |
Correct Horizon’s default role. |
docs/compatibility/HORIZON_COMPATIBILITY_REPORT.md |
Record the role fix and remaining group-assignment gap. |
deployments/rook/setup-rook-rgw.sh |
Remove the unseeded default accepted role. |
deployments/rgw-keystone-entrypoint.sh |
Align RGW’s accepted-role defaults. |
deployments/horizon-config/local_settings |
Correct the default role and enable server-side uploads. |
deployments/docker-compose.rgw-test.yml |
Relabel the entrypoint mount for SELinux. |
charts/horizon/files/local_settings |
Synchronize Horizon chart settings. |
Review effort: Balanced
uw-sc
force-pushed
the
feature/host-os
branch
from
November 5, 2026 07:53
2029b24 to
c4c414f
Compare
uw-sc
force-pushed
the
feature/host-os
branch
from
November 5, 2026 11:54
c4c414f to
a3075c0
Compare
uw-sc
marked this pull request as ready for review
November 5, 2026 12:03
senolcolak
previously approved these changes
Nov 6, 2026
senolcolak
left a comment
Collaborator
There was a problem hiding this comment.
copilot has some complains, that needs to be solved (image field is missing) besides that good to go.
uw-sc
force-pushed
the
feature/host-os
branch
from
November 6, 2026 13:52
a3075c0 to
a6b62c0
Compare
Base automatically changed from
feature/600-database-sqlite-backup-integrity-check-and-restore
to
main
November 6, 2026 14:39
added 8 commits
November 6, 2026 15:39
The domain XML pinned machine='pc-i440fx-2.12', a type QEMU dropped after 6.x. On a current QEMU (e.g. 11.x on openSUSE Tumbleweed) every real-mode server create failed at define with "does not support machine type 'pc-i440fx-2.12'". Render the generic 'pc' alias instead: it always resolves to the running QEMU's current i440fx machine, so a guest defines on any supported QEMU. A regression test asserts the portable type and guards against re-pinning an obsolete one; the example in docs/REAL_LIBVIRT_MODE.md is updated to match. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
The rgw-integration fixture bind-mounts rgw-keystone-entrypoint.sh into the non-privileged ceph/demo container. On an SELinux-enforcing host (openSUSE/Fedora/RHEL) the host file keeps a label the container cannot read, so the entrypoint fails with "Permission denied" (exit 126): the rgw service never starts, the lightstack service blocks on it, and `docker compose up -d` hangs. Add the `,z` mount option so the runtime relabels the file to a shared, container-readable type. It is a no-op where SELinux is disabled (the CI runner), so the rgw-integration-tests job is unaffected. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
…al mode) Real-mode server create defined the domain but failed to START with "console.log: Permission denied" on hosts where libvirt runs QEMU as the confined libvirt-qemu user (e.g. openSUSE's modular virtqemud). The per-instance directory (<state_path>/instances/<id>) was created root:root 0755 and never chowned to the QEMU user, so QEMU could not create the serial <log file> chardev it opens itself. Older libvirt opened that log as root in the daemon, which masked the gap; newer libvirt does not. Cache the uid:gid libvirt runs QEMU as (its DAC base label, already read for the console-socket directory in SPEC-021) and chown each per-instance directory to it on create, mirroring console_dir.go. Root stays able to stage the overlay there because it is exempt from the directory's mode. Stub mode is unchanged. Both create paths -- image boot and boot-from-volume -- use the new VMManager.PrepareInstanceDir; a regression test covers the real-mode chown and the stub-mode no-op. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
Both dashboard settings files (deployments/horizon-config/local_settings and its generated chart copy) set OPENSTACK_KEYSTONE_DEFAULT_ROLE = "_member_", the legacy member role older Keystone releases created. Lightstack seeds admin, member and reader (migration 002) and never _member_, so Horizon's once-per-process role lookup against GET /v3/roles found nothing. Two things followed. Identity -> Projects -> Create Project (and Manage Members / Manage Groups on an existing project) bounced silently: the members step raised 'Could not find default role "_member_"', folded into a redirect back to the list, with the text only in the Django messages cookie. Identity -> Users -> Create User, which preselects the same role and sorts the choices by id, fell through to admin (the lowest seeded role id), so a user created through the dashboard with a primary project was granted admin unless the operator changed the field. Set member -- upstream Horizon's own default (openstack_dashboard/ defaults.py) and the value every other Horizon config in the tree already used -- and regenerate the chart copy with `make horizon-chart-sync`. This corrects Lightstack's own deployment artifact in the sense of SPEC-020 FR-018a (justified against upstream, compensating for no missing API); it is not a Horizon override. Horizon caches the resolved role, so a running dashboard needs a restart; the chart's checksum/config annotation rolls the pod on upgrade. Also: docs/HORIZON_DEPLOYMENT.md carried the same value; the RGW fixtures' accepted-roles lists drop the dead _member_ (matching docs/OBJECT_STORAGE_S3.md); the Horizon compatibility report records this as F19 and, as F20, the gap it had been hiding -- group role assignments on a project are unrouted, so Manage Members -> Save fails once any Keystone group exists (none is seeded; SPEC-023 scopes group assignments out). Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
Horizon's Angular "Create Image" modal loads GET /v2/schemas/metadefs/namespace
before it renders. Lightstack had no such route, so the request 404'd, the modal's
response handler read `.data` off undefined (TypeError), and the create failed with
"Unable to retrieve namespace / project / create image".
Add the static metadefs schema documents upstream Glance serves
(namespace[s], resource_type[s], object[s], propert{y,ies}, tag[s]). They are
fixed JSON, so they need no database and no auth-specific state.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
The single-server GET only set response["image"] when image_id was non-NULL, so a
boot-from-volume server omitted the key entirely. Horizon's instance-detail view
reads server.image unconditionally, so novaclient raised "AttributeError: image"
and the page 500'd. /detail already emitted "" for that case, so the two handlers
had drifted.
Extract serverImageField(), shared by both handlers: an {id} object for an
image-booted server, "" for a boot-from-volume one — present either way, matching
upstream Nova.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
HORIZON_IMAGES_UPLOAD_MODE='direct' uploads from the browser straight to Glance:9292 via CORS. Lightstack's CORS allowlist is localhost-only, so through a tunnel the browser cannot reach Glance and the upload fails. 'legacy' has the Horizon server stream the image in-cluster, which works regardless of how the browser reaches Horizon. Apply to both the chart and the compose horizon-config copies (kept in sync by `make horizon-chart-sync`). Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
TestEnsureOwnedDir and TestPrepareConsoleSocketDir chowned the console socket directory to this process's own uid:gid, which a new directory already has, so they passed with the chown removed. New subtests ask for an owner the directory does not have (nobody:nogroup as root, otherwise a second group of this user) and check that the owner changed. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Uwe Schwaeke <uwe.schwaeke@sap.com>
uw-sc
force-pushed
the
feature/host-os
branch
from
November 6, 2026 14:39
a6b62c0 to
67ee15e
Compare
senolcolak
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
A test pass on a current Linux host — openSUSE Tumbleweed with QEMU 11.1.2, modular libvirt (
virtqemud)and SELinux enforcing — found two real-mode boot blockers, an RGW test fixture that would not start under
SELinux, and four Horizon failures. One commit per fix.
What's in it
Real mode on current QEMU/libvirt
machine='pc-i440fx-2.12', which QEMU 11.0 removed, so everyreal-mode create failed at define (
does not support machine type 'pc-i440fx-2.12'). It now renderspc, the alias for the running QEMU's current i440fx type (pc-i440fx-11.1here). Thedocs/REAL_LIBVIRT_MODE.mdexample follows.start with
console.log: Permission denied:<state_path>/instances/<id>wasroot:root 0755, and QEMUopens the serial log there itself. A DAC failure, not SELinux — it fails with
setenforce 0too. Bothcreate paths (image boot and boot-from-volume) now chown the directory to the uid:gid libvirt reports
for QEMU, the value already read at startup for the console-socket directory. Stub mode is unchanged.
RGW test fixture
deployments/docker-compose.rgw-test.ymlmounts the RGW entrypoint:ro. Under SELinux enforcing thecontainer cannot execute it (exit 126), RGW never starts and
docker compose up -dhangs.:ro,zrelabels it; a no-op where SELinux is off, as on the CI runner.
Horizon
OPENSTACK_KEYSTONE_DEFAULT_ROLEwas_member_, which Lightstack has never seeded(it seeds
admin,member,reader). Create Project, Manage Members and Manage Groups returned to thelist without opening, the error only in Django's
messagescookie. Create User preselects its role fromthe same setting and, with nothing resolved, fell through to
admin, the lowest seeded id (derived fromHorizon's source, not reproduced). Now
member, upstream Horizon's own default. The chart copy isregenerated with
make horizon-chart-sync;docs/HORIZON_DEPLOYMENT.mdand the RGW fixtures'accepted-roles lists drop
_member_as well.GET /v2/schemas/metadefs/namespacebefore it renders; the 404 made itthrow a
TypeErrorand fail with "Unable to retrieve namespace". Glance now serves static schemadocuments under
/v2/schemas/metadefs/*.GET /v2.1/servers/{id}omittedimagefor a boot-from-volume server — whatHorizon's launch wizard creates by default — and the detail page 500'd (
AttributeError: image).imageis now always present,{id}or""as in upstream Nova, through one helper shared with/servers/detail, which already did this.HORIZON_IMAGES_UPLOAD_MODE = 'direct'sends the browser straight to Glance on:9292, which Lightstack's localhost-only CORS allowlist refuses and a tunnelled browser cannot reach.legacyhas the Horizon server stream the upload in-cluster.docs/compatibility/HORIZON_COMPATIBILITY_REPORT.mdrecords the role defect as F19 (fixed here) and,as F20, the gap it had been hiding: group role assignments on a project are unrouted, so
Manage Members → Save fails once any Keystone group exists. F20 stays open; nothing seeds a group.
No schema change, no migration, no new modules. API: new read-only
/v2/schemas/metadefs/*routes, andGET /v2.1/servers/{id}always carriesimage.Operator notes
checksum/configannotation rolls the pod onhelm upgrade; under Compose, recreate thehorizoncontainer.adminfrom the olddefault;
openstack role assignment list --namesshows them.Testing
make lint— 0 issues;gofmtclean;go build ./...green.go test ./internal/glance/... ./internal/nova/... ./pkg/hypervisor/...— green (SQLite test backend),including the new regression tests
TestGenerateVMXMLMachineTypePortable,TestPrepareInstanceDirOwnsDirInRealMode,TestPrepareInstanceDirStubModeJustCreates,TestMetadefsSchemaRoutesandTestServerImageField.make horizon-chart-check— chart copy in sync;helm unittest charts/horizon— 3/3.machine='pc'on QEMU 11.1.2 (virsh domxml-to-native→-machine pc-i440fx-11.1)user = "root"inqemu.conf)member🤖 Generated with Claude Code