Adds live migration ttrpc service definition#2691
Adds live migration ttrpc service definition#2691rawahars wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
|
||
| message MigrationInitializeOptions { | ||
| // Origin is the side of migration the workflow is performed on. | ||
| string origin = 1; |
There was a problem hiding this comment.
What will this be used for?
There was a problem hiding this comment.
It is part of the initialize options which we send to HCS- https://github.com/rawahars/hcsshim/blob/3a23596d02431453538cd967bd174889429c8038/internal/hcs/schema2/migration.go#L6
| // PrepareMemoryTransferMode extends timeout for cross-version live migration. | ||
| bool prepare_memory_transfer_mode = 8; | ||
| // CompatibilityData is opaque VM compatibility data. | ||
| bytes compatibility_data = 9; |
There was a problem hiding this comment.
How will compatibility data be used?
There was a problem hiding this comment.
This data is sent to HCS. This is part of the initialize options that are sent to HCS- https://github.com/rawahars/hcsshim/blob/3a23596d02431453538cd967bd174889429c8038/internal/hcs/schema2/migration.go#L6
| bytes compatibility_data = 9; | ||
| } | ||
|
|
||
| message MemoryMigrationTransferThrottleParams { |
There was a problem hiding this comment.
Do we know if there are HCS test cases for validating all these attributes?
There was a problem hiding this comment.
Let's chat offline about these.
| // Migration is done. | ||
| MIGRATION_EVENT_DONE = 6; | ||
| // Migration recovery has been performed. | ||
| MIGRATION_EVENT_RECOVERY_DONE = 7; |
There was a problem hiding this comment.
When are Events MIGRATION_EVENT_RECOVERY_DONE and MIGRATION_EVENT_OFFLINE_DONE expected?
There was a problem hiding this comment.
These are the set of events sent by HCS. We can chat offline about these.
| // Taking the VM offline is done. | ||
| MIGRATION_EVENT_OFFLINE_DONE = 4; | ||
| // The VM has successfully started again after blackout phase. | ||
| MIGRATION_EVENT_BLACKOUT_EXITED = 5; |
There was a problem hiding this comment.
Is MIGRATION_EVENT_BLACKOUT_EXITED different from MIGRATION_EVENT_DONE?
There was a problem hiding this comment.
Yes these are different. HCS sends them as separate events.
|
|
||
| enum FinalizeAction { | ||
| ACTION_UNSPECIFIED = 0; | ||
| STOP = 1; |
There was a problem hiding this comment.
FINALIZE_ACTION_STOP, FINALIZE_ACTION_RESUME
Introduces the Live Migration ttrpc service with RPCs for preparing, transferring memory, and finalizing sandbox live migration between source and destination hosts. Includes sandbox state serialization for cross-host config propagation. Signed-off-by: Harsh Rawat <harshrawat@microsoft.com>
Summary
This pull request introduces a new live migration service to the codebase, including its protocol definitions, generated Go bindings, and integration into the project configuration. The migration service manages sandbox live migration workflows, handling preparation, memory transfer, and finalization. Additionally, it adds a type for capturing sandbox state during migration.
Live migration service introduction:
migrationpackage, including proto definitions (migration.proto) for the live migration service, which defines the migration workflow (preparation, memory transfer, finalization, and socket duplication) and all related messages and enums.migration_ttrpc.pb.go) for the migration service, providing server and client interfaces for use in Go code.migrationpackage indoc.go.migrationpackage in theProtobuild.tomlfile, ensuring proto code generation for the package.Sandbox state capture:
StatedStatetype tosandbox-spec/vm/v2/migration.go, used to capture and transfer the exported configuration of a sandbox during live migration, and registered it with the typeurl registry.