Skip to content

migration: emit migration lifecycle events#107

Open
Coffeeri wants to merge 2 commits intocyberus-technology:gardenlinuxfrom
Coffeeri:downstream-lifecycle-event-emits
Open

migration: emit migration lifecycle events#107
Coffeeri wants to merge 2 commits intocyberus-technology:gardenlinuxfrom
Coffeeri:downstream-lifecycle-event-emits

Conversation

@Coffeeri
Copy link

@Coffeeri Coffeeri commented Mar 12, 2026

This PR ports and adapts the changes from @phip1611 in cloud-hypervisor#7799.

The goal is to simplify the propagation of migration-related events within libvirt, easing integration with libvirt's implementation and laying the groundwork for https://github.com/cobaltcore-dev/cobaltcore/issues/331.

Emitted events

Source:

  • vm.migration-started
  • vm.migration-memory-iteration
  • vm.migration-downtime
  • vm.migration-finished
  • vm.migration-failed
  • vm.migration-cancelled

Destination:

  • vm.migration-receive-started
  • vm.migration-receive-finished
  • vm.migration-receive-failed

@Coffeeri Coffeeri force-pushed the downstream-lifecycle-event-emits branch 3 times, most recently from 7397dca to e446a43 Compare March 13, 2026 07:40
@phip1611 phip1611 enabled auto-merge (rebase) March 13, 2026 08:55
@phip1611 phip1611 disabled auto-merge March 13, 2026 08:55
@Coffeeri Coffeeri force-pushed the downstream-lifecycle-event-emits branch 2 times, most recently from 7c40532 to c954939 Compare March 13, 2026 09:07
Copy link
Member

@phip1611 phip1611 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding work!

@Coffeeri Coffeeri force-pushed the downstream-lifecycle-event-emits branch from c954939 to ca32aa5 Compare March 13, 2026 11:19
Coffeeri and others added 2 commits March 13, 2026 12:40
Emit migration lifecycle events via the event monitor.

This aligns migration with other VM lifecycle operations such as boot,
pause, and resume, allowing external management software to observe
migration progress consistently.

Events emitted:
  src:
    vm.migration-started
    vm.migration-downtime
    vm.migration-finished
    vm.migration-failed
    vm.migration-cancelled
  dst:
    vm.migration-receive-started
    vm.migration-receive-finished
    vm.migration-receive-failed

Co-authored-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
Emit a "vm.migration-memory-iteration" event after every precopy memory
iteration to allow management software to observe forward progress
during migration.

This event is primarily intended for integration with management
software such as libvirt, where it maps to
VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION.

The event is intentionally independent of any upcoming migration
metrics endpoint. Detailed migration statistics will be exposed via
that endpoint, while this event provides a lightweight progress signal
expected by external management layers.

With this event, management software can detect forward progress during
migration without being blocked on any upcoming migration metrics
endpoint.

Co-authored-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
@Coffeeri Coffeeri force-pushed the downstream-lifecycle-event-emits branch from ca32aa5 to 9df7dbc Compare March 13, 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.

2 participants