importer

package
v1.59.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 63 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 MaxPreadLengthESX = (23 << 20)

MaxPreadLengthESX limits individual VDDK data block transfers to 23MB. Larger block sizes fail immediately.

View Source
const MaxPreadLengthVC = (2 << 20)

MaxPreadLengthVC limits indidivual VDDK data block transfers to 2MB only when connecting to vCenter. With vCenter endpoints, multiple simultaneous importer pods with larger read sizes cause allocation failures on the server, and the imports start to fail:

"NfcFssrvrProcessErrorMsg: received NFC error 5 from server:
 Failed to allocate the requested 24117272 bytes"

Variables

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

ErrInvalidPath indicates that the path is invalid.

View Source
var ErrRequiresScratchSpace = fmt.Errorf(common.ScratchSpaceRequired)

ErrRequiresScratchSpace indicates that we require scratch space.

View Source
var MaxPreadLength uint32 = MaxPreadLengthESX

MaxPreadLength is the maxmimum read size to request from VMware. Default to the larger option, and reduce it in createVddkDataSource when connecting to vCenter endpoints.

View Source
var QueryChangedDiskAreas = methods.QueryChangedDiskAreas

QueryChangedDiskAreas mocks the underlying QueryChangedDiskAreas for unit test, distinct from the one in VMwareVMOperations

Functions

func CleanAll added in v1.54.2

func CleanAll(paths ...string) error

CleanAll deletes all files at specified paths (recursively)

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) (*types.ImageInspectInfo, 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) (*types.ImageInspectInfo, 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 CreateCertificateDir added in v1.55.1

func CreateCertificateDir(registryCertDir string) (string, error)

CreateCertificateDir creates a common certificate dir

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 GetImageDigest added in v1.42.0

func GetImageDigest(url, accessKey, secKey, certDir string, insecureRegistry bool) (string, error)

GetImageDigest returns the digest of the container image at url. url: source registry url. 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 GetTerminationChannel added in v1.31.0

func GetTerminationChannel() <-chan os.Signal

GetTerminationChannel returns a channel that listens for SIGTERM

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, preallocation 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) GetTerminationMessage added in v1.59.0

func (aud *AsyncUploadDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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) PreallocationApplied added in v1.28.2

func (dp *DataProcessor) PreallocationApplied() bool

PreallocationApplied returns true if data processing path included preallocation step

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.

func (*DataProcessor) RegisterPhaseExecutor added in v1.44.0

func (dp *DataProcessor) RegisterPhaseExecutor(pp ProcessingPhase, executor func() (ProcessingPhase, error))

RegisterPhaseExecutor registers an execution function for the given phase. If there is already an function registered, override it with the new function.

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
	// GetTerminationMessage returns data to be serialized and used as the termination message of the importer.
	GetTerminationMessage() *common.TerminationMessage
	// 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 DiskSnapshotSlice added in v1.39.0

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

DiskSnapshotSlice wraps oVirt's DiskSnapshotSlice

func (*DiskSnapshotSlice) Slice added in v1.39.0

func (service *DiskSnapshotSlice) Slice() []*ovirtsdk4.DiskSnapshot

Slice returns a list of disk snapshots

type DiskSnapshotSliceInterface added in v1.39.0

type DiskSnapshotSliceInterface interface {
	Slice() []*ovirtsdk4.DiskSnapshot
}

DiskSnapshotSliceInterface defines disk snapshot slice methods

type DiskSnapshotsService added in v1.39.0

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

DiskSnapshotsService wraps oVirt's DiskSnapshotsService

func (*DiskSnapshotsService) List added in v1.39.0

List returns a request object to get disk snapshots

type DiskSnapshotsServiceInterface added in v1.39.0

type DiskSnapshotsServiceInterface interface {
	List() DiskSnapshotsServiceListRequestInterface
}

DiskSnapshotsServiceInterface defines disk snapshot service methods

type DiskSnapshotsServiceListRequest added in v1.39.0

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

DiskSnapshotsServiceListRequest wraps oVirt's DiskSnapshotsServiceListRequest

func (*DiskSnapshotsServiceListRequest) Send added in v1.39.0

Send returns a reponse from listing disk snapshots

type DiskSnapshotsServiceListRequestInterface added in v1.39.0

type DiskSnapshotsServiceListRequestInterface interface {
	Send() (DiskSnapshotsServiceListResponseInterface, error)
}

DiskSnapshotsServiceListRequestInterface defines disk snapshot service list methods

type DiskSnapshotsServiceListResponse added in v1.39.0

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

