From 84c5a799061431fddcd5f3dc50b937f38897424a Mon Sep 17 00:00:00 2001 From: Phan Le Date: Thu, 5 Dec 2024 17:04:07 -0800 Subject: [PATCH] feat: support v2 volume live migration longhorn-6361 Signed-off-by: Phan Le --- controller/volume_controller.go | 63 +++- k8s/crds.yaml | 350 ++++++++--------------- k8s/pkg/apis/longhorn/v1beta2/replica.go | 4 + 3 files changed, 173 insertions(+), 244 deletions(-) diff --git a/controller/volume_controller.go b/controller/volume_controller.go index cd98ae6165..b514e6227c 100644 --- a/controller/volume_controller.go +++ b/controller/volume_controller.go @@ -4022,6 +4022,18 @@ func (c *VolumeController) createAndStartMatchingReplicas(v *longhorn.Volume, rs, pathToOldRs, pathToNewRs map[string]*longhorn.Replica, fixupFunc func(r *longhorn.Replica, obj string), obj string) error { log := getLoggerForVolume(c.logger, v) + if types.IsDataEngineV2(v.Spec.DataEngine) { + for path, r := range pathToOldRs { + if pathToNewRs[path] != nil { + continue + } + fixupFunc(r, obj) + rs[r.Name] = r + pathToNewRs[path] = r + } + return nil + } + for path, r := range pathToOldRs { if pathToNewRs[path] != nil { continue @@ -4041,7 +4053,7 @@ func (c *VolumeController) createAndStartMatchingReplicas(v *longhorn.Volume, return nil } -func (c *VolumeController) deleteInvalidMigrationReplicas(rs, pathToOldRs, pathToNewRs map[string]*longhorn.Replica) error { +func (c *VolumeController) deleteInvalidMigrationReplicas(rs, pathToOldRs, pathToNewRs map[string]*longhorn.Replica, v *longhorn.Volume) error { for path, r := range pathToNewRs { matchTheOldReplica := pathToOldRs[path] != nil && r.Spec.DesireState == pathToOldRs[path].Spec.DesireState newReplicaIsAvailable := r.DeletionTimestamp == nil && r.Spec.DesireState == longhorn.InstanceStateRunning && @@ -4050,8 +4062,12 @@ func (c *VolumeController) deleteInvalidMigrationReplicas(rs, pathToOldRs, pathT continue } delete(pathToNewRs, path) - if err := c.deleteReplica(r, rs); err != nil { - return errors.Wrapf(err, "failed to delete the new replica %v when there is no matching old replica in path %v", r.Name, path) + if types.IsDataEngineV1(v.Spec.DataEngine) { + if err := c.deleteReplica(r, rs); err != nil { + return errors.Wrapf(err, "failed to delete the new replica %v when there is no matching old replica in path %v", r.Name, path) + } + } else { + r.Spec.MigrationEngineName = "" } } return nil @@ -4135,9 +4151,16 @@ func (c *VolumeController) processMigration(v *longhorn.Volume, es map[string]*l currentEngine.Spec.Active = true // cleanupCorruptedOrStaleReplicas() will take care of old replicas - c.switchActiveReplicas(rs, func(r *longhorn.Replica, engineName string) bool { - return r.Spec.EngineName == engineName && r.Spec.HealthyAt != "" - }, currentEngine.Name) + if types.IsDataEngineV1(v.Spec.DataEngine) { + c.switchActiveReplicas(rs, func(r *longhorn.Replica, engineName string) bool { + return r.Spec.EngineName == engineName && r.Spec.HealthyAt != "" + }, currentEngine.Name) + } else { + for _, r := range rs { + r.Spec.MigrationEngineName = "" + r.Spec.EngineName = currentEngine.Name + } + } // migration rollback or confirmation finished v.Status.CurrentMigrationNodeID = "" @@ -4174,13 +4197,19 @@ func (c *VolumeController) processMigration(v *longhorn.Volume, es map[string]*l return } - for _, r := range rs { - if r.Spec.EngineName == currentEngine.Name { - continue + if types.IsDataEngineV1(v.Spec.DataEngine) { + for _, r := range rs { + if r.Spec.EngineName == currentEngine.Name { + continue + } + if err2 := c.deleteReplica(r, rs); err2 != nil { + err = errors.Wrapf(err, "failed to delete the migration replica %v during the migration revert: %v", r.Name, err2) + return + } } - if err2 := c.deleteReplica(r, rs); err2 != nil { - err = errors.Wrapf(err, "failed to delete the migration replica %v during the migration revert: %v", r.Name, err2) - return + } else { + for _, r := range rs { + r.Spec.MigrationEngineName = "" } } }() @@ -4297,6 +4326,8 @@ func (c *VolumeController) prepareReplicasAndEngineForMigration(v *longhorn.Volu } } else if r.Spec.EngineName == migrationEngine.Name { migrationReplicas[dataPath] = r + } else if r.Spec.MigrationEngineName == migrationEngine.Name { + migrationReplicas[dataPath] = r } else { log.Warnf("During migration found unknown replica with engine %v, will directly remove it", r.Spec.EngineName) if err := c.deleteReplica(r, rs); err != nil { @@ -4305,12 +4336,16 @@ func (c *VolumeController) prepareReplicasAndEngineForMigration(v *longhorn.Volu } } - if err := c.deleteInvalidMigrationReplicas(rs, currentAvailableReplicas, migrationReplicas); err != nil { + if err := c.deleteInvalidMigrationReplicas(rs, currentAvailableReplicas, migrationReplicas, v); err != nil { return false, false, err } if err := c.createAndStartMatchingReplicas(v, rs, currentAvailableReplicas, migrationReplicas, func(r *longhorn.Replica, engineName string) { - r.Spec.EngineName = engineName + if types.IsDataEngineV1(v.Spec.DataEngine) { + r.Spec.EngineName = engineName + } else { + r.Spec.MigrationEngineName = engineName + } }, migrationEngine.Name); err != nil { return false, false, err } diff --git a/k8s/crds.yaml b/k8s/crds.yaml index 2b57b5ddcb..735a11092b 100644 --- a/k8s/crds.yaml +++ b/k8s/crds.yaml @@ -19,8 +19,7 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - description: The current state of the pod used to provision the backing image - file from source + - description: The current state of the pod used to provision the backing image file from source jsonPath: .status.currentState name: State type: string @@ -42,8 +41,7 @@ spec: name: v1beta1 schema: openAPIV3Schema: - description: BackingImageDataSource is where Longhorn stores backing image - data source object. + description: BackingImageDataSource is where Longhorn stores backing image data source object. properties: apiVersion: description: |- @@ -76,8 +74,7 @@ spec: jsonPath: .spec.uuid name: UUID type: string - - description: The current state of the pod used to provision the backing image - file from source + - description: The current state of the pod used to provision the backing image file from source jsonPath: .status.currentState name: State type: string @@ -103,8 +100,7 @@ spec: name: v1beta2 schema: openAPIV3Schema: - description: BackingImageDataSource is where Longhorn stores backing image - data source object. + description: BackingImageDataSource is where Longhorn stores backing image data source object. properties: apiVersion: description: |- @@ -124,8 +120,7 @@ spec: metadata: type: object spec: - description: BackingImageDataSourceSpec defines the desired state of the - Longhorn backing image data source + description: BackingImageDataSourceSpec defines the desired state of the Longhorn backing image data source properties: checksum: type: string @@ -153,8 +148,7 @@ spec: type: string type: object status: - description: BackingImageDataSourceStatus defines the observed state of - the Longhorn backing image data source + description: BackingImageDataSourceStatus defines the observed state of the Longhorn backing image data source properties: checksum: type: string @@ -231,8 +225,7 @@ spec: name: v1beta1 schema: openAPIV3Schema: - description: BackingImageManager is where Longhorn stores backing image manager - object. + description: BackingImageManager is where Longhorn stores backing image manager object. properties: apiVersion: description: |- @@ -287,8 +280,7 @@ spec: name: v1beta2 schema: openAPIV3Schema: - description: BackingImageManager is where Longhorn stores backing image manager - object. + description: BackingImageManager is where Longhorn stores backing image manager object. properties: apiVersion: description: |- @@ -308,8 +300,7 @@ spec: metadata: type: object spec: - description: BackingImageManagerSpec defines the desired state of the - Longhorn backing image manager + description: BackingImageManagerSpec defines the desired state of the Longhorn backing image manager properties: backingImages: additionalProperties: @@ -325,8 +316,7 @@ spec: type: string type: object status: - description: BackingImageManagerStatus defines the observed state of the - Longhorn backing image manager + description: BackingImageManagerStatus defines the observed state of the Longhorn backing image manager properties: apiMinVersion: type: integer @@ -491,8 +481,7 @@ spec: metadata: type: object spec: - description: BackingImageSpec defines the desired state of the Longhorn - backing image + description: BackingImageSpec defines the desired state of the Longhorn backing image properties: checksum: type: string @@ -510,8 +499,7 @@ spec: disks: additionalProperties: type: string - description: Deprecated. We are now using DiskFileSpecMap to assign - different spec to the file on different disks. + description: Deprecated. We are now using DiskFileSpecMap to assign different spec to the file on different disks. type: object minNumberOfCopies: type: integer @@ -537,8 +525,7 @@ spec: type: string type: object status: - description: BackingImageStatus defines the observed state of the Longhorn - backing image status + description: BackingImageStatus defines the observed state of the Longhorn backing image status properties: checksum: type: string @@ -564,8 +551,7 @@ spec: ownerID: type: string realSize: - description: Real size of image in bytes, which may be smaller than the size - when the file is a sparse file. Will be zero until known (e.g. while a backing image is uploading) + description: Real size of image in bytes, which may be smaller than the size when the file is a sparse file. Will be zero until known (e.g. while a backing image is uploading) format: int64 type: integer size: @@ -574,8 +560,7 @@ spec: uuid: type: string virtualSize: - description: Virtual size of image in bytes, which may be larger than physical - size. Will be zero until known (e.g. while a backing image is uploading) + description: Virtual size of image in bytes, which may be larger than physical size. Will be zero until known (e.g. while a backing image is uploading) format: int64 type: integer type: object @@ -628,8 +613,7 @@ spec: name: v1beta2 schema: openAPIV3Schema: - description: BackupBackingImage is where Longhorn stores backing image backup - object. + description: BackupBackingImage is where Longhorn stores backing image backup object. properties: apiVersion: description: |- @@ -649,8 +633,7 @@ spec: metadata: type: object spec: - description: BackupBackingImageSpec defines the desired state of the Longhorn - backing image backup + description: BackupBackingImageSpec defines the desired state of the Longhorn backing image backup properties: labels: additionalProperties: @@ -658,8 +641,7 @@ spec: description: The labels of backing image backup. type: object syncRequestedAt: - description: The time to request run sync the remote backing image - backup. + description: The time to request run sync the remote backing image backup. format: date-time nullable: true type: string @@ -672,8 +654,7 @@ spec: - userCreated type: object status: - description: BackupBackingImageStatus defines the observed state of the - Longhorn backing image backup + description: BackupBackingImageStatus defines the observed state of the Longhorn backing image backup properties: backingImage: description: The backing image name. @@ -697,25 +678,21 @@ spec: nullable: true type: object lastSyncedAt: - description: The last time that the backing image backup was synced - with the remote backup target. + description: The last time that the backing image backup was synced with the remote backup target. format: date-time nullable: true type: string managerAddress: - description: The address of the backing image manager that runs backing - image backup. + description: The address of the backing image manager that runs backing image backup. type: string messages: additionalProperties: type: string - description: The error messages when listing or inspecting backing - image backup. + description: The error messages when listing or inspecting backing image backup. nullable: true type: object ownerID: - description: The node ID on which the controller is responsible to - reconcile this CR. + description: The node ID on which the controller is responsible to reconcile this CR. type: string progress: description: The backing image backup progress. @@ -904,24 +881,21 @@ spec: nullable: true type: object lastSyncedAt: - description: The last time that the backup was synced with the remote - backup target. + description: The last time that the backup was synced with the remote backup target. format: date-time nullable: true type: string messages: additionalProperties: type: string - description: The error messages when calling longhorn engine on listing - or inspecting backups. + description: The error messages when calling longhorn engine on listing or inspecting backups. nullable: true type: object newlyUploadDataSize: description: Size in bytes of newly uploaded data type: string ownerID: - description: The node ID on which the controller is responsible to - reconcile this backup CR. + description: The node ID on which the controller is responsible to reconcile this backup CR. type: string progress: description: The snapshot backup progress. @@ -1095,8 +1069,7 @@ spec: metadata: type: object spec: - description: BackupTargetSpec defines the desired state of the Longhorn - backup target + description: BackupTargetSpec defines the desired state of the Longhorn backup target properties: backupTargetURL: description: The backup target URL. @@ -1105,8 +1078,7 @@ spec: description: The backup target credential secret. type: string pollInterval: - description: The interval that the cluster needs to run sync with - the backup target. + description: The interval that the cluster needs to run sync with the backup target. type: string syncRequestedAt: description: The time to request run sync the remote backup target. @@ -1115,12 +1087,10 @@ spec: type: string type: object status: - description: BackupTargetStatus defines the observed state of the Longhorn - backup target + description: BackupTargetStatus defines the observed state of the Longhorn backup target properties: available: - description: Available indicates if the remote backup target is available - or not. + description: Available indicates if the remote backup target is available or not. type: boolean conditions: description: Records the reason on why the backup target is unavailable. @@ -1130,16 +1100,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -1153,14 +1120,12 @@ spec: nullable: true type: array lastSyncedAt: - description: The last time that the controller synced with the remote - backup target. + description: The last time that the controller synced with the remote backup target. format: date-time nullable: true type: string ownerID: - description: The node ID on which the controller is responsible to - reconcile this backup target CR. + description: The node ID on which the controller is responsible to reconcile this backup target CR. type: string type: object type: object @@ -1276,8 +1241,7 @@ spec: metadata: type: object spec: - description: BackupVolumeSpec defines the desired state of the Longhorn - backup volume + description: BackupVolumeSpec defines the desired state of the Longhorn backup volume properties: syncRequestedAt: description: The time to request run sync the remote backup volume. @@ -1286,8 +1250,7 @@ spec: type: string type: object status: - description: BackupVolumeStatus defines the observed state of the Longhorn - backup volume + description: BackupVolumeStatus defines the observed state of the Longhorn backup volume properties: backingImageChecksum: description: the backing image checksum. @@ -1319,21 +1282,18 @@ spec: nullable: true type: string lastSyncedAt: - description: The last time that the backup volume was synced into - the cluster. + description: The last time that the backup volume was synced into the cluster. format: date-time nullable: true type: string messages: additionalProperties: type: string - description: The error messages when call longhorn engine on list - or inspect backup volumes. + description: The error messages when call longhorn engine on list or inspect backup volumes. nullable: true type: object ownerID: - description: The node ID on which the controller is responsible to - reconcile this backup volume CR. + description: The node ID on which the controller is responsible to reconcile this backup volume CR. type: string size: description: The backup volume size. @@ -1478,8 +1438,7 @@ spec: metadata: type: object spec: - description: EngineImageSpec defines the desired state of the Longhorn - engine image + description: EngineImageSpec defines the desired state of the Longhorn engine image properties: image: minLength: 1 @@ -1488,8 +1447,7 @@ spec: - image type: object status: - description: EngineImageStatus defines the observed state of the Longhorn - engine image + description: EngineImageStatus defines the observed state of the Longhorn engine image properties: buildDate: type: string @@ -1504,16 +1462,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -1787,16 +1742,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -2066,8 +2018,7 @@ spec: metadata: type: object spec: - description: InstanceManagerSpec defines the desired state of the Longhorn - instance manager + description: InstanceManagerSpec defines the desired state of the Longhorn instance manager properties: dataEngine: type: string @@ -2091,8 +2042,7 @@ spec: type: string type: object status: - description: InstanceManagerStatus defines the observed state of the Longhorn - instance manager + description: InstanceManagerStatus defines the observed state of the Longhorn instance manager properties: apiMinVersion: type: integer @@ -2308,8 +2258,7 @@ spec: jsonPath: .status.conditions['Ready']['status'] name: Ready type: string - - description: Indicate whether the user disabled/enabled replica scheduling for - the node + - description: Indicate whether the user disabled/enabled replica scheduling for the node jsonPath: .spec.allowScheduling name: AllowScheduling type: boolean @@ -2356,8 +2305,7 @@ spec: jsonPath: .status.conditions[?(@.type=='Ready')].status name: Ready type: string - - description: Indicate whether the user disabled/enabled replica scheduling for - the node + - description: Indicate whether the user disabled/enabled replica scheduling for the node jsonPath: .spec.allowScheduling name: AllowScheduling type: boolean @@ -2447,16 +2395,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -2479,16 +2424,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from - one status to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details - about last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the - condition's last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -2607,12 +2549,10 @@ spec: metadata: type: object spec: - description: OrphanSpec defines the desired state of the Longhorn orphaned - data + description: OrphanSpec defines the desired state of the Longhorn orphaned data properties: nodeID: - description: The node ID on which the controller is responsible to - reconcile this orphan CR. + description: The node ID on which the controller is responsible to reconcile this orphan CR. type: string orphanType: description: |- @@ -2626,8 +2566,7 @@ spec: type: object type: object status: - description: OrphanStatus defines the observed state of the Longhorn orphaned - data + description: OrphanStatus defines the observed state of the Longhorn orphaned data properties: conditions: items: @@ -2636,16 +2575,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -2687,8 +2623,7 @@ spec: scope: Namespaced versions: - additionalPrinterColumns: - - description: Sets groupings to the jobs. When set to "default" group will be - added to the volume label when no other job label exist in volume + - description: Sets groupings to the jobs. When set to "default" group will be added to the volume label when no other job label exist in volume jsonPath: .spec.groups name: Groups type: string @@ -2747,13 +2682,11 @@ spec: subresources: status: {} - additionalPrinterColumns: - - description: Sets groupings to the jobs. When set to "default" group will be - added to the volume label when no other job label exist in volume + - description: Sets groupings to the jobs. When set to "default" group will be added to the volume label when no other job label exist in volume jsonPath: .spec.groups name: Groups type: string - - description: Should be one of "snapshot", "snapshot-force-create", "snapshot-cleanup", - "snapshot-delete", "backup", "backup-force-create" or "filesystem-trim" + - description: Should be one of "snapshot", "snapshot-force-create", "snapshot-cleanup", "snapshot-delete", "backup", "backup-force-create" or "filesystem-trim" jsonPath: .spec.task name: Task type: string @@ -2799,8 +2732,7 @@ spec: metadata: type: object spec: - description: RecurringJobSpec defines the desired state of the Longhorn - recurring job + description: RecurringJobSpec defines the desired state of the Longhorn recurring job properties: concurrency: description: The concurrency of taking the snapshot/backup. @@ -2846,15 +2778,13 @@ spec: type: string type: object status: - description: RecurringJobStatus defines the observed state of the Longhorn - recurring job + description: RecurringJobStatus defines the observed state of the Longhorn recurring job properties: executionCount: description: The number of jobs that have been triggered. type: integer ownerID: - description: The owner ID which is responsible to reconcile this recurring - job CR. + description: The owner ID which is responsible to reconcile this recurring job CR. type: string type: object type: object @@ -3059,6 +2989,11 @@ spec: type: string logRequested: type: boolean + migrationEngineName: + description: |- + MigrationEngineName is indicating the migrating engine which current connected to this replica. This is only + used for live migration of v2 data engine + type: string nodeID: type: string rebuildRetryCount: @@ -3081,8 +3016,7 @@ spec: type: string type: object status: - description: ReplicaStatus defines the observed state of the Longhorn - replica + description: ReplicaStatus defines the observed state of the Longhorn replica properties: conditions: items: @@ -3091,16 +3025,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -3353,25 +3284,20 @@ spec: metadata: type: object spec: - description: ShareManagerSpec defines the desired state of the Longhorn - share manager + description: ShareManagerSpec defines the desired state of the Longhorn share manager properties: image: - description: Share manager image used for creating a share manager - pod + description: Share manager image used for creating a share manager pod type: string type: object status: - description: ShareManagerStatus defines the observed state of the Longhorn - share manager + description: ShareManagerStatus defines the observed state of the Longhorn share manager properties: endpoint: - description: NFS endpoint that can access the mounted filesystem of - the volume + description: NFS endpoint that can access the mounted filesystem of the volume type: string ownerID: - description: The node ID on which the controller is responsible to - reconcile this share manager resource + description: The node ID on which the controller is responsible to reconcile this share manager resource type: string state: description: The state of the share manager resource @@ -3411,13 +3337,11 @@ spec: jsonPath: .status.creationTime name: CreationTime type: string - - description: Indicates if the snapshot is ready to be used to restore/backup - a volume + - description: Indicates if the snapshot is ready to be used to restore/backup a volume jsonPath: .status.readyToUse name: ReadyToUse type: boolean - - description: Represents the minimum size of volume required to rehydrate from - this snapshot + - description: Represents the minimum size of volume required to rehydrate from this snapshot jsonPath: .status.restoreSize name: RestoreSize type: string @@ -3571,8 +3495,7 @@ spec: metadata: type: object spec: - description: SupportBundleSpec defines the desired state of the Longhorn - SupportBundle + description: SupportBundleSpec defines the desired state of the Longhorn SupportBundle properties: description: description: A brief description of the issue @@ -3588,8 +3511,7 @@ spec: - description type: object status: - description: SupportBundleStatus defines the observed state of the Longhorn - SupportBundle + description: SupportBundleStatus defines the observed state of the Longhorn SupportBundle properties: conditions: items: @@ -3598,16 +3520,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -3703,8 +3622,7 @@ spec: metadata: type: object spec: - description: SystemBackupSpec defines the desired state of the Longhorn - SystemBackup + description: SystemBackupSpec defines the desired state of the Longhorn SystemBackup properties: volumeBackupPolicy: description: |- @@ -3714,8 +3632,7 @@ spec: type: string type: object status: - description: SystemBackupStatus defines the observed state of the Longhorn - SystemBackup + description: SystemBackupStatus defines the observed state of the Longhorn SystemBackup properties: conditions: items: @@ -3724,16 +3641,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -3755,8 +3669,7 @@ spec: nullable: true type: string lastSyncedAt: - description: The last time that the system backup was synced into - the cluster. + description: The last time that the system backup was synced into the cluster. format: date-time nullable: true type: string @@ -3764,8 +3677,7 @@ spec: description: The saved manager image. type: string ownerID: - description: The node ID of the responsible controller to reconcile - this SystemBackup. + description: The node ID of the responsible controller to reconcile this SystemBackup. type: string state: description: The system backup state. @@ -3831,8 +3743,7 @@ spec: metadata: type: object spec: - description: SystemRestoreSpec defines the desired state of the Longhorn - SystemRestore + description: SystemRestoreSpec defines the desired state of the Longhorn SystemRestore properties: systemBackup: description: The system backup name in the object store. @@ -3841,8 +3752,7 @@ spec: - systemBackup type: object status: - description: SystemRestoreStatus defines the observed state of the Longhorn - SystemRestore + description: SystemRestoreStatus defines the observed state of the Longhorn SystemRestore properties: conditions: items: @@ -3851,16 +3761,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -3874,8 +3781,7 @@ spec: nullable: true type: array ownerID: - description: The node ID of the responsible controller to reconcile - this SystemRestore. + description: The node ID of the responsible controller to reconcile this SystemRestore. type: string sourceURL: description: The source system backup URL. @@ -3916,8 +3822,7 @@ spec: name: v1beta2 schema: openAPIV3Schema: - description: VolumeAttachment stores attachment information of a Longhorn - volume + description: VolumeAttachment stores attachment information of a Longhorn volume properties: apiVersion: description: |- @@ -3937,8 +3842,7 @@ spec: metadata: type: object spec: - description: VolumeAttachmentSpec defines the desired state of Longhorn - VolumeAttachment + description: VolumeAttachmentSpec defines the desired state of Longhorn VolumeAttachment properties: attachmentTickets: additionalProperties: @@ -3950,8 +3854,7 @@ spec: format: int64 type: integer id: - description: The unique ID of this attachment. Used to differentiate - different attachments of the same volume. + description: The unique ID of this attachment. Used to differentiate different attachments of the same volume. type: string nodeID: description: The node that this attachment is requesting @@ -3972,8 +3875,7 @@ spec: - volume type: object status: - description: VolumeAttachmentStatus defines the observed state of Longhorn - VolumeAttachment + description: VolumeAttachmentStatus defines the observed state of Longhorn VolumeAttachment properties: attachmentTicketStatuses: additionalProperties: @@ -3986,16 +3888,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from - one status to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details - about last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the - condition's last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- @@ -4015,12 +3914,10 @@ spec: format: int64 type: integer id: - description: The unique ID of this attachment. Used to differentiate - different attachments of the same volume. + description: The unique ID of this attachment. Used to differentiate different attachments of the same volume. type: string satisfied: - description: Indicate whether this attachment ticket has been - satisfied + description: Indicate whether this attachment ticket has been satisfied type: boolean required: - conditions @@ -4217,8 +4114,7 @@ spec: description: 'Deprecated: Replaced by field `image`.' type: string freezeFilesystemForSnapshot: - description: Setting that freezes the filesystem on the root partition - before a snapshot is created. + description: Setting that freezes the filesystem on the root partition before a snapshot is created. enum: - ignored - enabled @@ -4257,24 +4153,21 @@ spec: - best-effort type: string replicaDiskSoftAntiAffinity: - description: Replica disk soft anti affinity of the volume. Set enabled - to allow replicas to be scheduled in the same disk. + description: Replica disk soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same disk. enum: - ignored - enabled - disabled type: string replicaSoftAntiAffinity: - description: Replica soft anti affinity of the volume. Set enabled - to allow replicas to be scheduled on the same node. + description: Replica soft anti affinity of the volume. Set enabled to allow replicas to be scheduled on the same node. enum: - ignored - enabled - disabled type: string replicaZoneSoftAntiAffinity: - description: Replica zone soft anti affinity of the volume. Set enabled - to allow replicas to be scheduled in the same zone. + description: Replica zone soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same zone. enum: - ignored - enabled @@ -4338,16 +4231,13 @@ spec: description: Last time we probed the condition. type: string lastTransitionTime: - description: Last time the condition transitioned from one status - to another. + description: Last time the condition transitioned from one status to another. type: string message: - description: Human-readable message indicating details about - last transition. + description: Human-readable message indicating details about last transition. type: string reason: - description: Unique, one-word, CamelCase reason for the condition's - last transition. + description: Unique, one-word, CamelCase reason for the condition's last transition. type: string status: description: |- diff --git a/k8s/pkg/apis/longhorn/v1beta2/replica.go b/k8s/pkg/apis/longhorn/v1beta2/replica.go index e676f3028f..298c042373 100644 --- a/k8s/pkg/apis/longhorn/v1beta2/replica.go +++ b/k8s/pkg/apis/longhorn/v1beta2/replica.go @@ -25,6 +25,10 @@ type ReplicaSpec struct { // +optional EngineName string `json:"engineName"` // +optional + // MigrationEngineName is indicating the migrating engine which current connected to this replica. This is only + // used for live migration of v2 data engine + MigrationEngineName string `json:"migrationEngineName"` + // +optional // HealthyAt is set the first time a replica becomes read/write in an engine after creation or rebuild. HealthyAt // indicates the time the last successful rebuild occurred. When HealthyAt is set, a replica is likely to have // useful (though possibly stale) data. HealthyAt is cleared before a rebuild. HealthyAt may be later than the