Skip to content

Conversation

@eshulman2
Copy link
Contributor

@eshulman2 eshulman2 commented Dec 30, 2025

This PR implements server controller feature parity with CAPO (Cluster API Provider OpenStack), enabling the eventual migration from CAPO's internal OpenStackServer controller to ORC.

Closes #624
Contributes to #577
Related: kubernetes-sigs/cluster-api-provider-openstack#2814

Changes

Server Controller Enhancements

Metadata support

  • Add metadata field to ServerResourceSpec for key-value pairs
  • Metadata is mutable and reconciled after server creation

ConfigDrive support

  • Add configDrive field to enable configuration data via a special drive instead of the metadata service

SchedulerHints support

  • Add schedulerHints field with support for:
    • serverGroupRef - schedule server in a server group
    • differentHostServerRefs / sameHostServerRefs - affinity/anti-affinity with other servers
    • query, targetCell, differentCell, buildNearHostIP - advanced placement options
    • additionalProperties - arbitrary scheduler hints

Boot-from-Volume support

  • Add bootVolume field to boot servers from Cinder volumes instead of images
  • bootVolume and imageRef are mutually exclusive (enforced via CEL validation)

Volume Controller Enhancements

ImageRef support

  • Add imageRef field to create bootable volumes from images
  • Add bootable and imageID to volume status

Design Decisions

Boot volume vs data volumes separation

  • Only the boot volume (bootVolume field) is attached at server creation time via Nova's block device mapping
  • Additional data volumes continue to use the existing dynamic attachment mechanism (spec.resource.volumes) which attaches volumes after server creation
  • This separation allows data volumes to remain mutable (add/remove after server creation) while the boot volume is immutable
  • Avoids duplicating volume attachment logic between creation-time and runtime mechanisms

No deleteOnTermination option

  • Deliberately not exposing Nova's delete_on_termination flag for the boot volume
  • If enabled, Nova would delete the underlying OpenStack volume when the server is deleted, but the ORC Volume resource would remain as an orphan
  • The orphaned Volume resource would then attempt to recreate the volume, leading to unexpected behavior
  • Users who want the volume deleted should delete both Server and Volume resources, maintaining consistent ORC resource lifecycle management

assisted-by: claude

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Dec 30, 2025
@eshulman2 eshulman2 changed the title Add metadata to server controller Feature parity with CAPO: add additional fields to server controller Dec 31, 2025
@github-actions github-actions bot added semver:major Breaking change and removed semver:minor Backwards-compatible change labels Dec 31, 2025
Add metadata field to server controller allowing setting metadata on servers created by orc
Add SchedulerHints to server controller
NOTE! this change MOVED the ServerGroupRef inside the ServerSchedulerHints
Enables creating bootable volumes from images by adding an imageRef
field to the Volume spec. When specified, the volume is created with
the image baked in, making it suitable for boot-from-volume scenarios.

Changes:
- Add imageRef field to VolumeResourceSpec
- Add bootable and imageID fields to VolumeResourceStatus
- Add image dependency with deletion guard
- Add kuttl tests for bootable volume creation

assisted-by: claude
Add support for booting servers from Cinder volumes instead of images.
This enables the boot-from-volume (BFV) pattern where a bootable volume
(created from an image) is used as the root disk.

Design decisions:

1. Boot volume vs data volumes separation:
    - Only the boot volume (bootVolume field) is attached at server creation
    time via Nova's block device mapping
    - Additional data volumes continue to use the existing dynamic attachment
    mechanism (spec.resource.volumes) which attaches volumes after server
    creation
    - This separation allows data volumes to remain mutable (add/remove after
    server creation) while the boot volume is immutable
    - Avoids duplicating volume attachment logic between creation-time and
    runtime mechanisms

2. No deleteOnTermination option:
    - Deliberately not exposing Nova's delete_on_termination flag
    - If enabled, Nova would delete the underlying OpenStack volume when the
    server is deleted, but the ORC Volume resource would remain as an orphan
    - The orphaned Volume resource would then attempt to recreate the volume,
    leading to unexpected behavior
    - Users who want the volume deleted should delete both Server and Volume
    resources, maintaining consistent ORC resource lifecycle management

API Changes:
- Add ServerBootVolumeSpec type with volumeRef and optional tag fields
- Add bootVolume field to ServerResourceSpec (mutually exclusive with imageRef)
- Make imageRef optional (pointer) with CEL validation

Controller Changes:
- Add bootVolumeDependency with deletion guard and unique controller name
- Handle boot-from-volume in CreateResource by building BlockDevice list

Tests & Examples:
- Add kuttl test for server boot-from-volume scenario
- Add config/samples/openstack_v1alpha1_server_boot_from_volume.yaml
- Add examples/bases/boot-from-volume/ with volume and server examples

assisted-by: claude
@eshulman2 eshulman2 mentioned this pull request Dec 31, 2025
3 tasks
@eshulman2 eshulman2 changed the title Feature parity with CAPO: add additional fields to server controller OSASINFRA-4031: Feature parity with CAPO: add additional fields to server controller Jan 1, 2026
Copy link
Collaborator

@mandre mandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, there's quite a lot in there. Thanks for the PR!

Just a few notes before I start reviewing this PR more thoroughly:

  • in the future, let's have individual PR if possible to make it easier to review and merge, similar to how @winiciusallan did in #616.
  • this is an upstream project that manages its issues in github, we shouldn't add jira references to the PR title.
  • avoid breaking backward compatibility unless it's absolutely required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server controller parity with CAPO

2 participants