lcow

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultScratchSizeGB is the size of the default LCOW scratch disk in GB
	DefaultScratchSizeGB = 20
)

Variables

This section is empty.

Functions

func CreateScratch

func CreateScratch(lcowUVM *uvm.UtilityVM, destFile string, sizeGB uint32, cacheFile string, vmID string) error

CreateScratch uses a utility VM to create an empty scratch disk of a requested size. It has a caching capability. If the cacheFile exists, and the request is for a default size, a copy of that is made to the target. If the size is non-default, or the cache file does not exist, it uses a utility VM to create target. It is the responsibility of the caller to synchronise simultaneous attempts to create the cache file.

func TarToVhd

func TarToVhd(lcowUVM *uvm.UtilityVM, targetVHDFile string, reader io.Reader) (int64, error)

TarToVhd streams a tarstream contained in an io.Reader to a fixed vhd file

func VhdToTar

func VhdToTar(lcowUVM *uvm.UtilityVM, vhdFile string, uvmMountPath string, isContainerScratch bool, vhdSize int64) (io.ReadCloser, error)

VhdToTar does what is says - it exports a VHD in a specified folder (either a read-only layer.vhd, or a read-write scratch vhdx) to a ReadCloser containing a tar-stream of the layers contents.

Types

type ByteCounts

type ByteCounts struct {
	In  int64
	Out int64
	Err int64
}

ByteCounts are the number of bytes copied to/from standard handles. Note this is int64 rather than uint64 to match the golang io.Copy() signature.

func CreateProcess

func CreateProcess(opts *ProcessOptions) (*hcs.Process, *ByteCounts, error)

type ProcessOptions

type ProcessOptions struct {
	HCSSystem         *hcs.System
	Process           *specs.Process
	Stdin             io.Reader     // Optional reader for sending on to the processes stdin stream
	Stdout            io.Writer     // Optional writer for returning the processes stdout stream
	Stderr            io.Writer     // Optional writer for returning the processes stderr stream
	CopyTimeout       time.Duration // Timeout for the copy
	CreateInUtilityVm bool          // If the compute system is a utility VM
	ByteCounts        ByteCounts    // How much data to copy on each stream if they are supplied. 0 means to io.EOF.
}

ProcessOptions are the set of options which are passed to CreateProcessEx() to create a utility vm.

type ProcessParameters

type ProcessParameters struct {
	hcsschema.ProcessParameters

	CreateInUtilityVm bool        `json:",omitempty"`
	OCIProcess        interface{} `json:"OciProcess,omitempty"`
}

Additional fields to hcsschema.ProcessParameters used by LCOW

Jump to

Keyboard shortcuts

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