Skip to content

Implement VM Live Migrations#866

Draft
nesitor wants to merge 10 commits intomainfrom
andres-feature-implement_qemu_live_migration
Draft

Implement VM Live Migrations#866
nesitor wants to merge 10 commits intomainfrom
andres-feature-implement_qemu_live_migration

Conversation

@nesitor
Copy link
Copy Markdown
Member

@nesitor nesitor commented Jan 29, 2026

Feature: Implement Live migration support on CRNs. It includes 2 new endpoints to manage the VM live migration between CRNs, moving memory and disk data between hosts.

Self proofreading checklist

  • The new code clear, easy to read and well commented.
  • New code does not duplicate the functions of builtin or popular libraries.
  • An LLM was used to review the new code and look for simplifications.
  • New classes and functions contain docstrings explaining what they provide.
  • All new code is covered by relevant tests.
  • Documentation has been updated regarding these changes.
  • Dependencies update in the project.toml have been mirrored in the Debian package build script packaging/Makefile

Changes

Implemented this workflow:

Scheduler                               Destination CRN                                                                                                                                                  
---------                               ---------------                                                                                                                                                  
1. POST /control/migrate                                                                                                                                                                                 
- Auth: X-Auth-Signature                                                                                                                                                               
- Body: {vm_hash, migration_port}                                                                                                                                                                        
- Fetch message, validate                                                                                                                                                                                
- Create destination disk image                                                                                                                                                                          
- Setup network (TAP, firewall)                                                                                                                                                                          
- Start QEMU with -incoming flag                                                                                                                                                                         
- Return {status: "ready", migration_host, migration_port}                                                                                                                                               
                                                                                                                                                                                                         
Scheduler                               Source CRN                                                                                                                                                       
---------                               -----------                                                                                                                                                      
2. VM Running                                                                                                                                                                                            
                                                                                                                                                                                                         
3. POST /control/machine/{ref}/migration/start                                                                                                                                                           
- Auth: X-Auth-Signature                                                                                                                                                           
- Body: {destination_host, destination_port}                                                                                                                                                             
- Validate running VM                                                                                                                                                                                    
- Send QMP migrate command  --> Destination receives data                                                                                                                                                
(migrate -d -b -i)            (memory + disk)                                                                                                                                                            
- VM resumes execution                                                                                                                                                                                   
- Auto-reconfigure guest network IP                                                                                                                                                                      
                                                                                                                                                                                                         
4. Source VM auto-stopped & cleaned up                                                                                                                                                                   

@nesitor nesitor self-assigned this Jan 29, 2026
@nesitor nesitor changed the title Implemente VM Live Migrations Jan 29, 2026
@nesitor nesitor changed the title Implemente VM Live Migrations Implement VM Live Migrations Jan 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 80.16726% with 166 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.35%. Comparing base (4dbda19) to head (d0f4b1f).

Files with missing lines Patch % Lines
src/aleph/vm/orchestrator/views/migration.py 48.83% 127 Missing and 5 partials ⚠️
src/aleph/vm/pool.py 5.00% 19 Missing ⚠️
src/aleph/vm/controllers/configuration.py 45.45% 6 Missing ⚠️
src/aleph/vm/hypervisors/qemu/qemuvm.py 66.66% 1 Missing and 2 partials ⚠️
src/aleph/vm/controllers/qemu/instance.py 75.00% 1 Missing and 1 partial ⚠️
src/aleph/vm/controllers/qemu/client.py 98.52% 0 Missing and 1 partial ⚠️
...aleph/vm/controllers/qemu_confidential/instance.py 50.00% 1 Missing ⚠️
src/aleph/vm/models.py 92.85% 0 Missing and 1 partial ⚠️
src/aleph/vm/orchestrator/views/operator.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
+ Coverage   66.14%   67.35%   +1.20%     
==========================================
  Files          89       92       +3     
  Lines        8815     9635     +820     
  Branches      781      834      +53     
==========================================
+ Hits         5831     6490     +659     
- Misses       2748     2897     +149     
- Partials      236      248      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nesitor nesitor force-pushed the andres-feature-implement_qemu_live_migration branch 4 times, most recently from 74233a2 to d0f4b1f Compare February 4, 2026 19:20
@aliel aliel force-pushed the andres-feature-implement_qemu_live_migration branch from 2c89935 to 240c8a8 Compare February 18, 2026 11:40
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