DiskSnapshotsServiceListResponse wraps oVirt's DiskSnapshotsServiceListResponse

func (*DiskSnapshotsServiceListResponse) Snapshots added in v1.39.0

Snapshots returns a DiskSnapshotSlice containing some disk snapshots

type DiskSnapshotsServiceListResponseInterface added in v1.39.0

type DiskSnapshotsServiceListResponseInterface interface {
	Snapshots() (DiskSnapshotSliceInterface, bool)
}

DiskSnapshotsServiceListResponseInterface defines disk snapshot service list response 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
	ArchiveXz   bool
	ArchiveGz   bool
	ArchiveZstd 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 GCSDataSource added in v1.57.0

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

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

func NewGCSDataSource added in v1.57.0

func NewGCSDataSource(endpoint, keyFile string) (*GCSDataSource, error)

NewGCSDataSource creates a new instance of the GCSDataSource

func (*GCSDataSource) Close added in v1.57.0

func (sd *GCSDataSource) Close() error

Close closes any readers or other open resources.

func (*GCSDataSource) GetTerminationMessage added in v1.59.0

func (sd *GCSDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

func (*GCSDataSource) GetURL added in v1.57.0

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

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

func (*GCSDataSource) Info added in v1.57.0

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

Info is called to get initial information about the data.

func (*GCSDataSource) Transfer added in v1.57.0

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

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

func (*GCSDataSource) TransferFile added in v1.57.0

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

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

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 -> Convert 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.

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) GetTerminationMessage added in v1.59.0

func (hs *HTTPDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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) Cancel added in v1.31.0

Cancel returns image service

func (*ImageTransferService) Extend added in v1.43.0

Extend returns image service

func (*ImageTransferService) Finalize added in v1.19.0

Finalize returns image service

func (*ImageTransferService) Get added in v1.39.0

Get returns image transfer object

type ImageTransferServiceAddInterface added in v1.15.0

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

ImageTransferServiceAddInterface defines service methods

type ImageTransferServiceCancelRequest added in v1.31.0

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

ImageTransferServiceCancelRequest wraps cancel request

func (*ImageTransferServiceCancelRequest) Send added in v1.31.0

Send returns transfer cancel response

type ImageTransferServiceCancelRequestInterface added in v1.31.0

type ImageTransferServiceCancelRequestInterface interface {
	Send() (ImageTransferServiceCancelResponseInterface, error)
}

ImageTransferServiceCancelRequestInterface defines service methods

type ImageTransferServiceCancelResponse added in v1.31.0

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

ImageTransferServiceCancelResponse wraps cancel response

type ImageTransferServiceCancelResponseInterface added in v1.31.0

type ImageTransferServiceCancelResponseInterface interface {
}

ImageTransferServiceCancelResponseInterface defines service methods

type ImageTransferServiceExtendRequest added in v1.43.0

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

ImageTransferServiceExtendRequest wraps cancel request

func (*ImageTransferServiceExtendRequest) Send added in v1.43.0

Send returns transfer extend response

type ImageTransferServiceExtendRequestInterface added in v1.43.0

type ImageTransferServiceExtendRequestInterface interface {
	Send() (ImageTransferServiceExtendResponseInterface, error)
}

ImageTransferServiceExtendRequestInterface defines service methods

type ImageTransferServiceExtendResponse added in v1.43.0

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

ImageTransferServiceExtendResponse wraps cancel response

type ImageTransferServiceExtendResponseInterface added in v1.43.0

type ImageTransferServiceExtendResponseInterface interface {
}

ImageTransferServiceExtendResponseInterface 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 ImageTransferServiceGetRequest added in v1.39.0

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

ImageTransferServiceGetRequest wraps get request

func (*ImageTransferServiceGetRequest) Send added in v1.39.0

Send returns image transfer get response

type ImageTransferServiceGetRequestInterface added in v1.39.0

type ImageTransferServiceGetRequestInterface interface {
	Send() (ImageTransferServiceGetResponseInterface, error)
}

ImageTransferServiceGetRequestInterface defines service methods

type ImageTransferServiceGetResponse added in v1.39.0

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

ImageTransferServiceGetResponse wraps get response

func (*ImageTransferServiceGetResponse) ImageTransfer added in v1.39.0

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

ImageTransfer returns ImageTransfer struct

type ImageTransferServiceGetResponseInterface added in v1.39.0

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

ImageTransferServiceGetResponseInterface defines service methods

type ImageTransferServiceInterface added in v1.19.0

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, currentCheckpoint string, previousCheckpoint 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) GetTerminationMessage added in v1.59.0

