importer

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: Apache-2.0 Imports: 51 Imported by: 6

Documentation

Index

Constants

View Source
const MaxBlockStatusLength = (2 << 30)

MaxBlockStatusLength limits the maximum block status request size to 2GB

View Source
const MaxPreadLength = (23 << 20)

MaxPreadLength limits individual data block transfers to 23MB, larger block sizes fail

Variables

View Source
var ErrInvalidPath = fmt.Errorf("invalid transfer path")

ErrInvalidPath indicates that the path is invalid.

View Source
var ErrRequiresScratchSpace = fmt.Errorf("scratch space required and none found")

ErrRequiresScratchSpace indicates that we require scratch space.

Functions

func CleanDir added in v1.7.0

func CleanDir(dest string) error

CleanDir cleans the contents of a directory including its sub directories, but does NOT remove the directory itself.

func CopyRange added in v1.28.0

func CopyRange(handle NbdOperations, sink VDDKDataSink, block *BlockStatusData, updateProgress func(int)) error

CopyRange takes one data block, checks if it is a hole or filled with zeroes, and copies it to the sink

func CopyRegistryImage added in v1.23.6

func CopyRegistryImage(url, destDir, pathPrefix, accessKey, secKey, certDir string, insecureRegistry bool) error

CopyRegistryImage download image from registry with docker image API. It will extract first file under the pathPrefix url: source registry url. destDir: the scratch space destination. pathPrefix: path to extract files from. accessKey: accessKey for the registry described in url. secKey: secretKey for the registry described in url. certDir: directory public CA keys are stored for registry identity verification insecureRegistry: boolean if true will allow insecure registries.

func CopyRegistryImageAll added in v1.23.6

func CopyRegistryImageAll(url, destDir, pathPrefix, accessKey, secKey, certDir string, insecureRegistry bool) error

CopyRegistryImageAll download image from registry with docker image API. It will extract all files under the pathPrefix url: source registry url. destDir: the scratch space destination. pathPrefix: path to extract files from. accessKey: accessKey for the registry described in url. secKey: secretKey for the registry described in url. certDir: directory public CA keys are stored for registry identity verification insecureRegistry: boolean if true will allow insecure registries.

func FindVM added in v1.28.0

func FindVM(context context.Context, conn *govmomi.Client, uuid string) (string, *object.VirtualMachine, error)

FindVM takes the UUID of the VM to migrate and finds its MOref

func ParseEndpoint

func ParseEndpoint(endpt string) (*url.URL, error)

ParseEndpoint parses the required endpoint and return the url struct.

func ResizeImage added in v1.4.0

func ResizeImage(dataFile, imageSize string, totalTargetSpace int64) (bool, error)

ResizeImage resizes the images to match the requested size. Sometimes provisioners misbehave and the available space is not the same as the requested space. For those situations we compare the available space to the requested space and use the smallest of the two values.

Types

type AsyncUploadDataSource added in v1.13.0

type AsyncUploadDataSource struct {

	// Next Phase indicates what the next Processing Phase should be after the transfer completes.
	ResumePhase ProcessingPhase
	// contains filtered or unexported fields
}

AsyncUploadDataSource is an asynchronouse version of an upload data source, that returns finished phase instead of going to post upload processing phases.

func NewAsyncUploadDataSource added in v1.13.0

func NewAsyncUploadDataSource(stream io.ReadCloser) *AsyncUploadDataSource

NewAsyncUploadDataSource creates a new instance of an UploadDataSource

func (*AsyncUploadDataSource) Close added in v1.13.0

func (aud *AsyncUploadDataSource) Close() error

Close closes any readers or other open resources.

func (*AsyncUploadDataSource) GetResumePhase added in v1.13.0

func (aud *AsyncUploadDataSource) GetResumePhase() ProcessingPhase

GetResumePhase returns the next phase to process when resuming

func (*AsyncUploadDataSource) GetURL added in v1.13.0

func (aud *AsyncUploadDataSource) GetURL() *url.URL

GetURL returns the url that the data processor can use when converting the data.

func (*AsyncUploadDataSource) Info added in v1.13.0

Info is called to get initial information about the data.

func (*AsyncUploadDataSource) Transfer added in v1.13.0

