migration

package
v3.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CRDGroupName represent the group of cnsvspherevolumemigrations CRD.
	CRDGroupName = "cns.vmware.com"
)

Variables

View Source
var ErrVolumeIDNotFound = errors.New("could not retrieve VolumeID from VolumeMigrationService cache")

ErrVolumeIDNotFound is returned when volume is not found from the VolumeMigrationService Cache

Functions

This section is empty.

Types

type VolumeMigrationService

type VolumeMigrationService interface {
	// GetVolumeID returns VolumeID for a given VolumeSpec.
	// When volume is not found in the cache, if registerIfNotFound is set to true, volume registration will be invoked
	// and mapping will be preserved and VolumeID will be returned to the caller
	// Returns an error if not able to retrieve/register Volume.
	GetVolumeID(ctx context.Context, volumeSpec *VolumeSpec, registerIfNotFound bool) (string, error)

	// GetVolumePath returns VolumePath for a given VolumeID.
	// It will also create a CnsVSphereVolumeMigration CR if it's not present.
	GetVolumePath(ctx context.Context, volumeID string) (string, error)

	// GetVolumePathFromMigrationServiceCache checks the in-memory cache for a volumeID
	// a cache hit means that the volume is a migrated in-tree volume
	GetVolumePathFromMigrationServiceCache(ctx context.Context, volumeID string) (string, error)

	// DeleteVolumeInfo helps delete mapping of volumePath to VolumeID for
	// specified volumeID.
	DeleteVolumeInfo(ctx context.Context, volumeID string) error

	// ProtectVolumeFromVMDeletion sets keepAfterDeleteVm control flag on the migrated volume
	// Returns an error if not able to set keepAfterDeleteVm control flag on the volume
	ProtectVolumeFromVMDeletion(ctx context.Context, volumeID string) error
}

VolumeMigrationService exposes interfaces to support VCP to CSI migration. It will maintain internal state to map volume path to volume ID and reverse mapping.

func GetVolumeMigrationService

func GetVolumeMigrationService(ctx context.Context, volumeManager *cnsvolume.Manager,
	cnsConfig *cnsconfig.Config, runCleanupRoutine bool) (VolumeMigrationService, error)

GetVolumeMigrationService returns the singleton VolumeMigrationService. Starts a cleanup routine to delete stale CRD instances if needed.

type VolumeSpec

type VolumeSpec struct {
	VolumePath        string
	StoragePolicyName string
}

VolumeSpec contains VolumePath and StoragePolicyID, using which Volume can be looked up via VolumeMigrationService.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL