Skip to content

feat(server-create): boot from image by default, opt into BFV - #3

Merged
kallioli merged 2 commits into
mainfrom
feat/server-create-ephemeral-by-default
Apr 23, 2026
Merged

feat(server-create): boot from image by default, opt into BFV#3
kallioli merged 2 commits into
mainfrom
feat/server-create-ephemeral-by-default

Conversation

@kallioli

Copy link
Copy Markdown
Contributor

Context

orca server create always sent Nova a boot-from-volume request, even when the flavor had a perfectly usable local root disk. For every instance this forced Cinder to materialise a volume from the image, consumed tenant Cinder quota, and added visible latency to server creation. The cleanup output from a recent test run showed exactly this footprint — 30 test instances leaving 30 boot volumes behind, auto-removed by the server cascade and showing up as idempotent 404s in project cleanup.

The behaviour was not documented as a design choice anywhere outside a parenthetical in the create docstring.

Changes

  • Ephemeral (boot from image on the compute's local disk) is now the default when the flavor has disk > 0.
  • Flavors with disk == 0 still fall back to boot-from-volume automatically — Nova cannot boot them any other way.
  • Two new flags override the auto-detection, mutually exclusive:
    • --ephemeral — force boot from image. Errors out with a clear message if the flavor has disk == 0.
    • --boot-from-volume — force the previous behaviour (BDMv2, --disk-size honoured).
  • When the flavor lookup itself fails (transient Nova error, auth gap), the explicit flag is honoured; without one the code defaults to BFV, which works on every deployment.
  • --disk-size keeps its meaning in the BFV path and is ignored in ephemeral mode (Nova sizes the root disk from the flavor).
  • Rendered output:
    • BFV: Disk: <N> GB (boot volume) (unchanged)
    • Ephemeral: Boot: ephemeral (from image, flavor root disk)

Scope

  • Only orca server create is changed. orca server clone still emits BDMv2 like before — cloning a BFV source into a BFV target is still the coherent behaviour there, and mixing modes in clone deserves its own discussion.
  • _resolve_boot_mode lives in the command module rather than the service layer: it's pure policy (CLI-level UX), not a Nova operation.

Tests

  • 8 new tests in tests/test_server_create_boot_mode.py:
    • auto-detection on flavor disk=20imageRef body, no BDMv2
    • auto-detection on flavor disk=0 → BDMv2, --disk-size honoured
    • --boot-from-volume overrides a flavor-with-disk
    • --ephemeral on flavor-with-disk
    • --ephemeral on flavor disk=0 → non-zero exit, POST never fires
    • --ephemeral --boot-from-volume → non-zero exit, POST never fires
    • flavor lookup error + --ephemeral → honoured
    • flavor lookup error without flag → safe default to BFV
  • ruff check .
  • mypy
  • pytest — 2286 passed
  • coverage 87.51% (gate 85%)

Backwards compatibility

  • This changes the default behaviour of orca server create. Pipelines that rely on a root Cinder volume being created silently should now pass --boot-from-volume explicitly, or be adjusted to work with ephemeral storage.
  • The migration path is a single flag; no code changes required for callers that are fine with either mode.
  • Existing servers are not touched.

Follow-ups (out of scope)

  • Mirror the flag in orca server clone (currently still unconditional BFV).
  • Consider adding an ADR that explicitly documents the boot-mode policy.

`orca server create` unconditionally built a block_device_mapping_v2
that asked Nova to create a Cinder volume from the image, even on
flavors with a usable local root disk. Every instance therefore
consumed Cinder quota, took longer to spawn, and left a matching
volume behind on delete — visible in `project cleanup` as a wave of
idempotent 404s on volumes auto-removed by the server cascade.

Change the default: when the chosen flavor has `disk > 0` the server
boots from the image directly on the compute's local disk (Nova body
uses `imageRef`). Flavors with `disk == 0` still fall back to
boot-from-volume since Nova cannot boot them otherwise.

Two new flags override the auto-detection:

  --ephemeral          force boot-from-image (errors on disk=0 flavors)
  --boot-from-volume   force boot-from-volume regardless of flavor

The flags are mutually exclusive. When the flavor lookup itself fails
(transient Nova error, auth gap), the helper respects the explicit
flag; without one it falls back to BFV, which is safe on every
deployment.

`--disk-size` keeps its meaning in BFV mode and is ignored in the
ephemeral path (Nova sizes the root disk from the flavor).
--ephemeral and --boot-from-volume mixed two registers: a storage-type
term and an action term. Both flags now share the action wording used
by Horizon and the OpenStack docs, which is the vocabulary an operator
actually sees when picking between the two.

Renames flag, parameter, helper signature, docstring, help text, and
the user-facing confirmation message. Behaviour is unchanged; tests
follow the new names.
@kallioli
kallioli merged commit 4c71cd3 into main Apr 23, 2026
10 checks passed
@kallioli
kallioli deleted the feat/server-create-ephemeral-by-default branch April 23, 2026 07:03
Vinetos pushed a commit to Vinetos/orca-cli that referenced this pull request May 30, 2026
`orca server clone` kept emitting an unconditional block_device_mapping_v2
while `orca server create` had already switched to boot-from-image by
default. Clone therefore silently recreated BFV servers even when the
source's flavor carried a local root disk — defeating the whole point
of the PR stackopshq#3 migration.

Wire the same --boot-from-image / --boot-from-volume flags on clone,
reuse _resolve_boot_mode, and branch the Nova body the same way:

  * use_bfv=True  → block_device_mapping_v2 (unchanged, honours
                    --disk-size)
  * use_bfv=False → imageRef, Nova sizes the root disk from the flavor

Error messages and mutual exclusion are identical to the create path.
Vinetos pushed a commit to Vinetos/orca-cli that referenced this pull request May 30, 2026
Documents the non-obvious default shift introduced by PR stackopshq#3 and PR stackopshq#4:
`orca server create` and `orca server clone` now boot from image on
the compute's local disk by default, falling back to boot-from-volume
only when the flavor has `disk == 0`.

Records the alternatives considered (unconditional ephemeral, the
`--ephemeral / --boot-from-volume` pairing that was tried first) so a
future contributor reading the diff does not silently undo the choice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant