Documentation
¶
Rendered for windows/amd64
Index ¶
- type Disk
- func (d *Disk) AttachToVM(ctx context.Context, vm VMSCSIAdder) error
- func (d *Disk) Config() DiskConfig
- func (d *Disk) DetachFromVM(ctx context.Context, vm VMSCSIRemover, lGuest LinuxGuestSCSIEjector) error
- func (d *Disk) HostPath() string
- func (d *Disk) MountPartitionToGuest(ctx context.Context, partition uint64, linuxGuest mount.LinuxGuestSCSIMounter, ...) (string, error)
- func (d *Disk) ReservePartition(ctx context.Context, config mount.MountConfig) (*mount.Mount, error)
- func (d *Disk) State() DiskState
- func (d *Disk) UnmountPartitionFromGuest(ctx context.Context, partition uint64, ...) error
- type DiskConfig
- type DiskState
- type DiskType
- type LinuxGuestSCSIEjector
- type VMSCSIAdder
- type VMSCSIRemover
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
Disk represents a SCSI disk attached to the VM. It manages the lifecycle of the disk attachment as well as the guest mounts on the disk partitions.
All operations on the disk are expected to be ordered by the caller. No locking is done at this layer.
func NewReserved ¶
func NewReserved(controller, lun uint, config DiskConfig) *Disk
NewReserved creates a new Disk in the reserved state with the provided configuration.
func (*Disk) AttachToVM ¶
func (d *Disk) AttachToVM(ctx context.Context, vm VMSCSIAdder) error
func (*Disk) Config ¶
func (d *Disk) Config() DiskConfig
func (*Disk) DetachFromVM ¶
func (d *Disk) DetachFromVM(ctx context.Context, vm VMSCSIRemover, lGuest LinuxGuestSCSIEjector) error
func (*Disk) MountPartitionToGuest ¶
func (d *Disk) MountPartitionToGuest(ctx context.Context, partition uint64, linuxGuest mount.LinuxGuestSCSIMounter, windowsGuest mount.WindowsGuestSCSIMounter) (string, error)
func (*Disk) ReservePartition ¶
func (*Disk) UnmountPartitionFromGuest ¶
func (d *Disk) UnmountPartitionFromGuest(ctx context.Context, partition uint64, linuxGuest mount.LinuxGuestSCSIUnmounter, windowsGuest mount.WindowsGuestSCSIUnmounter) error
type DiskConfig ¶
type DiskConfig struct {
// HostPath is the path on the host to the disk to be attached.
HostPath string
// ReadOnly specifies whether the disk should be attached with read-only access.
ReadOnly bool
// Type specifies the attachment protocol to use when attaching the disk.
Type DiskType
// EVDType is the EVD provider name.
// Only populated when Type is [DiskTypeExtensibleVirtualDisk].
EVDType string
}
DiskConfig describes the host-side disk to attach to the VM's SCSI bus.
func (DiskConfig) Equals ¶
func (d DiskConfig) Equals(other DiskConfig) bool
equals reports whether two DiskConfig values describe the same attachment parameters.
type DiskState ¶
type DiskState int
const ( // The disk has never been attached. DiskStateReserved DiskState = iota // The disk is currently attached to the guest. DiskStateAttached // The disk was previously attached and ejected and must be detached. DiskStateEjected // The disk was previously attached and detached, this is terminal. DiskStateDetached )
type DiskType ¶
type DiskType string
DiskType identifies the attachment protocol used when adding a disk to the VM's SCSI bus.
const ( // DiskTypeVirtualDisk attaches the disk as a virtual hard disk (VHD/VHDX). DiskTypeVirtualDisk DiskType = "VirtualDisk" // DiskTypePassThru attaches a physical disk directly to the VM with pass-through access. DiskTypePassThru DiskType = "PassThru" // DiskTypeExtensibleVirtualDisk attaches a disk via an extensible virtual disk (EVD) provider. // The hostPath must be in the form evd://<type>/<mountPath>. DiskTypeExtensibleVirtualDisk DiskType = "ExtensibleVirtualDisk" )
type LinuxGuestSCSIEjector ¶
type LinuxGuestSCSIEjector interface {
RemoveSCSIDevice(ctx context.Context, settings guestresource.SCSIDevice) error
}
type VMSCSIAdder ¶
Click to show internal directories.
Click to hide internal directories.