func (aud *AsyncUploadDataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source to the passed in path.

func (*AsyncUploadDataSource) TransferFile added in v1.13.0

func (aud *AsyncUploadDataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the passed in file.

type BlockStatusData added in v1.28.0

type BlockStatusData struct {
	Offset uint64
	Length uint32
	Flags  uint32
}

BlockStatusData holds zero/hole status for one block of data

func GetBlockStatus added in v1.28.0

func GetBlockStatus(handle NbdOperations, extent types.DiskChangeExtent) []*BlockStatusData

GetBlockStatus runs libnbd.BlockStatus on a given disk range. Translated from IMS v2v-conversion-host.

type ConnectionInterface added in v1.15.0

type ConnectionInterface interface {
	SystemService() SystemServiceInteface
	Close() error
}

ConnectionInterface defines connection methods

type ConnectionWrapper added in v1.15.0

type ConnectionWrapper struct {
	// contains filtered or unexported fields
}

ConnectionWrapper wraps ovirt connection

func (*ConnectionWrapper) Close added in v1.15.0

func (wrapper *ConnectionWrapper) Close() error

Close closes the connection to ovirt

func (*ConnectionWrapper) SystemService added in v1.15.0

func (wrapper *ConnectionWrapper) SystemService() SystemServiceInteface

SystemService returns system service

type DataProcessor added in v1.8.0

type DataProcessor struct {
	// contains filtered or unexported fields
}

DataProcessor holds the fields needed to process data from a data provider.

func NewDataProcessor added in v1.8.0

func NewDataProcessor(dataSource DataSourceInterface, dataFile, dataDir, scratchDataDir, requestImageSize string, filesystemOverhead float64, preallocation bool) *DataProcessor

NewDataProcessor create a new instance of a data processor using the passed in data provider.

func (*DataProcessor) ProcessData added in v1.8.0

func (dp *DataProcessor) ProcessData() error

ProcessData is the main synchronous processing loop

func (*DataProcessor) ProcessDataResume added in v1.13.0

func (dp *DataProcessor) ProcessDataResume() error

ProcessDataResume Resume a paused processor, assumes the provided data source is ResumableDataSource

func (*DataProcessor) ProcessDataWithPause added in v1.13.0

func (dp *DataProcessor) ProcessDataWithPause() error

ProcessDataWithPause is the main processing loop.

type DataSourceInterface added in v1.8.0

type DataSourceInterface interface {
	// Info is called to get initial information about the data.
	Info() (ProcessingPhase, error)
	// Transfer is called to transfer the data from the source to the path passed in.
	Transfer(path string) (ProcessingPhase, error)
	// TransferFile is called to transfer the data from the source to the file passed in.
	TransferFile(fileName string) (ProcessingPhase, error)
	// Geturl returns the url that the data processor can use when converting the data.
	GetURL() *url.URL
	// Close closes any readers or other open resources.
	Close() error
}

DataSourceInterface is the interface all data sources should implement.

type DiskService added in v1.15.0

type DiskService struct {
	// contains filtered or unexported fields
}

DiskService wraps ovirt disk service

func (*DiskService) Get added in v1.15.0

func (service *DiskService) Get() DiskServiceGetInterface

Get returns get service

type DiskServiceGet added in v1.15.0

type DiskServiceGet struct {
	// contains filtered or unexported fields
}

DiskServiceGet wraps ovirt disk get service

func (*DiskServiceGet) Send added in v1.15.0

Send returns disk get response

type DiskServiceGetInterface added in v1.15.0

type DiskServiceGetInterface interface {
	Send() (DiskServiceResponseInterface, error)
}

DiskServiceGetInterface defines service methods

type DiskServiceGetResponseInterface added in v1.15.0

type DiskServiceGetResponseInterface interface {
	Disk() (*ovirtsdk4.Disk, bool)
}

DiskServiceGetResponseInterface defines service methods

type DiskServiceInterface added in v1.15.0

type DiskServiceInterface interface {
	Get() DiskServiceGetInterface
}

DiskServiceInterface defines service methods

type DiskServiceResponse added in v1.15.0

type DiskServiceResponse struct {
	// contains filtered or unexported fields
}

DiskServiceResponse wraps ovirt response get service

func (*DiskServiceResponse) Disk added in v1.15.0

func (service *DiskServiceResponse) Disk() (*ovirtsdk4.Disk, bool)

Disk returns disk struct

type DiskServiceResponseInterface added in v1.15.0

type DiskServiceResponseInterface interface {
	Disk() (*ovirtsdk4.Disk, bool)
}

DiskServiceResponseInterface defines service methods

type DisksService added in v1.15.0

type DisksService struct {
	// contains filtered or unexported fields
}

DisksService wraps ovirt disks service

func (*DisksService) DiskService added in v1.15.0

func (service *DisksService) DiskService(id string) DiskServiceInterface

DiskService returns disk service

type DisksServiceInterface added in v1.15.0

type DisksServiceInterface interface {
	DiskService(string) DiskServiceInterface
}

DisksServiceInterface defines service methods

type FormatReaders added in v1.8.0

type FormatReaders struct {
	Convert  bool
	Archived bool
	// contains filtered or unexported fields
}

FormatReaders contains the stack of readers needed to get information from the input stream (io.ReadCloser)

func NewFormatReaders added in v1.8.0

func NewFormatReaders(stream io.ReadCloser, total uint64) (*FormatReaders, error)

NewFormatReaders creates a new instance of FormatReaders using the input stream and content type passed in.

func (*FormatReaders) Close added in v1.8.0

func (fr *FormatReaders) Close() (rtnerr error)

Close Readers in reverse order.

func (*FormatReaders) StartProgressUpdate added in v1.10.0

func (fr *FormatReaders) StartProgressUpdate()

StartProgressUpdate starts the go routine to automatically update the progress on a set interval.

func (*FormatReaders) TopReader added in v1.8.0

func (fr *FormatReaders) TopReader() io.ReadCloser

TopReader return the top-level io.ReadCloser from the receiver Reader "stack".

type HTTPDataSource added in v1.8.0

type HTTPDataSource struct {
	// contains filtered or unexported fields
}

HTTPDataSource is the data provider for http(s) endpoints. Sequence of phases: 1a. Info -> Convert (In Info phase the format readers are configured), if the source Reader image is not archived, and no custom CA is used, and can be converted by QEMU-IMG (RAW/QCOW2) 1b. Info -> TransferArchive if the content type is archive 1c. Info -> Transfer in all other cases. 2a. Transfer -> Process if content type is kube virt 2b. Transfer -> Complete if content type is archive (Transfer is called with the target instead of the scratch space). Non block PVCs only. 3. Process -> Convert

func NewHTTPDataSource added in v1.8.0

func NewHTTPDataSource(endpoint, accessKey, secKey, certDir string, contentType cdiv1.DataVolumeContentType) (*HTTPDataSource, error)

NewHTTPDataSource creates a new instance of the http data provider.

func (*HTTPDataSource) Close added in v1.8.0

func (hs *HTTPDataSource) Close() error

Close all readers.

func (*HTTPDataSource) GetURL added in v1.8.0

func (hs *HTTPDataSource) GetURL() *url.URL

GetURL returns the URI that the data processor can use when converting the data.

func (*HTTPDataSource) Info added in v1.8.0

func (hs *HTTPDataSource) Info() (ProcessingPhase, error)

Info is called to get initial information about the data.

func (*HTTPDataSource) Transfer added in v1.8.0

func (hs *HTTPDataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source to a scratch location.

func (*HTTPDataSource) TransferFile added in v1.8.0

func (hs *HTTPDataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the passed in file.

type ImageTransferService added in v1.19.0

type ImageTransferService struct {
	// contains filtered or unexported fields
}

ImageTransferService wraps ovirt transfer service

func (*ImageTransferService) Finalize added in v1.19.0

Finalize returns image service

type ImageTransferServiceAddInterface added in v1.15.0

type ImageTransferServiceAddInterface interface {
	ImageTransfer(imageTransfer *ovirtsdk4.ImageTransfer) *ovirtsdk4.ImageTransfersServiceAddRequest
	Send() (ImageTransfersServiceAddResponseInterface, error)
}

ImageTransferServiceAddInterface defines service methods

type ImageTransferServiceFinalizeRequest added in v1.19.0

type ImageTransferServiceFinalizeRequest struct {
	// contains filtered or unexported fields
}

ImageTransferServiceFinalizeRequest warps finalize request

func (*ImageTransferServiceFinalizeRequest) Send added in v1.19.0

Send returns disk get response

type ImageTransferServiceFinalizeRequestInterface added in v1.19.0

type ImageTransferServiceFinalizeRequestInterface interface {
	Send() (ImageTransferServiceFinalizeResponseInterface, error)
}

ImageTransferServiceFinalizeRequestInterface defines service methods

type ImageTransferServiceFinalizeResponse added in v1.19.0

type ImageTransferServiceFinalizeResponse struct {
	// contains filtered or unexported fields
}

ImageTransferServiceFinalizeResponse warps finalize response

type ImageTransferServiceFinalizeResponseInterface added in v1.19.0

type ImageTransferServiceFinalizeResponseInterface interface {
}

ImageTransferServiceFinalizeResponseInterface defines service methods

type ImageTransferServiceInterface added in v1.19.0

type ImageTransferServiceInterface interface {
	Finalize() ImageTransferServiceFinalizeRequestInterface
}

ImageTransferServiceInterface defines service methods

type ImageTransfersService added in v1.15.0

type ImageTransfersService struct {
	// contains filtered or unexported fields
}

ImageTransfersService wraps ovirt transfer service

func (*ImageTransfersService) Add added in v1.15.0

Add returns image transfer add request

func (*ImageTransfersService) ImageTransferService added in v1.19.0

func (service *ImageTransfersService) ImageTransferService(id string) ImageTransferServiceInterface

ImageTransferService returns image service

type ImageTransfersServiceAdd added in v1.15.0

type ImageTransfersServiceAdd struct {
	// contains filtered or unexported fields
}

ImageTransfersServiceAdd wraps ovirt add transfer service

func (*ImageTransfersServiceAdd) Send added in v1.15.0

Send return image transfer add response

type ImageTransfersServiceAddResponse added in v1.15.0

type ImageTransfersServiceAddResponse struct {
	// contains filtered or unexported fields
}

ImageTransfersServiceAddResponse wraps ovirt add transfer service

func (*ImageTransfersServiceAddResponse) ImageTransfer added in v1.15.0

func (service *ImageTransfersServiceAddResponse) ImageTransfer() (*ovirtsdk4.ImageTransfer, bool)

ImageTransfer returns disk struct

type ImageTransfersServiceAddResponseInterface added in v1.15.0

type ImageTransfersServiceAddResponseInterface interface {
	ImageTransfer() (*ovirtsdk4.ImageTransfer, bool)
}

ImageTransfersServiceAddResponseInterface defines service methods

type ImageTransfersServiceInterface added in v1.15.0

type ImageTransfersServiceInterface interface {
	Add() ImageTransferServiceAddInterface
	ImageTransferService(string) ImageTransferServiceInterface
}

ImageTransfersServiceInterface defines service methods

type ImageTransfersServiceResponse added in v1.15.0

type ImageTransfersServiceResponse struct {
	// contains filtered or unexported fields
}

ImageTransfersServiceResponse wraps ovirt add transfer service

func (*ImageTransfersServiceResponse) ImageTransfer added in v1.15.0

ImageTransfer sets image transfer and returns add request

func (*ImageTransfersServiceResponse) Send added in v1.15.0

Send returns disk get response

type ImageioDataSource added in v1.15.0

type ImageioDataSource struct {
	// contains filtered or unexported fields
}

ImageioDataSource is the data provider for ovirt-imageio.

func NewImageioDataSource added in v1.15.0

func NewImageioDataSource(endpoint string, accessKey string, secKey string, certDir string, diskID string) (*ImageioDataSource, error)

NewImageioDataSource creates a new instance of the ovirt-imageio data provider.

func (*ImageioDataSource) Close added in v1.15.0

func (is *ImageioDataSource) Close() error

Close all readers.

func (*ImageioDataSource) GetURL added in v1.15.0

func (is *ImageioDataSource) GetURL() *url.URL

GetURL returns the URI that the data processor can use when converting the data.

func (*ImageioDataSource) Info added in v1.15.0

func (is *ImageioDataSource) Info() (ProcessingPhase, error)

Info is called to get initial information about the data.

func (*ImageioDataSource) Transfer added in v1.15.0

func (is *ImageioDataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source to a scratch location.

func (*ImageioDataSource) TransferFile added in v1.15.0

func (is *ImageioDataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the passed in file.

type NbdKitWrapper added in v1.28.0

type NbdKitWrapper struct {
	Command *exec.Cmd
	Socket  *url.URL
	Handle  NbdOperations
}

NbdKitWrapper keeps track of one nbdkit process

type NbdOperations added in v1.26.0

type NbdOperations interface {
	GetSize() (uint64, error)
	Pread([]byte, uint64, *libnbd.PreadOptargs) error
	Close() *libnbd.LibnbdError
	BlockStatus(uint64, uint64, libnbd.ExtentCallback, *libnbd.BlockStatusOptargs) error
}

NbdOperations provides a mockable interface for the things needed from libnbd.

type ProcessingPhase added in v1.8.0

type ProcessingPhase string

ProcessingPhase is the current phase being processed.

const (
	// ProcessingPhaseInfo is the first phase, during this phase the source obtains information needed to determine which phase to go to next.
	ProcessingPhaseInfo ProcessingPhase = "Info"
	// ProcessingPhaseTransferScratch is the phase in which the data source writes data to the scratch space.
	ProcessingPhaseTransferScratch ProcessingPhase = "TransferScratch"
	// ProcessingPhaseTransferDataDir is the phase in which the data source writes data directly to the target path without conversion.
	ProcessingPhaseTransferDataDir ProcessingPhase = "TransferDataDir"
	// ProcessingPhaseTransferDataFile is the phase in which the data source writes data directly to the target file without conversion.
	ProcessingPhaseTransferDataFile ProcessingPhase = "TransferDataFile"
	// ProcessingPhaseValidatePause is the phase in which the data processor should validate and then pause.
	ProcessingPhaseValidatePause ProcessingPhase = "ValidatePause"
	// ProcessingPhaseConvert is the phase in which the data is taken from the url provided by the source, and it is converted to the target RAW disk image format.
	// The url can be an http end point or file system end point.
	ProcessingPhaseConvert ProcessingPhase = "Convert"
	// ProcessingPhaseResize the disk image, this is only needed when the target contains a file system (block device do not need a resize)
	ProcessingPhaseResize ProcessingPhase = "Resize"
	// ProcessingPhasePreallocate is the step to preallocate the file after resize
	ProcessingPhasePreallocate ProcessingPhase = "Preallocate"
	// ProcessingPhaseComplete is the phase where the entire process completed successfully and we can exit gracefully.
	ProcessingPhaseComplete ProcessingPhase = "Complete"
	// ProcessingPhasePause is the phase where we pause processing and end the loop, and expect something to call the process loop again.
	ProcessingPhasePause ProcessingPhase = "Pause"
	// ProcessingPhaseError is the phase in which we encountered an error and need to exit ungracefully.
	ProcessingPhaseError ProcessingPhase = "Error"
)

type RegistryDataSource added in v1.8.0

type RegistryDataSource struct {
	// contains filtered or unexported fields
}

RegistryDataSource is the struct containing the information needed to import from a registry data source. Sequence of phases: 1. Info -> Transfer 2. Transfer -> Convert

func NewRegistryDataSource added in v1.8.0

func NewRegistryDataSource(endpoint, accessKey, secKey, certDir string, insecureTLS bool) *RegistryDataSource

NewRegistryDataSource creates a new instance of the Registry Data Source.

func (*RegistryDataSource) Close added in v1.8.0

func (rd *RegistryDataSource) Close() error

Close closes any readers or other open resources.

func (*RegistryDataSource) GetURL added in v1.8.0

func (rd *RegistryDataSource) GetURL() *url.URL

GetURL returns the url that the data processor can use when converting the data.

func (*RegistryDataSource) Info added in v1.8.0

Info is called to get initial information about the data. No information available for registry currently.

func (*RegistryDataSource) Transfer added in v1.8.0

func (rd *RegistryDataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source registry to a temporary location.

func (*RegistryDataSource) TransferFile added in v1.8.0

func (rd *RegistryDataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the passed in file.

type ResumableDataSource added in v1.13.0

type ResumableDataSource interface {
	DataSourceInterface
	GetResumePhase() ProcessingPhase
}

ResumableDataSource is the interface all resumeable data sources should implement

type S3Client added in v1.8.0

type S3Client interface {
	GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
}

S3Client is the interface to the used S3 client.

type S3DataSource added in v1.8.0

type S3DataSource struct {
	// contains filtered or unexported fields
}

S3DataSource is the struct containing the information needed to import from an S3 data source. Sequence of phases: 1. Info -> Transfer 2. Transfer -> Process 3. Process -> Convert

func NewS3DataSource added in v1.8.0

func NewS3DataSource(endpoint, accessKey, secKey string) (*S3DataSource, error)

NewS3DataSource creates a new instance of the S3DataSource

func (*S3DataSource) Close added in v1.8.0

func (sd *S3DataSource) Close() error

Close closes any readers or other open resources.

func (*S3DataSource) GetURL added in v1.8.0

func (sd *S3DataSource) GetURL() *url.URL

GetURL returns the url that the data processor can use when converting the data.

func (*S3DataSource) Info added in v1.8.0

func (sd *S3DataSource) Info() (ProcessingPhase, error)

Info is called to get initial information about the data.

func (*S3DataSource) Transfer added in v1.8.0

func (sd *S3DataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source to a temporary location.

func (*S3DataSource) TransferFile added in v1.8.0

func (sd *S3DataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the passed in file.

type SystemService added in v1.15.0

type SystemService struct {
	// contains filtered or unexported fields
}

SystemService wraps ovirt system service

func (*SystemService) DisksService added in v1.15.0

func (service *SystemService) DisksService() DisksServiceInterface

DisksService returns disks service

func (*SystemService) ImageTransfersService added in v1.15.0

func (service *SystemService) ImageTransfersService() ImageTransfersServiceInterface

ImageTransfersService returns image service

type SystemServiceInteface added in v1.15.0

type SystemServiceInteface interface {
	DisksService() DisksServiceInterface
	ImageTransfersService() ImageTransfersServiceInterface
}

SystemServiceInteface defines service methods

type UploadDataSource added in v1.8.0

type UploadDataSource struct {
	// contains filtered or unexported fields
}

UploadDataSource contains all the information need to upload data into a data volume. Sequence of phases: 1a. ProcessingPhaseInfo -> ProcessingPhaseTransferScratch (In Info phase the format readers are configured) In case the readers don't contain a raw file. 1b. ProcessingPhaseInfo -> ProcessingPhaseTransferDataFile, in the case the readers contain a raw file. 2a. ProcessingPhaseTransferScratch -> ProcessingPhaseConvert 2b. ProcessingPhaseTransferDataFile -> ProcessingPhaseResize

func NewUploadDataSource added in v1.8.0

func NewUploadDataSource(stream io.ReadCloser) *UploadDataSource

NewUploadDataSource creates a new instance of an UploadDataSource

func (*UploadDataSource) Close added in v1.8.0

func (ud *UploadDataSource) Close() error

Close closes any readers or other open resources.

func (*UploadDataSource) GetURL added in v1.8.0

func (ud *UploadDataSource) GetURL() *url.URL

GetURL returns the url that the data processor can use when converting the data.

func (*UploadDataSource) Info added in v1.8.0

func (ud *UploadDataSource) Info() (ProcessingPhase, error)

Info is called to get initial information about the data.

func (*UploadDataSource) Transfer added in v1.8.0

func (ud *UploadDataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source to the passed in path.

func (*UploadDataSource) TransferFile added in v1.8.0

func (ud *UploadDataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the passed in file.

type VDDKDataSink added in v1.26.0

type VDDKDataSink interface {
	Pwrite(buf []byte, offset uint64) (int, error)
	Write(buf []byte) (int, error)
	ZeroRange(offset uint64, length uint32) error
	Close()
}

VDDKDataSink provides a mockable interface for saving data from the source.

type VDDKDataSource added in v1.23.0

type VDDKDataSource struct {
	NbdKit           *NbdKitWrapper
	ChangedBlocks    *types.DiskChangeInfo
	CurrentSnapshot  string
	PreviousSnapshot string
	Size             uint64
	VolumeMode       v1.PersistentVolumeMode
}

VDDKDataSource is the data provider for vddk.

func NewVDDKDataSource added in v1.23.0

func NewVDDKDataSource(endpoint string, accessKey string, secKey string, thumbprint string, uuid string, backingFile string, currentCheckpoint string, previousCheckpoint string, finalCheckpoint string, volumeMode v1.PersistentVolumeMode) (*VDDKDataSource, error)

NewVDDKDataSource creates a new instance of the vddk data provider.

func (*VDDKDataSource) Close added in v1.23.0

func (vs *VDDKDataSource) Close() error

Close closes any readers or other open resources.

func (*VDDKDataSource) GetURL added in v1.23.0

func (vs *VDDKDataSource) GetURL() *url.URL

GetURL returns the url that the data processor can use when converting the data.

func (*VDDKDataSource) Info added in v1.23.0

func (vs *VDDKDataSource) Info() (ProcessingPhase, error)

Info is called to get initial information about the data.

func (*VDDKDataSource) IsDeltaCopy added in v1.28.0

func (vs *VDDKDataSource) IsDeltaCopy() bool

IsDeltaCopy is called to determine if this is a full copy or one delta copy stage in a warm migration.

func (*VDDKDataSource) Transfer added in v1.23.0

func (vs *VDDKDataSource) Transfer(path string) (ProcessingPhase, error)

Transfer is called to transfer the data from the source to the path passed in.

func (*VDDKDataSource) TransferFile added in v1.23.0

func (vs *VDDKDataSource) TransferFile(fileName string) (ProcessingPhase, error)

TransferFile is called to transfer the data from the source to the file passed in.

type VDDKFileSink added in v1.26.0

type VDDKFileSink struct {
	// contains filtered or unexported fields
}

VDDKFileSink writes the source disk data to a local file.

func (*VDDKFileSink) Close added in v1.26.0

func (sink *VDDKFileSink) Close()

Close closes the file after a transfer is complete.

func (*VDDKFileSink) Pwrite added in v1.28.0

func (sink *VDDKFileSink) Pwrite(buffer []byte, offset uint64) (int, error)

Pwrite writes the given byte buffer to the sink at the given offset

func (*VDDKFileSink) Write added in v1.26.0

func (sink *VDDKFileSink) Write(buf []byte) (int, error)

Write appends the given buffer to the sink

func (*VDDKFileSink) ZeroRange added in v1.28.1

func (sink *VDDKFileSink) ZeroRange(offset uint64, length uint32) error

ZeroRange fills the destination range with zero bytes

type VMwareClient added in v1.28.0

type VMwareClient struct {
	// contains filtered or unexported fields
}

VMwareClient holds a connection to the VMware API with pre-filled information about one VM

func (*VMwareClient) Close added in v1.28.0

func (vmware *VMwareClient) Close()

Close disconnects from VMware

func (*VMwareClient) FindDiskFromName added in v1.28.0

func (vmware *VMwareClient) FindDiskFromName(fileName string) (*types.VirtualDisk, error)

FindDiskFromName finds a disk object with the given file name, usable by QueryChangedDiskAreas. Looks at the current VM disk as well as any snapshots.

func (*VMwareClient) FindDiskInSnapshot added in v1.28.0

func (vmware *VMwareClient) FindDiskInSnapshot(snapshotRef types.ManagedObjectReference, fileName string) *types.VirtualDisk

FindDiskInSnapshot looks through a snapshot's device list for the given backing file name

func (*VMwareClient) FindDiskInSnapshotTree added in v1.28.0

func (vmware *VMwareClient) FindDiskInSnapshotTree(snapshots []types.VirtualMachineSnapshotTree, fileName string) *types.VirtualDisk

FindDiskInSnapshotTree looks through a VM's snapshot tree for a disk with the given file name

func (*VMwareClient) FindSnapshotDiskName added in v1.28.0

func (vmware *VMwareClient) FindSnapshotDiskName(snapshotRef *types.ManagedObjectReference, diskID string) (string, error)

FindSnapshotDiskName finds the name of the given disk at the time the snapshot was taken

type VMwareConnectionOperations added in v1.28.0

type VMwareConnectionOperations interface {
	Logout(context.Context) error
}

VMwareConnectionOperations provides a mockable interface for the things needed from VMware client objects.

type VMwareVMOperations added in v1.28.0

VMwareVMOperations provides a mockable interface for the things needed from VMware VM objects.

type ValidationSizeError added in v1.21.0

type ValidationSizeError struct {
	// contains filtered or unexported fields
}

ValidationSizeError is an error indication size validation failure.

func (ValidationSizeError) Error added in v1.21.0

func (e ValidationSizeError) Error() string

Jump to

Keyboard shortcuts

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