Open
Conversation
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.
Author
|
Fixes issue #365 |
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
boot-from-volume and custom disk configurations at server creation time
ServerBlockDeviceSpectype supportingsourceType(volume/image/blank),with references to ORC Volume and Image objects
imageRefoptional onServerResourceSpecto support boot-from-volumewithout a top-level image reference
imageRefor a bootable block devicebdmVolumeDependencyandbdmImageDependencywith deletion guardsBDM, and BDM dependency ordering/deletion guards
Details
Block device mapping is immutable after creation and complements the existing
mutable
volumesfield (post-creation hot-attach). TheblockDevicesfield mapsdirectly to Nova's
block_device_mapping_v2via gophercloud'sservers.BlockDevice.API changes
ServerResourceSpec.ImageRefchanged fromKubernetesNameRefto*KubernetesNameRef(now optional)ServerResourceSpec.BlockDevices []ServerBlockDeviceSpecfield (immutable)ServerBlockDeviceSpecstruct with fields:sourceType,volumeRef,imageRef,bootIndex,volumeSizeGiB,destinationType,deleteOnTermination,diskBus,deviceType,volumeType,tagServerResourceSpec: requires eitherimageRefor a blockdevice with
bootIndex == 0Test plan
server-create-bdm: Boot from volume using image source (no top-levelimageRef), verify ACTIVE with volume attached
server-create-bdm-volume: Boot from existing ORC Volume, verify ACTIVEwith volume attached
server-bdm-dependency: Verify server waits for missing BDM image, becomesavailable when created, image has deletion guard finalizer
server-create-minimalandserver-create-fulltests continueto pass (imageRef still works)