Repository navigation
New extension: nvme-conversion — Convert VM disk controllers between SCSI and NVMe - #9858
jonathanbrenes wants to merge 6 commits into
Conversation
…SCSI and NVMe Adds the nvme-conversion extension that orchestrates the full SCSI<->NVMe conversion lifecycle for Azure VMs: - Pre-flight validation (Gen2, ADE, SKU capabilities, OS readiness) - OS preparation via RunCommand (Windows stornvme, Linux initramfs/grub/fstab) - VM deallocate, OS disk capability update, VM resize + controller change - Optional VM start with rollback instructions Commands: az nvme-conversion check - Validate VM readiness without changes az nvme-conversion convert - Full conversion with --fix-os, --dry-run, --no-wait Tested on: Ubuntu 24.04, RHEL 8/9/10, SLES 15 SP6, Azure Linux 4, Windows Server 2019/2022 — 20 VMs, 56 unit tests, azdev style/test/linter passed.
- custom.py: reject unmanaged (page-blob) OS disks in _validate_vm with a clear ValidationError. - custom.py: add _get_vm_skus() helper; share resource_skus.list() result between _resolve_vm_size and _validate_sku to avoid duplicate API calls. - custom.py: switch user-progress logger.warning calls to logger.info (Gen2 banner, controller arrows, SKU validating, VM updated, VM started, etc.); reserve warnings for actual problems. - custom.py: collapse _check_os_readiness into a thin wrapper around _prepare_os(fix_os=False, dry_run=False) to remove duplicated logic. - custom.py: validate SKU capabilities across all vm.zones, not just vm.zones[0]. - _linux_checks.py / _windows_checks.py: add timeout=600 to begin_run_command(...).result() calls so RunCommand cannot hang indefinitely. - commands.py: replace confirmation=True with a custom yes/no prompt that names the VM and target controller for the convert command. - setup.py: pin azure-mgmt-compute>=30.0.0. Validated end-to-end against live Azure VMs in westus3: - 6/6 RHEL 9 LVM Gen2 VMs converted Standard_D2s_v5 (SCSI) -> Standard_D2s_v6 (NVMe) and verified post-conversion. - Unmanaged-disk guard verified live: az nvme-conversion check on an unmanaged-disk VM fails with the new clear error message. - pytest: 56 passed, 2 skipped. azdev style (pylint + flake8): PASSED.
|
Validation for Breaking Change Starting...
Thanks for your contribution! |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Azure CLI extension (nvme-conversion) to pre-flight check and convert Azure VM disk controllers between SCSI and NVMe, including OS readiness checks/fixes and user-facing help/output.
Changes:
- Introduces
az nvme-conversion checkandaz nvme-conversion convertcommands with SKU/ADE/Gen2/power-state validation and conversion orchestration. - Adds OS preparation implementations for Linux (embedded RunCommand bash script) and Windows (stornvme checks/fix via RunCommand).
- Adds unit + mocked end-to-end tests plus extension packaging metadata and docs.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/nvme-conversion/setup.py | Extension packaging metadata and dependencies |
| src/nvme-conversion/setup.cfg | Placeholder config file |
| src/nvme-conversion/azext_nvme_conversion/custom.py | Primary check/convert orchestration and internal helpers |
| src/nvme-conversion/azext_nvme_conversion/commands.py | CLI command registration + confirmation/table formatting wiring |
| src/nvme-conversion/azext_nvme_conversion/_params.py | CLI parameters and validators wiring |
| src/nvme-conversion/azext_nvme_conversion/_validators.py | Input validation for --vm-size and --sleep-seconds |
| src/nvme-conversion/azext_nvme_conversion/_windows_checks.py | Windows RunCommand checks/fix + version validation |
| src/nvme-conversion/azext_nvme_conversion/_linux_checks.py | Linux RunCommand wrapper and error parsing |
| src/nvme-conversion/azext_nvme_conversion/_linux_script.py | Embedded bash script for Linux NVMe readiness + fixes |
| src/nvme-conversion/azext_nvme_conversion/_format.py | Table output transformers for -o table |
| src/nvme-conversion/azext_nvme_conversion/_help.py | Help text and examples |
| src/nvme-conversion/azext_nvme_conversion/_client_factory.py | Compute client factory |
| src/nvme-conversion/azext_nvme_conversion/azext_metadata.json | Extension metadata (preview + min CLI core) |
| src/nvme-conversion/azext_nvme_conversion/tests/latest/test_nvme_conversion.py | Unit + mocked end-to-end tests |
| src/nvme-conversion/README.md | User-facing overview and usage |
| src/nvme-conversion/HISTORY.rst | Initial release notes |
| src/nvme-conversion/DEVELOPMENT.md | Development guide and architecture notes |
| src/nvme-conversion/ROADMAP.md | Implementation roadmap and design notes |
| src/nvme-conversion/TESTING.md | Live test tracker |
| # Windows version | ||
| if os_type == 'Windows' and not ignore_windows_version_check: | ||
| _status('[5/7] Checking Windows version...') |
There was a problem hiding this comment.
Fixed in b9e5df3. Renumbered to [5/7] for Windows version check and [6/7] for SKU validation.
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
Validate and regenerate the resolved RHEL 7 standalone EFI boot entries instead of accepting timeout defaults from an unrelated configuration. Add isolated shell regressions and document runtime validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the top-level nvme-conversion command to the service mapping required by Azure Pipelines style and linter validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Verify ADE handlers and OS/all data-disk encryption metadata before NVMe preparation or writes. Refuse incomplete inventory and API failures without blocking SSE, encryption at host or a return to SCSI. Emit versioned source-VM eligibility for trusted offline ALAR handoff, with mocked regressions and actual SDK response-wrapper compatibility coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New extension:
nvme-conversion— Convert VM disk controllers between SCSI and NVMeThis checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az nvme-conversion check,az nvme-conversion convertDescription
Adds a preview (
1.0.0b1) extension for complete SCSI/NVMe conversion: VM/SKU/OSvalidation, Linux or Windows preparation, disk capabilities, deallocation,
resize/controller update and optional restart. Linux dry-run remains supported.
VM-wide ADE exclusion follow-up
or provisioning state, VM disk settings and every managed disk's ADE metadata.
settings or inconsistent disk identities. Removing the extension or unlocking
the volume does not prove that the disks are decrypted.
skip-check/dry-run invocations and already-NVMe checks.
with ADE. The NVMe exclusion does not prevent returning to SCSI.
checkoutput includes a versionednvmeEligibilityinventoryfor trusted offline recovery handoff to Add Linux NVMe preparation action ALAR#40. Failed/unknown ADE
checks emit no eligibility object and stop before guest RunCommand.
VirtualMachineExtensionsListResult.valueresponse, verified read-only.The trusted repair workflow must associate the full report with the actual
source VM/recovery disk and prevent configuration changes during preparation.
This is private workflow metadata, not signed Azure attestation. ALAR requires
a root-owned report no more than 15 minutes old; no Azure SDK is added to ALAR.
RHEL 7 EFI follow-up
Fixes the live-reproduced RHEL 7.9 false-readiness result where defaults contained
timeout 240 but the actual standalone EFI entries omitted it and NVMe used 30.
Resolve the guest EFI target, require one exact timeout token on every entry,
regenerate/verify that target and preserve defaults/idempotence/dry-run behavior.
Reject broken links, redirect stubs and failed/ineffective generation. Other
release/BIOS logic is unchanged. The shell correction itself does not change
encryption policy; the separate ADE gate above now enforces NVMe exclusion.
The 13 EFI tests remain self-contained chroot regressions.
CI service-registration follow-up
The earlier failed pipeline jobs lacked the
nvme-conversionservice-name entry.The existing five-line
Virtual Machinesregistration remains unchanged; nonew command names or index edits are introduced by this ADE update.
Validation
Canonical CLI Git tree:
21c43fef7da4efc36543123394af24b846883ae1.python -B -m pytest azext_nvme_conversion/tests/latest/test_nvme_conversion.py azext_nvme_conversion/tests/latest/test_linux_efi_timeout.py -q -p no:cacheprovider -k 'not NvmeConversionCheckTest and not NvmeConversionConvertTest'(extension root, Linux root)azdev style nvme-conversion(existing virtualenv, private configuration pointing to the isolated worktree)python scripts/ci/test_index.py -qpython setup.py build --build-base <external-build-base> bdist_wheel --dist-dir <external-wheel-dir> --bdist-dir <external-bdist-dir>(extension root)git diff --cached --check; Python syntax and documentationnvme-conversion checkhandler with--controller-type NVMe --ignore-os-check --ignore-sku-check --ignore-windows-version-checkLocal style setup needed its usual package metadata; no dependency installation
or global development/authentication changes were made. Canonical-source
validation exposed and corrected the extension-list response wrapper difference.
API 403 denial was reproduced against the preserved old helper and is no longer
treated as extension absence.
Current validation made no new VM deployments, guest RunCommand calls or Azure
resource mutations. No encrypted live VM conversion was attempted: ADE is now
explicitly rejected. The existing ALAR Rust unit test emits telemetry.
Earlier shared-shell/ALAR RHEL 7.9 validation remains historical: 37 units,
191 multi-mode fixtures and real SCSI/NVMe/reboot/rollback with timeout 240 passed.
Earlier native ARM64/plaintext Oracle results do not imply ADE compatibility.
Stable public SSH remains a separate unresolved category.
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.