Skip to content

Server block device mapping#710

Open
dalehenries wants to merge 2 commits intok-orc:mainfrom
dalehenries:server-block-device-mapping
Open

Server block device mapping#710
dalehenries wants to merge 2 commits intok-orc:mainfrom
dalehenries:server-block-device-mapping

Conversation

@dalehenries
Copy link

Summary

  • Add boot-time block device mapping (BDM) to the Server resource, enabling
    boot-from-volume and custom disk configurations at server creation time
  • Add ServerBlockDeviceSpec type supporting sourceType (volume/image/blank),
    with references to ORC Volume and Image objects
  • Make imageRef optional on ServerResourceSpec to support boot-from-volume
    without a top-level image reference
  • Add CEL validations enforcing sourceType/ref consistency and requiring either
    imageRef or a bootable block device
  • Add bdmVolumeDependency and bdmImageDependency with deletion guards
  • Add three KUTTL E2E test suites: boot-from-image BDM, boot-from-existing-volume
    BDM, and BDM dependency ordering/deletion guards

Details

Block device mapping is immutable after creation and complements the existing
mutable volumes field (post-creation hot-attach). The blockDevices field maps
directly to Nova's block_device_mapping_v2 via gophercloud's servers.BlockDevice.

API changes

  • ServerResourceSpec.ImageRef changed from KubernetesNameRef to
    *KubernetesNameRef (now optional)
  • New ServerResourceSpec.BlockDevices []ServerBlockDeviceSpec field (immutable)
  • New ServerBlockDeviceSpec struct with fields: sourceType, volumeRef,
    imageRef, bootIndex, volumeSizeGiB, destinationType,
    deleteOnTermination, diskBus, deviceType, volumeType, tag
  • CEL validation on ServerResourceSpec: requires either imageRef or a block
    device with bootIndex == 0

Test plan

  • server-create-bdm: Boot from volume using image source (no top-level
    imageRef), verify ACTIVE with volume attached
  • server-create-bdm-volume: Boot from existing ORC Volume, verify ACTIVE
    with volume attached
  • server-bdm-dependency: Verify server waits for missing BDM image, becomes
    available when created, image has deletion guard finalizer
  • Existing server-create-minimal and server-create-full tests continue
    to pass (imageRef still works)

Add boot-time block device mapping (BDM) to the Server resource,
enabling boot-from-volume and custom disk configurations at server
creation time. This complements the existing post-creation volume
attachment via the volumes field.

Changes:
- Add ServerBlockDeviceSpec type with sourceType (volume/image/blank),
  volumeRef, imageRef, bootIndex, volumeSizeGiB, destinationType,
  deleteOnTermination, diskBus, deviceType, volumeType, and tag fields
- Add blockDevices field to ServerResourceSpec (immutable after creation)
- Make imageRef optional (pointer) to support boot-from-volume without
  a top-level image reference
- Add CEL validations: require either imageRef or a blockDevice with
  bootIndex 0; enforce sourceType/ref consistency
- Add bdmVolumeDependency and bdmImageDependency with deletion guards
- Wire BDM dependencies into SetupWithManager watches
- Resolve BDM dependencies and build BlockDevice slice in CreateResource
- Regenerate deepcopy, apply configurations, CRDs, and docs
Add three test suites covering block device mapping functionality:

- server-create-bdm: Boot from volume using image source with no
  top-level imageRef. Verifies server reaches ACTIVE with volume
  attached and correct network configuration.

- server-create-bdm-volume: Boot from an existing ORC Volume.
  Creates a bootable volume from image, then references it in BDM
  with sourceType: volume.

- server-bdm-dependency: Tests BDM dependency ordering and deletion
  guards. Verifies server waits for missing BDM image dependency,
  becomes available once created, and that the image has a deletion
  guard finalizer preventing premature deletion.
@dalehenries
Copy link
Author

Fixes issue #365

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.

1 participant