func (is *ImageioDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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) IsDeltaCopy added in v1.39.0

func (is *ImageioDataSource) IsDeltaCopy() bool

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

func (*ImageioDataSource) StreamExtents added in v1.43.0

func (is *ImageioDataSource) StreamExtents(extentsReader *extentReader, fileName string) error

StreamExtents requests individual extents from the ImageIO API and copies them to the destination. It skips downloading ranges of all zero bytes.

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 ImageioImageOptions added in v1.43.0

type ImageioImageOptions struct {
	UnixSocket string   `json:"unix_socket"`
	Features   []string `json:"features"`
	MaxReaders int      `json:"max_readers"`
	MaxWriters int      `json:"max_writers"`
}

ImageioImageOptions is the ImageIO API's response to an OPTIONS request

type NbdKitLogWatcherVddk added in v1.34.3

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

NbdKitLogWatcherVddk implements VDDK-specific nbdkit log handling

func (NbdKitLogWatcherVddk) Start added in v1.34.3

func (watcher NbdKitLogWatcherVddk) Start(output *bufio.Reader)

Start runs the nbdkit log watcher in the background.

func (NbdKitLogWatcherVddk) Stop added in v1.34.3

func (watcher NbdKitLogWatcherVddk) Stop()

Stop waits for the log watcher to stop. Needs something else to stop nbdkit first.

type NbdKitWrapper added in v1.28.0

type NbdKitWrapper struct {
	Socket *url.URL
	Handle NbdOperations
	// contains filtered or unexported fields
}

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"
	// 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 = common.GenericError
	// ProcessingPhaseMergeDelta is the phase in a multi-stage import where a delta image downloaded to scratch is applied to the base image
	ProcessingPhaseMergeDelta ProcessingPhase = "MergeDelta"
)

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) GetTerminationMessage added in v1.59.0

func (rd *RegistryDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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 -> Convert

func NewS3DataSource added in v1.8.0

func NewS3DataSource(endpoint, accessKey, secKey string, certDir 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) GetTerminationMessage added in v1.59.0

func (sd *S3DataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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 StorageDomainService added in v1.39.0

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

StorageDomainService wraps oVirt's storage domain service

func (*StorageDomainService) DiskSnapshotsService added in v1.39.0

func (service *StorageDomainService) DiskSnapshotsService() DiskSnapshotsServiceInterface

DiskSnapshotsService returns a disk snapshots service object

type StorageDomainServiceInterface added in v1.39.0

type StorageDomainServiceInterface interface {
	DiskSnapshotsService() DiskSnapshotsServiceInterface
}

StorageDomainServiceInterface defines storage domain service methods

type StorageDomainsService added in v1.39.0

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

StorageDomainsService wraps oVirt's StorageDomainsService

func (*StorageDomainsService) StorageDomainService added in v1.39.0

func (service *StorageDomainsService) StorageDomainService(id string) StorageDomainServiceInterface

StorageDomainService returns a storage domain service object

type StorageDomainsServiceInterface added in v1.39.0

type StorageDomainsServiceInterface interface {
	StorageDomainService(string) StorageDomainServiceInterface
}

StorageDomainsServiceInterface defines storage domains service methods

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

func (*SystemService) StorageDomainsService added in v1.39.0

func (service *SystemService) StorageDomainsService() StorageDomainsServiceInterface

StorageDomainsService returns a storage domains service object

type SystemServiceInteface added in v1.15.0

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

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, contentType cdiv1.DataVolumeContentType) *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) GetTerminationMessage added in v1.59.0

func (ud *UploadDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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) GetTerminationMessage added in v1.59.0

func (vs *VDDKDataSource) GetTerminationMessage() *common.TerminationMessage

GetTerminationMessage returns data to be serialized and used as the termination message of the importer.

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() error

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) FindDiskInRootSnapshotParent added in v1.55.0

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

FindDiskInRootSnapshotParent checks if the parent of the very first snapshot has the target disk name. There are cases where the first listed disk is a delta, so other search methods can't find the right disk.

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
	IsVC() bool
}

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

type VMwareVMOperations added in v1.28.0

type VMwareVMOperations interface {
	Properties(context.Context, types.ManagedObjectReference, []string, interface{}) error
	Reference() types.ManagedObjectReference
	FindSnapshot(context.Context, string) (*types.ManagedObjectReference, error)
	QueryChangedDiskAreas(context.Context, *types.ManagedObjectReference, *types.ManagedObjectReference, *types.VirtualDisk, int64) (types.DiskChangeInfo, error)
	Client() *vim25.Client
}

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