diff --git a/Protobuild.toml b/Protobuild.toml index 1e34eb92f1..414d1ac06a 100644 --- a/Protobuild.toml +++ b/Protobuild.toml @@ -21,5 +21,6 @@ prefixes = [ "github.com/Microsoft/hcsshim/internal/computeagent", "github.com/Microsoft/hcsshim/internal/ncproxyttrpc", "github.com/Microsoft/hcsshim/internal/vmservice", + "github.com/Microsoft/hcsshim/internal/migration", ] generators = ["go", "go-ttrpc"] diff --git a/internal/migration/doc.go b/internal/migration/doc.go new file mode 100644 index 0000000000..28df60e9e9 --- /dev/null +++ b/internal/migration/doc.go @@ -0,0 +1,4 @@ +// Package migration contains the proto and compiled go files for the live +// migration service, which manages sandbox live migration workflows including +// preparation, memory transfer, and finalization. +package migration diff --git a/internal/migration/migration.pb.go b/internal/migration/migration.pb.go new file mode 100644 index 0000000000..49a116f107 --- /dev/null +++ b/internal/migration/migration.pb.go @@ -0,0 +1,1180 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v5.26.0 +// source: github.com/Microsoft/hcsshim/internal/migration/migration.proto + +package migration + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" + durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MigrationOrigin indicates where migration is initiated from. +type MigrationOrigin int32 + +const ( + MigrationOrigin_MIGRATION_ORIGIN_UNSPECIFIED MigrationOrigin = 0 + // Source side of migration. + MigrationOrigin_MIGRATION_ORIGIN_SOURCE MigrationOrigin = 1 + // Destination side of migration. + MigrationOrigin_MIGRATION_ORIGIN_DESTINATION MigrationOrigin = 2 +) + +// Enum value maps for MigrationOrigin. +var ( + MigrationOrigin_name = map[int32]string{ + 0: "MIGRATION_ORIGIN_UNSPECIFIED", + 1: "MIGRATION_ORIGIN_SOURCE", + 2: "MIGRATION_ORIGIN_DESTINATION", + } + MigrationOrigin_value = map[string]int32{ + "MIGRATION_ORIGIN_UNSPECIFIED": 0, + "MIGRATION_ORIGIN_SOURCE": 1, + "MIGRATION_ORIGIN_DESTINATION": 2, + } +) + +func (x MigrationOrigin) Enum() *MigrationOrigin { + p := new(MigrationOrigin) + *p = x + return p +} + +func (x MigrationOrigin) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MigrationOrigin) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[0].Descriptor() +} + +func (MigrationOrigin) Type() protoreflect.EnumType { + return &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[0] +} + +func (x MigrationOrigin) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MigrationOrigin.Descriptor instead. +func (MigrationOrigin) EnumDescriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{0} +} + +// MigrationMemoryTransport is the transport protocol used for memory transfer during migration. +type MigrationMemoryTransport int32 + +const ( + MigrationMemoryTransport_MIGRATION_MEMORY_TRANSPORT_UNSPECIFIED MigrationMemoryTransport = 0 + // VM memory is copied over a TCP/IP connection. + MigrationMemoryTransport_MIGRATION_MEMORY_TRANSPORT_TCP MigrationMemoryTransport = 1 +) + +// Enum value maps for MigrationMemoryTransport. +var ( + MigrationMemoryTransport_name = map[int32]string{ + 0: "MIGRATION_MEMORY_TRANSPORT_UNSPECIFIED", + 1: "MIGRATION_MEMORY_TRANSPORT_TCP", + } + MigrationMemoryTransport_value = map[string]int32{ + "MIGRATION_MEMORY_TRANSPORT_UNSPECIFIED": 0, + "MIGRATION_MEMORY_TRANSPORT_TCP": 1, + } +) + +func (x MigrationMemoryTransport) Enum() *MigrationMemoryTransport { + p := new(MigrationMemoryTransport) + *p = x + return p +} + +func (x MigrationMemoryTransport) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MigrationMemoryTransport) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[1].Descriptor() +} + +func (MigrationMemoryTransport) Type() protoreflect.EnumType { + return &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[1] +} + +func (x MigrationMemoryTransport) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MigrationMemoryTransport.Descriptor instead. +func (MigrationMemoryTransport) EnumDescriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{1} +} + +// Describes a set of live migration events. +type MigrationEvent int32 + +const ( + MigrationEvent_MIGRATION_EVENT_UNKNOWN MigrationEvent = 0 + // The LM setup is done. + MigrationEvent_MIGRATION_EVENT_SETUP_DONE MigrationEvent = 1 + // The VM is still transferring memory and necessary states. + MigrationEvent_MIGRATION_EVENT_TRANSFER_IN_PROGRESS MigrationEvent = 2 + // The VM starts the blackout phase. + MigrationEvent_MIGRATION_EVENT_BLACKOUT_STARTED MigrationEvent = 3 + // Taking the VM offline is done. + MigrationEvent_MIGRATION_EVENT_OFFLINE_DONE MigrationEvent = 4 + // The VM has successfully started again after blackout phase. + MigrationEvent_MIGRATION_EVENT_BLACKOUT_EXITED MigrationEvent = 5 + // Migration is done. + MigrationEvent_MIGRATION_EVENT_DONE MigrationEvent = 6 + // Migration recovery has been performed. + MigrationEvent_MIGRATION_EVENT_RECOVERY_DONE MigrationEvent = 7 + // Migration failed. + MigrationEvent_MIGRATION_EVENT_FAILED MigrationEvent = 8 +) + +// Enum value maps for MigrationEvent. +var ( + MigrationEvent_name = map[int32]string{ + 0: "MIGRATION_EVENT_UNKNOWN", + 1: "MIGRATION_EVENT_SETUP_DONE", + 2: "MIGRATION_EVENT_TRANSFER_IN_PROGRESS", + 3: "MIGRATION_EVENT_BLACKOUT_STARTED", + 4: "MIGRATION_EVENT_OFFLINE_DONE", + 5: "MIGRATION_EVENT_BLACKOUT_EXITED", + 6: "MIGRATION_EVENT_DONE", + 7: "MIGRATION_EVENT_RECOVERY_DONE", + 8: "MIGRATION_EVENT_FAILED", + } + MigrationEvent_value = map[string]int32{ + "MIGRATION_EVENT_UNKNOWN": 0, + "MIGRATION_EVENT_SETUP_DONE": 1, + "MIGRATION_EVENT_TRANSFER_IN_PROGRESS": 2, + "MIGRATION_EVENT_BLACKOUT_STARTED": 3, + "MIGRATION_EVENT_OFFLINE_DONE": 4, + "MIGRATION_EVENT_BLACKOUT_EXITED": 5, + "MIGRATION_EVENT_DONE": 6, + "MIGRATION_EVENT_RECOVERY_DONE": 7, + "MIGRATION_EVENT_FAILED": 8, + } +) + +func (x MigrationEvent) Enum() *MigrationEvent { + p := new(MigrationEvent) + *p = x + return p +} + +func (x MigrationEvent) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MigrationEvent) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[2].Descriptor() +} + +func (MigrationEvent) Type() protoreflect.EnumType { + return &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[2] +} + +func (x MigrationEvent) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MigrationEvent.Descriptor instead. +func (MigrationEvent) EnumDescriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{2} +} + +type FinalizeAction int32 + +const ( + FinalizeAction_FINALIZE_ACTION_UNSPECIFIED FinalizeAction = 0 + FinalizeAction_FINALIZE_ACTION_STOP FinalizeAction = 1 + FinalizeAction_FINALIZE_ACTION_RESUME FinalizeAction = 2 +) + +// Enum value maps for FinalizeAction. +var ( + FinalizeAction_name = map[int32]string{ + 0: "FINALIZE_ACTION_UNSPECIFIED", + 1: "FINALIZE_ACTION_STOP", + 2: "FINALIZE_ACTION_RESUME", + } + FinalizeAction_value = map[string]int32{ + "FINALIZE_ACTION_UNSPECIFIED": 0, + "FINALIZE_ACTION_STOP": 1, + "FINALIZE_ACTION_RESUME": 2, + } +) + +func (x FinalizeAction) Enum() *FinalizeAction { + p := new(FinalizeAction) + *p = x + return p +} + +func (x FinalizeAction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FinalizeAction) Descriptor() protoreflect.EnumDescriptor { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[3].Descriptor() +} + +func (FinalizeAction) Type() protoreflect.EnumType { + return &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes[3] +} + +func (x FinalizeAction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FinalizeAction.Descriptor instead. +func (FinalizeAction) EnumDescriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{3} +} + +type MigrationInitializeOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Origin is the side of migration the workflow is performed on. + Origin MigrationOrigin `protobuf:"varint,1,opt,name=origin,proto3,enum=MigrationOrigin" json:"origin,omitempty"` + // MemoryTransport specifies the transport protocol for memory transfer during migration. + MemoryTransport MigrationMemoryTransport `protobuf:"varint,2,opt,name=memory_transport,json=memoryTransport,proto3,enum=MigrationMemoryTransport" json:"memory_transport,omitempty"` + // MemoryTransferThrottleParams specifies settings for throttling during memory transfer. + MemoryTransferThrottleParams *MemoryMigrationTransferThrottleParams `protobuf:"bytes,3,opt,name=memory_transfer_throttle_params,json=memoryTransferThrottleParams,proto3,oneof" json:"memory_transfer_throttle_params,omitempty"` + // CompressionSettings specifies additional settings when compression is enabled. + CompressionSettings *MigrationCompressionSettings `protobuf:"bytes,4,opt,name=compression_settings,json=compressionSettings,proto3,oneof" json:"compression_settings,omitempty"` + // ChecksumVerification enables memory checksum verification. + ChecksumVerification bool `protobuf:"varint,5,opt,name=checksum_verification,json=checksumVerification,proto3" json:"checksum_verification,omitempty"` + // PerfTracingEnabled enables performance tracing during migration. + PerfTracingEnabled bool `protobuf:"varint,6,opt,name=perf_tracing_enabled,json=perfTracingEnabled,proto3" json:"perf_tracing_enabled,omitempty"` + // CancelIfBlackoutThresholdExceeds cancels the operation if the blackout threshold is exceeded. + CancelIfBlackoutThresholdExceeds bool `protobuf:"varint,7,opt,name=cancel_if_blackout_threshold_exceeds,json=cancelIfBlackoutThresholdExceeds,proto3" json:"cancel_if_blackout_threshold_exceeds,omitempty"` + // PrepareMemoryTransferMode extends timeout for cross-version live migration. + PrepareMemoryTransferMode bool `protobuf:"varint,8,opt,name=prepare_memory_transfer_mode,json=prepareMemoryTransferMode,proto3" json:"prepare_memory_transfer_mode,omitempty"` + // CompatibilityData is the compatibility information required for the destination VM. + CompatibilityData *CompatibilityInfo `protobuf:"bytes,9,opt,name=compatibility_data,json=compatibilityData,proto3,oneof" json:"compatibility_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MigrationInitializeOptions) Reset() { + *x = MigrationInitializeOptions{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MigrationInitializeOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MigrationInitializeOptions) ProtoMessage() {} + +func (x *MigrationInitializeOptions) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MigrationInitializeOptions.ProtoReflect.Descriptor instead. +func (*MigrationInitializeOptions) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{0} +} + +func (x *MigrationInitializeOptions) GetOrigin() MigrationOrigin { + if x != nil { + return x.Origin + } + return MigrationOrigin_MIGRATION_ORIGIN_UNSPECIFIED +} + +func (x *MigrationInitializeOptions) GetMemoryTransport() MigrationMemoryTransport { + if x != nil { + return x.MemoryTransport + } + return MigrationMemoryTransport_MIGRATION_MEMORY_TRANSPORT_UNSPECIFIED +} + +func (x *MigrationInitializeOptions) GetMemoryTransferThrottleParams() *MemoryMigrationTransferThrottleParams { + if x != nil { + return x.MemoryTransferThrottleParams + } + return nil +} + +func (x *MigrationInitializeOptions) GetCompressionSettings() *MigrationCompressionSettings { + if x != nil { + return x.CompressionSettings + } + return nil +} + +func (x *MigrationInitializeOptions) GetChecksumVerification() bool { + if x != nil { + return x.ChecksumVerification + } + return false +} + +func (x *MigrationInitializeOptions) GetPerfTracingEnabled() bool { + if x != nil { + return x.PerfTracingEnabled + } + return false +} + +func (x *MigrationInitializeOptions) GetCancelIfBlackoutThresholdExceeds() bool { + if x != nil { + return x.CancelIfBlackoutThresholdExceeds + } + return false +} + +func (x *MigrationInitializeOptions) GetPrepareMemoryTransferMode() bool { + if x != nil { + return x.PrepareMemoryTransferMode + } + return false +} + +func (x *MigrationInitializeOptions) GetCompatibilityData() *CompatibilityInfo { + if x != nil { + return x.CompatibilityData + } + return nil +} + +// CompatibilityInfo is opaque VM compatibility data, primarily used in migration. +type CompatibilityInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Raw compatibility information. + Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CompatibilityInfo) Reset() { + *x = CompatibilityInfo{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CompatibilityInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CompatibilityInfo) ProtoMessage() {} + +func (x *CompatibilityInfo) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CompatibilityInfo.ProtoReflect.Descriptor instead. +func (*CompatibilityInfo) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{1} +} + +func (x *CompatibilityInfo) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +type MemoryMigrationTransferThrottleParams struct { + state protoimpl.MessageState `protogen:"open.v1"` + // A flag indicating if throttling should be skipped. + SkipThrottling *bool `protobuf:"varint,1,opt,name=skip_throttling,json=skipThrottling,proto3,oneof" json:"skip_throttling,omitempty"` + // The scale of the throttling. The value is in percentage (1-100). + ThrottlingScale *float64 `protobuf:"fixed64,2,opt,name=throttling_scale,json=throttlingScale,proto3,oneof" json:"throttling_scale,omitempty"` + // Minimum percentage value to which memory transfer can be throttled. + MinimumThrottlePercentage *uint32 `protobuf:"varint,3,opt,name=minimum_throttle_percentage,json=minimumThrottlePercentage,proto3,oneof" json:"minimum_throttle_percentage,omitempty"` + // Number of memory transfer passes targeted before the VM enters blackout. + TargetNumberOfBrownoutTransferPasses *uint32 `protobuf:"varint,4,opt,name=target_number_of_brownout_transfer_passes,json=targetNumberOfBrownoutTransferPasses,proto3,oneof" json:"target_number_of_brownout_transfer_passes,omitempty"` + // The starting transfer pass where throttling is starting. + StartingBrownoutPassNumberForThrottling *uint32 `protobuf:"varint,5,opt,name=starting_brownout_pass_number_for_throttling,json=startingBrownoutPassNumberForThrottling,proto3,oneof" json:"starting_brownout_pass_number_for_throttling,omitempty"` + // Maximum number of memory transfer passes before forcing the VM to enter blackout. + MaximumNumberOfBrownoutTransferPasses *uint32 `protobuf:"varint,6,opt,name=maximum_number_of_brownout_transfer_passes,json=maximumNumberOfBrownoutTransferPasses,proto3,oneof" json:"maximum_number_of_brownout_transfer_passes,omitempty"` + // Expected duration for blackout transfer time. + TargetBlackoutTransferTime *uint32 `protobuf:"varint,7,opt,name=target_blackout_transfer_time,json=targetBlackoutTransferTime,proto3,oneof" json:"target_blackout_transfer_time,omitempty"` + // Threshold for blackout duration prior to cancelling migration. + BlackoutTimeThresholdForCancellingMigration *uint32 `protobuf:"varint,8,opt,name=blackout_time_threshold_for_cancelling_migration,json=blackoutTimeThresholdForCancellingMigration,proto3,oneof" json:"blackout_time_threshold_for_cancelling_migration,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MemoryMigrationTransferThrottleParams) Reset() { + *x = MemoryMigrationTransferThrottleParams{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MemoryMigrationTransferThrottleParams) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MemoryMigrationTransferThrottleParams) ProtoMessage() {} + +func (x *MemoryMigrationTransferThrottleParams) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MemoryMigrationTransferThrottleParams.ProtoReflect.Descriptor instead. +func (*MemoryMigrationTransferThrottleParams) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{2} +} + +func (x *MemoryMigrationTransferThrottleParams) GetSkipThrottling() bool { + if x != nil && x.SkipThrottling != nil { + return *x.SkipThrottling + } + return false +} + +func (x *MemoryMigrationTransferThrottleParams) GetThrottlingScale() float64 { + if x != nil && x.ThrottlingScale != nil { + return *x.ThrottlingScale + } + return 0 +} + +func (x *MemoryMigrationTransferThrottleParams) GetMinimumThrottlePercentage() uint32 { + if x != nil && x.MinimumThrottlePercentage != nil { + return *x.MinimumThrottlePercentage + } + return 0 +} + +func (x *MemoryMigrationTransferThrottleParams) GetTargetNumberOfBrownoutTransferPasses() uint32 { + if x != nil && x.TargetNumberOfBrownoutTransferPasses != nil { + return *x.TargetNumberOfBrownoutTransferPasses + } + return 0 +} + +func (x *MemoryMigrationTransferThrottleParams) GetStartingBrownoutPassNumberForThrottling() uint32 { + if x != nil && x.StartingBrownoutPassNumberForThrottling != nil { + return *x.StartingBrownoutPassNumberForThrottling + } + return 0 +} + +func (x *MemoryMigrationTransferThrottleParams) GetMaximumNumberOfBrownoutTransferPasses() uint32 { + if x != nil && x.MaximumNumberOfBrownoutTransferPasses != nil { + return *x.MaximumNumberOfBrownoutTransferPasses + } + return 0 +} + +func (x *MemoryMigrationTransferThrottleParams) GetTargetBlackoutTransferTime() uint32 { + if x != nil && x.TargetBlackoutTransferTime != nil { + return *x.TargetBlackoutTransferTime + } + return 0 +} + +func (x *MemoryMigrationTransferThrottleParams) GetBlackoutTimeThresholdForCancellingMigration() uint32 { + if x != nil && x.BlackoutTimeThresholdForCancellingMigration != nil { + return *x.BlackoutTimeThresholdForCancellingMigration + } + return 0 +} + +type MigrationCompressionSettings struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Number of worker threads used for [de]compression. Values higher than what the host + // and VM configuration can support will be adjusted. The value should be non-zero. + ThrottleWorkerCount *uint32 `protobuf:"varint,1,opt,name=throttle_worker_count,json=throttleWorkerCount,proto3,oneof" json:"throttle_worker_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MigrationCompressionSettings) Reset() { + *x = MigrationCompressionSettings{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MigrationCompressionSettings) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MigrationCompressionSettings) ProtoMessage() {} + +func (x *MigrationCompressionSettings) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MigrationCompressionSettings.ProtoReflect.Descriptor instead. +func (*MigrationCompressionSettings) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{3} +} + +func (x *MigrationCompressionSettings) GetThrottleWorkerCount() uint32 { + if x != nil && x.ThrottleWorkerCount != nil { + return *x.ThrottleWorkerCount + } + return 0 +} + +type PrepareAndExportSandboxRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Idempotency key for the migration session (stable across retries). + SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + // Options for initializing the live migration on the source. + InitOptions *MigrationInitializeOptions `protobuf:"bytes,2,opt,name=init_options,json=initOptions,proto3" json:"init_options,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PrepareAndExportSandboxRequest) Reset() { + *x = PrepareAndExportSandboxRequest{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PrepareAndExportSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrepareAndExportSandboxRequest) ProtoMessage() {} + +func (x *PrepareAndExportSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrepareAndExportSandboxRequest.ProtoReflect.Descriptor instead. +func (*PrepareAndExportSandboxRequest) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{4} +} + +func (x *PrepareAndExportSandboxRequest) GetSessionID() string { + if x != nil { + return x.SessionID + } + return "" +} + +func (x *PrepareAndExportSandboxRequest) GetInitOptions() *MigrationInitializeOptions { + if x != nil { + return x.InitOptions + } + return nil +} + +type PrepareAndExportSandboxResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // An opaque config that should be set in the CreateSandbox input on the destination. + Config *anypb.Any `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PrepareAndExportSandboxResponse) Reset() { + *x = PrepareAndExportSandboxResponse{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PrepareAndExportSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PrepareAndExportSandboxResponse) ProtoMessage() {} + +func (x *PrepareAndExportSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PrepareAndExportSandboxResponse.ProtoReflect.Descriptor instead. +func (*PrepareAndExportSandboxResponse) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{5} +} + +func (x *PrepareAndExportSandboxResponse) GetConfig() *anypb.Any { + if x != nil { + return x.Config + } + return nil +} + +type TransferSandboxRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Idempotency key for migration session. + SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + // Max time to wait for socket/connection readiness before declaring TIMEOUT. + // If unset, server uses a sensible default (e.g., 10 minutes). + Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransferSandboxRequest) Reset() { + *x = TransferSandboxRequest{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransferSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferSandboxRequest) ProtoMessage() {} + +func (x *TransferSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferSandboxRequest.ProtoReflect.Descriptor instead. +func (*TransferSandboxRequest) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{6} +} + +func (x *TransferSandboxRequest) GetSessionID() string { + if x != nil { + return x.SessionID + } + return "" +} + +func (x *TransferSandboxRequest) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +type TransferSandboxResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Increments per message; can be used to dedupe after client restarts. + MessageID uint32 `protobuf:"varint,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + // Current migration event. + Event MigrationEvent `protobuf:"varint,2,opt,name=event,proto3,enum=MigrationEvent" json:"event,omitempty"` + // Populated when event indicates an error or timeout. + ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` + // Event-specific message from the migration notification. + // This will be used in the future to send additional data such as progress percentage. + EventMessage string `protobuf:"bytes,4,opt,name=event_message,json=eventMessage,proto3" json:"event_message,omitempty"` + // When the transfer started (according to the server). + StartTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // When this update was produced. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TransferSandboxResponse) Reset() { + *x = TransferSandboxResponse{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TransferSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransferSandboxResponse) ProtoMessage() {} + +func (x *TransferSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TransferSandboxResponse.ProtoReflect.Descriptor instead. +func (*TransferSandboxResponse) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{7} +} + +func (x *TransferSandboxResponse) GetMessageID() uint32 { + if x != nil { + return x.MessageID + } + return 0 +} + +func (x *TransferSandboxResponse) GetEvent() MigrationEvent { + if x != nil { + return x.Event + } + return MigrationEvent_MIGRATION_EVENT_UNKNOWN +} + +func (x *TransferSandboxResponse) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *TransferSandboxResponse) GetEventMessage() string { + if x != nil { + return x.EventMessage + } + return "" +} + +func (x *TransferSandboxResponse) GetStartTime() *timestamppb.Timestamp { + if x != nil { + return x.StartTime + } + return nil +} + +func (x *TransferSandboxResponse) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +type FinalizeSandboxRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Idempotency key for the session (must match the key used in PrepareSandbox). + SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + // Action to perform on the sandbox at finalize time. + Action FinalizeAction `protobuf:"varint,2,opt,name=action,proto3,enum=FinalizeAction" json:"action,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FinalizeSandboxRequest) Reset() { + *x = FinalizeSandboxRequest{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FinalizeSandboxRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinalizeSandboxRequest) ProtoMessage() {} + +func (x *FinalizeSandboxRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FinalizeSandboxRequest.ProtoReflect.Descriptor instead. +func (*FinalizeSandboxRequest) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{8} +} + +func (x *FinalizeSandboxRequest) GetSessionID() string { + if x != nil { + return x.SessionID + } + return "" +} + +func (x *FinalizeSandboxRequest) GetAction() FinalizeAction { + if x != nil { + return x.Action + } + return FinalizeAction_FINALIZE_ACTION_UNSPECIFIED +} + +type FinalizeSandboxResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FinalizeSandboxResponse) Reset() { + *x = FinalizeSandboxResponse{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FinalizeSandboxResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FinalizeSandboxResponse) ProtoMessage() {} + +func (x *FinalizeSandboxResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FinalizeSandboxResponse.ProtoReflect.Descriptor instead. +func (*FinalizeSandboxResponse) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{9} +} + +type CreateDuplicateSocketRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // Idempotency key; must match active LM session. + SessionID string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + // Serialized WSAProtocolInfo struct (opaque to clients). + ProtocolInfo []byte `protobuf:"bytes,2,opt,name=protocol_info,json=protocolInfo,proto3" json:"protocol_info,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateDuplicateSocketRequest) Reset() { + *x = CreateDuplicateSocketRequest{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateDuplicateSocketRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDuplicateSocketRequest) ProtoMessage() {} + +func (x *CreateDuplicateSocketRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDuplicateSocketRequest.ProtoReflect.Descriptor instead. +func (*CreateDuplicateSocketRequest) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{10} +} + +func (x *CreateDuplicateSocketRequest) GetSessionID() string { + if x != nil { + return x.SessionID + } + return "" +} + +func (x *CreateDuplicateSocketRequest) GetProtocolInfo() []byte { + if x != nil { + return x.ProtocolInfo + } + return nil +} + +type CreateDuplicateSocketResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateDuplicateSocketResponse) Reset() { + *x = CreateDuplicateSocketResponse{} + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateDuplicateSocketResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateDuplicateSocketResponse) ProtoMessage() {} + +func (x *CreateDuplicateSocketResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateDuplicateSocketResponse.ProtoReflect.Descriptor instead. +func (*CreateDuplicateSocketResponse) Descriptor() ([]byte, []int) { + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP(), []int{11} +} + +var File_github_com_Microsoft_hcsshim_internal_migration_migration_proto protoreflect.FileDescriptor + +const file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDesc = "" + + "\n" + + "?github.com/Microsoft/hcsshim/internal/migration/migration.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xeb\x05\n" + + "\x1aMigrationInitializeOptions\x12(\n" + + "\x06origin\x18\x01 \x01(\x0e2\x10.MigrationOriginR\x06origin\x12D\n" + + "\x10memory_transport\x18\x02 \x01(\x0e2\x19.MigrationMemoryTransportR\x0fmemoryTransport\x12r\n" + + "\x1fmemory_transfer_throttle_params\x18\x03 \x01(\v2&.MemoryMigrationTransferThrottleParamsH\x00R\x1cmemoryTransferThrottleParams\x88\x01\x01\x12U\n" + + "\x14compression_settings\x18\x04 \x01(\v2\x1d.MigrationCompressionSettingsH\x01R\x13compressionSettings\x88\x01\x01\x123\n" + + "\x15checksum_verification\x18\x05 \x01(\bR\x14checksumVerification\x120\n" + + "\x14perf_tracing_enabled\x18\x06 \x01(\bR\x12perfTracingEnabled\x12N\n" + + "$cancel_if_blackout_threshold_exceeds\x18\a \x01(\bR cancelIfBlackoutThresholdExceeds\x12?\n" + + "\x1cprepare_memory_transfer_mode\x18\b \x01(\bR\x19prepareMemoryTransferMode\x12F\n" + + "\x12compatibility_data\x18\t \x01(\v2\x12.CompatibilityInfoH\x02R\x11compatibilityData\x88\x01\x01B\"\n" + + " _memory_transfer_throttle_paramsB\x17\n" + + "\x15_compression_settingsB\x15\n" + + "\x13_compatibility_data\"'\n" + + "\x11CompatibilityInfo\x12\x12\n" + + "\x04data\x18\x01 \x01(\fR\x04data\"\xce\a\n" + + "%MemoryMigrationTransferThrottleParams\x12,\n" + + "\x0fskip_throttling\x18\x01 \x01(\bH\x00R\x0eskipThrottling\x88\x01\x01\x12.\n" + + "\x10throttling_scale\x18\x02 \x01(\x01H\x01R\x0fthrottlingScale\x88\x01\x01\x12C\n" + + "\x1bminimum_throttle_percentage\x18\x03 \x01(\rH\x02R\x19minimumThrottlePercentage\x88\x01\x01\x12\\\n" + + ")target_number_of_brownout_transfer_passes\x18\x04 \x01(\rH\x03R$targetNumberOfBrownoutTransferPasses\x88\x01\x01\x12b\n" + + ",starting_brownout_pass_number_for_throttling\x18\x05 \x01(\rH\x04R'startingBrownoutPassNumberForThrottling\x88\x01\x01\x12^\n" + + "*maximum_number_of_brownout_transfer_passes\x18\x06 \x01(\rH\x05R%maximumNumberOfBrownoutTransferPasses\x88\x01\x01\x12F\n" + + "\x1dtarget_blackout_transfer_time\x18\a \x01(\rH\x06R\x1atargetBlackoutTransferTime\x88\x01\x01\x12j\n" + + "0blackout_time_threshold_for_cancelling_migration\x18\b \x01(\rH\aR+blackoutTimeThresholdForCancellingMigration\x88\x01\x01B\x12\n" + + "\x10_skip_throttlingB\x13\n" + + "\x11_throttling_scaleB\x1e\n" + + "\x1c_minimum_throttle_percentageB,\n" + + "*_target_number_of_brownout_transfer_passesB/\n" + + "-_starting_brownout_pass_number_for_throttlingB-\n" + + "+_maximum_number_of_brownout_transfer_passesB \n" + + "\x1e_target_blackout_transfer_timeB3\n" + + "1_blackout_time_threshold_for_cancelling_migration\"q\n" + + "\x1cMigrationCompressionSettings\x127\n" + + "\x15throttle_worker_count\x18\x01 \x01(\rH\x00R\x13throttleWorkerCount\x88\x01\x01B\x18\n" + + "\x16_throttle_worker_count\"\x7f\n" + + "\x1ePrepareAndExportSandboxRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12>\n" + + "\finit_options\x18\x02 \x01(\v2\x1b.MigrationInitializeOptionsR\vinitOptions\"O\n" + + "\x1fPrepareAndExportSandboxResponse\x12,\n" + + "\x06config\x18\x01 \x01(\v2\x14.google.protobuf.AnyR\x06config\"l\n" + + "\x16TransferSandboxRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x123\n" + + "\atimeout\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"\xa1\x02\n" + + "\x17TransferSandboxResponse\x12\x1d\n" + + "\n" + + "message_id\x18\x01 \x01(\rR\tmessageId\x12%\n" + + "\x05event\x18\x02 \x01(\x0e2\x0f.MigrationEventR\x05event\x12#\n" + + "\rerror_message\x18\x03 \x01(\tR\ferrorMessage\x12#\n" + + "\revent_message\x18\x04 \x01(\tR\feventMessage\x129\n" + + "\n" + + "start_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tstartTime\x12;\n" + + "\vupdate_time\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "updateTime\"`\n" + + "\x16FinalizeSandboxRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12'\n" + + "\x06action\x18\x02 \x01(\x0e2\x0f.FinalizeActionR\x06action\"\x19\n" + + "\x17FinalizeSandboxResponse\"b\n" + + "\x1cCreateDuplicateSocketRequest\x12\x1d\n" + + "\n" + + "session_id\x18\x01 \x01(\tR\tsessionId\x12#\n" + + "\rprotocol_info\x18\x02 \x01(\fR\fprotocolInfo\"\x1f\n" + + "\x1dCreateDuplicateSocketResponse*r\n" + + "\x0fMigrationOrigin\x12 \n" + + "\x1cMIGRATION_ORIGIN_UNSPECIFIED\x10\x00\x12\x1b\n" + + "\x17MIGRATION_ORIGIN_SOURCE\x10\x01\x12 \n" + + "\x1cMIGRATION_ORIGIN_DESTINATION\x10\x02*j\n" + + "\x18MigrationMemoryTransport\x12*\n" + + "&MIGRATION_MEMORY_TRANSPORT_UNSPECIFIED\x10\x00\x12\"\n" + + "\x1eMIGRATION_MEMORY_TRANSPORT_TCP\x10\x01*\xbd\x02\n" + + "\x0eMigrationEvent\x12\x1b\n" + + "\x17MIGRATION_EVENT_UNKNOWN\x10\x00\x12\x1e\n" + + "\x1aMIGRATION_EVENT_SETUP_DONE\x10\x01\x12(\n" + + "$MIGRATION_EVENT_TRANSFER_IN_PROGRESS\x10\x02\x12$\n" + + " MIGRATION_EVENT_BLACKOUT_STARTED\x10\x03\x12 \n" + + "\x1cMIGRATION_EVENT_OFFLINE_DONE\x10\x04\x12#\n" + + "\x1fMIGRATION_EVENT_BLACKOUT_EXITED\x10\x05\x12\x18\n" + + "\x14MIGRATION_EVENT_DONE\x10\x06\x12!\n" + + "\x1dMIGRATION_EVENT_RECOVERY_DONE\x10\a\x12\x1a\n" + + "\x16MIGRATION_EVENT_FAILED\x10\b*g\n" + + "\x0eFinalizeAction\x12\x1f\n" + + "\x1bFINALIZE_ACTION_UNSPECIFIED\x10\x00\x12\x18\n" + + "\x14FINALIZE_ACTION_STOP\x10\x01\x12\x1a\n" + + "\x16FINALIZE_ACTION_RESUME\x10\x022\xcf\x02\n" + + "\tMigration\x12\\\n" + + "\x17PrepareAndExportSandbox\x12\x1f.PrepareAndExportSandboxRequest\x1a .PrepareAndExportSandboxResponse\x12F\n" + + "\x0fTransferSandbox\x12\x17.TransferSandboxRequest\x1a\x18.TransferSandboxResponse0\x01\x12D\n" + + "\x0fFinalizeSandbox\x12\x17.FinalizeSandboxRequest\x1a\x18.FinalizeSandboxResponse\x12V\n" + + "\x15CreateDuplicateSocket\x12\x1d.CreateDuplicateSocketRequest\x1a\x1e.CreateDuplicateSocketResponseB;Z9github.com/Microsoft/hcsshim/internal/migration;migrationb\x06proto3" + +var ( + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescOnce sync.Once + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescData []byte +) + +func file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescGZIP() []byte { + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescOnce.Do(func() { + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDesc), len(file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDesc))) + }) + return file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDescData +} + +var file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_goTypes = []any{ + (MigrationOrigin)(0), // 0: MigrationOrigin + (MigrationMemoryTransport)(0), // 1: MigrationMemoryTransport + (MigrationEvent)(0), // 2: MigrationEvent + (FinalizeAction)(0), // 3: FinalizeAction + (*MigrationInitializeOptions)(nil), // 4: MigrationInitializeOptions + (*CompatibilityInfo)(nil), // 5: CompatibilityInfo + (*MemoryMigrationTransferThrottleParams)(nil), // 6: MemoryMigrationTransferThrottleParams + (*MigrationCompressionSettings)(nil), // 7: MigrationCompressionSettings + (*PrepareAndExportSandboxRequest)(nil), // 8: PrepareAndExportSandboxRequest + (*PrepareAndExportSandboxResponse)(nil), // 9: PrepareAndExportSandboxResponse + (*TransferSandboxRequest)(nil), // 10: TransferSandboxRequest + (*TransferSandboxResponse)(nil), // 11: TransferSandboxResponse + (*FinalizeSandboxRequest)(nil), // 12: FinalizeSandboxRequest + (*FinalizeSandboxResponse)(nil), // 13: FinalizeSandboxResponse + (*CreateDuplicateSocketRequest)(nil), // 14: CreateDuplicateSocketRequest + (*CreateDuplicateSocketResponse)(nil), // 15: CreateDuplicateSocketResponse + (*anypb.Any)(nil), // 16: google.protobuf.Any + (*durationpb.Duration)(nil), // 17: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp +} +var file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_depIdxs = []int32{ + 0, // 0: MigrationInitializeOptions.origin:type_name -> MigrationOrigin + 1, // 1: MigrationInitializeOptions.memory_transport:type_name -> MigrationMemoryTransport + 6, // 2: MigrationInitializeOptions.memory_transfer_throttle_params:type_name -> MemoryMigrationTransferThrottleParams + 7, // 3: MigrationInitializeOptions.compression_settings:type_name -> MigrationCompressionSettings + 5, // 4: MigrationInitializeOptions.compatibility_data:type_name -> CompatibilityInfo + 4, // 5: PrepareAndExportSandboxRequest.init_options:type_name -> MigrationInitializeOptions + 16, // 6: PrepareAndExportSandboxResponse.config:type_name -> google.protobuf.Any + 17, // 7: TransferSandboxRequest.timeout:type_name -> google.protobuf.Duration + 2, // 8: TransferSandboxResponse.event:type_name -> MigrationEvent + 18, // 9: TransferSandboxResponse.start_time:type_name -> google.protobuf.Timestamp + 18, // 10: TransferSandboxResponse.update_time:type_name -> google.protobuf.Timestamp + 3, // 11: FinalizeSandboxRequest.action:type_name -> FinalizeAction + 8, // 12: Migration.PrepareAndExportSandbox:input_type -> PrepareAndExportSandboxRequest + 10, // 13: Migration.TransferSandbox:input_type -> TransferSandboxRequest + 12, // 14: Migration.FinalizeSandbox:input_type -> FinalizeSandboxRequest + 14, // 15: Migration.CreateDuplicateSocket:input_type -> CreateDuplicateSocketRequest + 9, // 16: Migration.PrepareAndExportSandbox:output_type -> PrepareAndExportSandboxResponse + 11, // 17: Migration.TransferSandbox:output_type -> TransferSandboxResponse + 13, // 18: Migration.FinalizeSandbox:output_type -> FinalizeSandboxResponse + 15, // 19: Migration.CreateDuplicateSocket:output_type -> CreateDuplicateSocketResponse + 16, // [16:20] is the sub-list for method output_type + 12, // [12:16] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name +} + +func init() { file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_init() } +func file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_init() { + if File_github_com_Microsoft_hcsshim_internal_migration_migration_proto != nil { + return + } + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[0].OneofWrappers = []any{} + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[2].OneofWrappers = []any{} + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes[3].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDesc), len(file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_rawDesc)), + NumEnums: 4, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_goTypes, + DependencyIndexes: file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_depIdxs, + EnumInfos: file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_enumTypes, + MessageInfos: file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_msgTypes, + }.Build() + File_github_com_Microsoft_hcsshim_internal_migration_migration_proto = out.File + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_goTypes = nil + file_github_com_Microsoft_hcsshim_internal_migration_migration_proto_depIdxs = nil +} diff --git a/internal/migration/migration.proto b/internal/migration/migration.proto new file mode 100644 index 0000000000..459c5f7f97 --- /dev/null +++ b/internal/migration/migration.proto @@ -0,0 +1,167 @@ +syntax = "proto3"; + +option go_package = "github.com/Microsoft/hcsshim/internal/migration;migration"; + +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +service Migration { + // Called on SOURCE. Prepares the sandbox for live migration. + rpc PrepareAndExportSandbox(PrepareAndExportSandboxRequest) returns (PrepareAndExportSandboxResponse); + // Called on SOURCE AND DESTINATION. Initiates memory transfer, and returns a stream of status updates. + rpc TransferSandbox(TransferSandboxRequest) returns (stream TransferSandboxResponse); + // Called on SOURCE AND DESTINATION. Finalizes live migration and starts or deletes the sandbox. + rpc FinalizeSandbox(FinalizeSandboxRequest) returns (FinalizeSandboxResponse); + // Creates a duplicate socket for the migration transport. + rpc CreateDuplicateSocket(CreateDuplicateSocketRequest) returns (CreateDuplicateSocketResponse); +} + +// MigrationOrigin indicates where migration is initiated from. +enum MigrationOrigin { + MIGRATION_ORIGIN_UNSPECIFIED = 0; + // Source side of migration. + MIGRATION_ORIGIN_SOURCE = 1; + // Destination side of migration. + MIGRATION_ORIGIN_DESTINATION = 2; +} + +// MigrationMemoryTransport is the transport protocol used for memory transfer during migration. +enum MigrationMemoryTransport { + MIGRATION_MEMORY_TRANSPORT_UNSPECIFIED = 0; + // VM memory is copied over a TCP/IP connection. + MIGRATION_MEMORY_TRANSPORT_TCP = 1; +} + +message MigrationInitializeOptions { + // Origin is the side of migration the workflow is performed on. + MigrationOrigin origin = 1; + // MemoryTransport specifies the transport protocol for memory transfer during migration. + MigrationMemoryTransport memory_transport = 2; + // MemoryTransferThrottleParams specifies settings for throttling during memory transfer. + optional MemoryMigrationTransferThrottleParams memory_transfer_throttle_params = 3; + // CompressionSettings specifies additional settings when compression is enabled. + optional MigrationCompressionSettings compression_settings = 4; + // ChecksumVerification enables memory checksum verification. + bool checksum_verification = 5; + // PerfTracingEnabled enables performance tracing during migration. + bool perf_tracing_enabled = 6; + // CancelIfBlackoutThresholdExceeds cancels the operation if the blackout threshold is exceeded. + bool cancel_if_blackout_threshold_exceeds = 7; + // PrepareMemoryTransferMode extends timeout for cross-version live migration. + bool prepare_memory_transfer_mode = 8; + // CompatibilityData is the compatibility information required for the destination VM. + optional CompatibilityInfo compatibility_data = 9; +} + +// CompatibilityInfo is opaque VM compatibility data, primarily used in migration. +message CompatibilityInfo { + // Raw compatibility information. + bytes data = 1; +} + +message MemoryMigrationTransferThrottleParams { + // A flag indicating if throttling should be skipped. + optional bool skip_throttling = 1; + // The scale of the throttling. The value is in percentage (1-100). + optional double throttling_scale = 2; + // Minimum percentage value to which memory transfer can be throttled. + optional uint32 minimum_throttle_percentage = 3; + // Number of memory transfer passes targeted before the VM enters blackout. + optional uint32 target_number_of_brownout_transfer_passes = 4; + // The starting transfer pass where throttling is starting. + optional uint32 starting_brownout_pass_number_for_throttling = 5; + // Maximum number of memory transfer passes before forcing the VM to enter blackout. + optional uint32 maximum_number_of_brownout_transfer_passes = 6; + // Expected duration for blackout transfer time. + optional uint32 target_blackout_transfer_time = 7; + // Threshold for blackout duration prior to cancelling migration. + optional uint32 blackout_time_threshold_for_cancelling_migration = 8; +} + +message MigrationCompressionSettings { + // Number of worker threads used for [de]compression. Values higher than what the host + // and VM configuration can support will be adjusted. The value should be non-zero. + optional uint32 throttle_worker_count = 1; +} + +message PrepareAndExportSandboxRequest { + // Idempotency key for the migration session (stable across retries). + string session_id = 1; + // Options for initializing the live migration on the source. + MigrationInitializeOptions init_options = 2; +} + +message PrepareAndExportSandboxResponse { + // An opaque config that should be set in the CreateSandbox input on the destination. + google.protobuf.Any config = 1; +} + +message TransferSandboxRequest { + // Idempotency key for migration session. + string session_id = 1; + // Max time to wait for socket/connection readiness before declaring TIMEOUT. + // If unset, server uses a sensible default (e.g., 10 minutes). + google.protobuf.Duration timeout = 2; +} + +message TransferSandboxResponse { + // Increments per message; can be used to dedupe after client restarts. + uint32 message_id = 1; + // Current migration event. + MigrationEvent event = 2; + // Populated when event indicates an error or timeout. + string error_message = 3; + // Event-specific message from the migration notification. + // This will be used in the future to send additional data such as progress percentage. + string event_message = 4; + // When the transfer started (according to the server). + google.protobuf.Timestamp start_time = 5; + // When this update was produced. + google.protobuf.Timestamp update_time = 6; +} + +// Describes a set of live migration events. +enum MigrationEvent { + MIGRATION_EVENT_UNKNOWN = 0; + // The LM setup is done. + MIGRATION_EVENT_SETUP_DONE = 1; + // The VM is still transferring memory and necessary states. + MIGRATION_EVENT_TRANSFER_IN_PROGRESS = 2; + // The VM starts the blackout phase. + MIGRATION_EVENT_BLACKOUT_STARTED = 3; + // 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; + // Migration is done. + MIGRATION_EVENT_DONE = 6; + // Migration recovery has been performed. + MIGRATION_EVENT_RECOVERY_DONE = 7; + // Migration failed. + MIGRATION_EVENT_FAILED = 8; +} + +message FinalizeSandboxRequest { + // Idempotency key for the session (must match the key used in PrepareSandbox). + string session_id = 1; + // Action to perform on the sandbox at finalize time. + FinalizeAction action = 2; +} + +enum FinalizeAction { + FINALIZE_ACTION_UNSPECIFIED = 0; + FINALIZE_ACTION_STOP = 1; + FINALIZE_ACTION_RESUME = 2; +} + +message FinalizeSandboxResponse {} + +message CreateDuplicateSocketRequest { + // Idempotency key; must match active LM session. + string session_id = 1; + // Serialized WSAProtocolInfo struct (opaque to clients). + bytes protocol_info = 2; +} + +message CreateDuplicateSocketResponse {} diff --git a/internal/migration/migration_ttrpc.pb.go b/internal/migration/migration_ttrpc.pb.go new file mode 100644 index 0000000000..bdffaf0bbc --- /dev/null +++ b/internal/migration/migration_ttrpc.pb.go @@ -0,0 +1,139 @@ +// Code generated by protoc-gen-go-ttrpc. DO NOT EDIT. +// source: github.com/Microsoft/hcsshim/internal/migration/migration.proto +package migration + +import ( + context "context" + ttrpc "github.com/containerd/ttrpc" +) + +type MigrationService interface { + PrepareAndExportSandbox(context.Context, *PrepareAndExportSandboxRequest) (*PrepareAndExportSandboxResponse, error) + TransferSandbox(context.Context, *TransferSandboxRequest, Migration_TransferSandboxServer) error + FinalizeSandbox(context.Context, *FinalizeSandboxRequest) (*FinalizeSandboxResponse, error) + CreateDuplicateSocket(context.Context, *CreateDuplicateSocketRequest) (*CreateDuplicateSocketResponse, error) +} + +type Migration_TransferSandboxServer interface { + Send(*TransferSandboxResponse) error + ttrpc.StreamServer +} + +type migrationTransferSandboxServer struct { + ttrpc.StreamServer +} + +func (x *migrationTransferSandboxServer) Send(m *TransferSandboxResponse) error { + return x.StreamServer.SendMsg(m) +} + +func RegisterMigrationService(srv *ttrpc.Server, svc MigrationService) { + srv.RegisterService("Migration", &ttrpc.ServiceDesc{ + Methods: map[string]ttrpc.Method{ + "PrepareAndExportSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req PrepareAndExportSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.PrepareAndExportSandbox(ctx, &req) + }, + "FinalizeSandbox": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req FinalizeSandboxRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.FinalizeSandbox(ctx, &req) + }, + "CreateDuplicateSocket": func(ctx context.Context, unmarshal func(interface{}) error) (interface{}, error) { + var req CreateDuplicateSocketRequest + if err := unmarshal(&req); err != nil { + return nil, err + } + return svc.CreateDuplicateSocket(ctx, &req) + }, + }, + Streams: map[string]ttrpc.Stream{ + "TransferSandbox": { + Handler: func(ctx context.Context, stream ttrpc.StreamServer) (interface{}, error) { + m := new(TransferSandboxRequest) + if err := stream.RecvMsg(m); err != nil { + return nil, err + } + return nil, svc.TransferSandbox(ctx, m, &migrationTransferSandboxServer{stream}) + }, + StreamingClient: false, + StreamingServer: true, + }, + }, + }) +} + +type MigrationClient interface { + PrepareAndExportSandbox(context.Context, *PrepareAndExportSandboxRequest) (*PrepareAndExportSandboxResponse, error) + TransferSandbox(context.Context, *TransferSandboxRequest) (Migration_TransferSandboxClient, error) + FinalizeSandbox(context.Context, *FinalizeSandboxRequest) (*FinalizeSandboxResponse, error) + CreateDuplicateSocket(context.Context, *CreateDuplicateSocketRequest) (*CreateDuplicateSocketResponse, error) +} + +type migrationClient struct { + client *ttrpc.Client +} + +func NewMigrationClient(client *ttrpc.Client) MigrationClient { + return &migrationClient{ + client: client, + } +} + +func (c *migrationClient) PrepareAndExportSandbox(ctx context.Context, req *PrepareAndExportSandboxRequest) (*PrepareAndExportSandboxResponse, error) { + var resp PrepareAndExportSandboxResponse + if err := c.client.Call(ctx, "Migration", "PrepareAndExportSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *migrationClient) TransferSandbox(ctx context.Context, req *TransferSandboxRequest) (Migration_TransferSandboxClient, error) { + stream, err := c.client.NewStream(ctx, &ttrpc.StreamDesc{ + StreamingClient: false, + StreamingServer: true, + }, "Migration", "TransferSandbox", req) + if err != nil { + return nil, err + } + x := &migrationTransferSandboxClient{stream} + return x, nil +} + +type Migration_TransferSandboxClient interface { + Recv() (*TransferSandboxResponse, error) + ttrpc.ClientStream +} + +type migrationTransferSandboxClient struct { + ttrpc.ClientStream +} + +func (x *migrationTransferSandboxClient) Recv() (*TransferSandboxResponse, error) { + m := new(TransferSandboxResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *migrationClient) FinalizeSandbox(ctx context.Context, req *FinalizeSandboxRequest) (*FinalizeSandboxResponse, error) { + var resp FinalizeSandboxResponse + if err := c.client.Call(ctx, "Migration", "FinalizeSandbox", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} + +func (c *migrationClient) CreateDuplicateSocket(ctx context.Context, req *CreateDuplicateSocketRequest) (*CreateDuplicateSocketResponse, error) { + var resp CreateDuplicateSocketResponse + if err := c.client.Call(ctx, "Migration", "CreateDuplicateSocket", req, &resp); err != nil { + return nil, err + } + return &resp, nil +} diff --git a/sandbox-spec/vm/v2/migration.go b/sandbox-spec/vm/v2/migration.go new file mode 100644 index 0000000000..81439c4840 --- /dev/null +++ b/sandbox-spec/vm/v2/migration.go @@ -0,0 +1,23 @@ +package vm + +import ( + hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2" + "github.com/containerd/typeurl/v2" + anypb "google.golang.org/protobuf/types/known/anypb" +) + +func init() { + typeurl.Register(&MigrationSpec{}, "sandbox-spec/vm/v2/MigrationSpec", "MigrationSpec") +} + +// MigrationSpec captures the exported configuration of a sandbox during live migration, +// used to transfer state from the source to the destination. +type MigrationSpec struct { + // Config is the opaque sandbox configuration exported during PrepareAndExportSandbox, + // to be set in the CreateSandbox input on the destination. + Config *anypb.Any `json:"config,omitempty"` + + // InitOptions contains the migration initialization options used to configure the + // HCS compute system on destination. + InitOptions *hcsschema.MigrationInitializeOptions `json:"init_options,omitempty"` +}