Skip to content

feat(server-clone): align boot-mode policy with server create - #4

Merged
kallioli merged 1 commit into
mainfrom
feat/server-clone-boot-mode
Apr 23, 2026
Merged

feat(server-clone): align boot-mode policy with server create#4
kallioli merged 1 commit into
mainfrom
feat/server-clone-boot-mode

Conversation

@kallioli

Copy link
Copy Markdown
Contributor

Context

PR #3 switched `orca server create` to boot-from-image by default, but `orca server clone` was left unchanged — it kept emitting an unconditional `block_device_mapping_v2`, which silently recreated BFV servers even when the source's flavor had a local root disk. Clone therefore worked against the grain of the new default.

Changes

  • `orca server clone` now accepts `--boot-from-image` and `--boot-from-volume` with the exact same semantics as create.
  • `_resolve_boot_mode` is reused (no duplication): auto-detection on `flavor.disk`, explicit flags override, mutually exclusive.
  • Nova body branches:
    • BFV → `block_device_mapping_v2` (unchanged, `--disk-size` honoured).
    • Boot-from-image → `imageRef`, Nova sizes the root disk from the flavor.
  • Output line adapts: `Disk: GB (boot volume)` vs `Boot: from image (flavor root disk)`.

Tests

New `tests/test_server_clone_boot_mode.py` (6 tests): auto-detect with `disk>0` and `disk=0`, both explicit flags, error on `--boot-from-image` + disk=0, mutual exclusion.

  • ruff
  • mypy
  • pytest — 2316 passed
  • coverage 88.37%

Backwards compatibility

Same posture as PR #3: the default changes, pipelines relying on the old BFV clone must pass `--boot-from-volume`.

`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 #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.
@kallioli
kallioli merged commit 75cdf6c into main Apr 23, 2026
10 checks passed
@kallioli
kallioli deleted the feat/server-clone-boot-mode branch April 23, 2026 07:37
Vinetos pushed a commit to Vinetos/orca-cli that referenced this pull request May 30, 2026
Addresses the remaining high/medium findings from the 2026-04-20 audit:
- stackopshq#4 insecure TLS warning + cacert path validation
- stackopshq#7 atomic token cache writes
- stackopshq#9 publish action pinned to immutable SHA
- #13 CI gaps: Poetry cache, poetry build, gitleaks, pip-audit,
  deploy-docs gated on CI success
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