Documentation
¶
Index ¶
- func NewPlugin(logger hclog.Logger) drivers.DriverPlugin
- func TaskIDToTapIfaceName(taskID string) string
- type AuthConfig
- type AutoTunTapIface
- type BalloonConfig
- type CloudHypervisorClient
- func (c *CloudHypervisorClient) AddDevice(ctx context.Context, device DeviceConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddDisk(ctx context.Context, disk DiskConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddFs(ctx context.Context, fs FsConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddNet(ctx context.Context, net NetConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddPmem(ctx context.Context, pmem PmemConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddUserDevice(ctx context.Context, device VmAddUserDevice) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddVdpa(ctx context.Context, vdpa VdpaConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) AddVsock(ctx context.Context, vsock VsockConfig) (*PciDeviceInfo, error)
- func (c *CloudHypervisorClient) BootVM(ctx context.Context) error
- func (c *CloudHypervisorClient) CoredumpVM(ctx context.Context, coredump VmCoredumpData) error
- func (c *CloudHypervisorClient) CreateVM(ctx context.Context, cfg VmConfig) error
- func (c *CloudHypervisorClient) DeleteVM(ctx context.Context) error
- func (c *CloudHypervisorClient) GetVMCounters(ctx context.Context) (VmCounters, error)
- func (c *CloudHypervisorClient) GetVMInfo(ctx context.Context) (VmInfo, error)
- func (c *CloudHypervisorClient) InjectNMI(ctx context.Context) error
- func (c *CloudHypervisorClient) PauseVM(ctx context.Context) error
- func (c *CloudHypervisorClient) PingCloudHypervisor(ctx context.Context) (VmmPingResponse, error)
- func (c *CloudHypervisorClient) PowerButtonVM(ctx context.Context) error
- func (c *CloudHypervisorClient) RebootVM(ctx context.Context) error
- func (c *CloudHypervisorClient) ReceiveMigration(ctx context.Context, data ReceiveMigrationData) error
- func (c *CloudHypervisorClient) RemoveDevice(ctx context.Context, device VmRemoveDevice) error
- func (c *CloudHypervisorClient) ResizeDisk(ctx context.Context, resize VmResizeDisk) error
- func (c *CloudHypervisorClient) ResizeMemoryZone(ctx context.Context, resize VmResizeZone) error
- func (c *CloudHypervisorClient) ResizeVM(ctx context.Context, resize VmResize) error
- func (c *CloudHypervisorClient) RestoreVM(ctx context.Context, restore RestoreConfig) error
- func (c *CloudHypervisorClient) ResumeVM(ctx context.Context) error
- func (c *CloudHypervisorClient) SendMigration(ctx context.Context, data SendMigrationData) error
- func (c *CloudHypervisorClient) ShutdownVM(ctx context.Context) error
- func (c *CloudHypervisorClient) ShutdownVMM(ctx context.Context) error
- func (c *CloudHypervisorClient) SnapshotVM(ctx context.Context, snapshot VmSnapshotConfig) error
- type CloudHypervisorClientConfig
- type CloudHypervisorDriverPlugin
- func (d *CloudHypervisorDriverPlugin) Capabilities() (*drivers.Capabilities, error)
- func (d *CloudHypervisorDriverPlugin) ConfigSchema() (*hclspec.Spec, error)
- func (d *CloudHypervisorDriverPlugin) DestroyTask(taskID string, force bool) error
- func (d *CloudHypervisorDriverPlugin) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)
- func (d *CloudHypervisorDriverPlugin) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)
- func (d *CloudHypervisorDriverPlugin) InspectTask(taskID string) (*drivers.TaskStatus, error)
- func (d *CloudHypervisorDriverPlugin) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *CloudHypervisorDriverPlugin) RecoverTask(handle *drivers.TaskHandle) error
- func (d *CloudHypervisorDriverPlugin) SetConfig(cfg *base.Config) error
- func (d *CloudHypervisorDriverPlugin) SignalTask(taskID string, signal string) error
- func (d *CloudHypervisorDriverPlugin) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
- func (d *CloudHypervisorDriverPlugin) StopTask(taskID string, timeout time.Duration, signal string) (err error)
- func (d *CloudHypervisorDriverPlugin) TaskConfigSchema() (*hclspec.Spec, error)
- func (d *CloudHypervisorDriverPlugin) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)
- func (d *CloudHypervisorDriverPlugin) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error)
- func (d *CloudHypervisorDriverPlugin) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)
- type CloudHypervisorProcess
- type CloudInit
- type Config
- type ConsoleConfig
- type ConsoleMode
- type CoreSchedulingMode
- type CpuAffinity
- type CpuFeatures
- type CpuTopology
- type CpusConfig
- type DebugConsoleConfig
- type DeviceConfig
- type DeviceNode
- type DiskConfig
- type FsConfig
- type ImageType
- type LandlockConfig
- type LockGranularity
- type MemoryConfig
- type MemoryRestoreMode
- type MemoryZoneConfig
- type NetConfig
- type NumaConfig
- type NumaDistance
- type OCIMetadata
- type OCIMetadataConfig
- type OverlayDisk
- type PayloadConfig
- type PciDeviceInfo
- type PciSegmentConfig
- type PlatformConfig
- type PmemConfig
- type RateLimitGroupConfig
- type RateLimiterConfig
- type ReceiveMigrationData
- type RestoreConfig
- type RngConfig
- type SendMigrationData
- type TaskBalloonConfig
- type TaskConfig
- type TaskConsoleConfig
- type TaskDiskConfig
- type TaskNetworkConfig
- type TaskPayloadConfig
- type TaskState
- type TokenBucket
- type TpmConfig
- type VdpaConfig
- type VirtQueueAffinity
- type VmAddUserDevice
- type VmConfig
- type VmCoredumpData
- type VmCounters
- type VmInfo
- type VmRemoveDevice
- type VmResize
- type VmResizeDisk
- type VmResizeZone
- type VmSnapshotConfig
- type VmState
- type VmmPingResponse
- type VsockConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPlugin ¶
func NewPlugin(logger hclog.Logger) drivers.DriverPlugin
NewPlugin returns a new cloud-hypervisor driver plugin
func TaskIDToTapIfaceName ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Config string `codec:"config"`
}
AuthConfig holds optional OCI registry authentication settings.
type AutoTunTapIface ¶
type AutoTunTapIface struct {
// contains filtered or unexported fields
}
func NewAutoTunTapIface ¶
func NewAutoTunTapIface(iface string, bridge string, logger hclog.Logger) *AutoTunTapIface
func NewAutoTunTapIfaceFromNetConfig ¶
func NewAutoTunTapIfaceFromNetConfig(networkConfig *TaskNetworkConfig, taskID string, logger hclog.Logger) *AutoTunTapIface
func (*AutoTunTapIface) Down ¶
func (a *AutoTunTapIface) Down() error
func (*AutoTunTapIface) Up ¶
func (a *AutoTunTapIface) Up() error
type BalloonConfig ¶
type BalloonConfig struct {
Size int64 `json:"size"`
DeflateOnOom *bool `json:"deflate_on_oom,omitempty"`
FreePageReporting *bool `json:"free_page_reporting,omitempty"`
}
BalloonConfig describes the virtio balloon device.
type CloudHypervisorClient ¶
type CloudHypervisorClient struct {
// contains filtered or unexported fields
}
func NewCloudHypervisorClient ¶
func NewCloudHypervisorClient(config *CloudHypervisorClientConfig, logger hclog.Logger) *CloudHypervisorClient
func (*CloudHypervisorClient) AddDevice ¶
func (c *CloudHypervisorClient) AddDevice(ctx context.Context, device DeviceConfig) (*PciDeviceInfo, error)
AddDevice adds a host device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddDisk ¶
func (c *CloudHypervisorClient) AddDisk(ctx context.Context, disk DiskConfig) (*PciDeviceInfo, error)
AddDisk adds a disk to the VM instance. Returns PciDeviceInfo when the disk is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddFs ¶
func (c *CloudHypervisorClient) AddFs(ctx context.Context, fs FsConfig) (*PciDeviceInfo, error)
AddFs adds a virtio-fs device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddNet ¶
func (c *CloudHypervisorClient) AddNet(ctx context.Context, net NetConfig) (*PciDeviceInfo, error)
AddNet adds a network device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddPmem ¶
func (c *CloudHypervisorClient) AddPmem(ctx context.Context, pmem PmemConfig) (*PciDeviceInfo, error)
AddPmem adds a persistent memory device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddUserDevice ¶
func (c *CloudHypervisorClient) AddUserDevice(ctx context.Context, device VmAddUserDevice) (*PciDeviceInfo, error)
AddUserDevice adds a userspace device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddVdpa ¶
func (c *CloudHypervisorClient) AddVdpa(ctx context.Context, vdpa VdpaConfig) (*PciDeviceInfo, error)
AddVdpa adds a vDPA device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) AddVsock ¶
func (c *CloudHypervisorClient) AddVsock(ctx context.Context, vsock VsockConfig) (*PciDeviceInfo, error)
AddVsock adds a vsock device to the VM instance. Returns PciDeviceInfo when the device is hot-added (200); nil when cold-added (204).
func (*CloudHypervisorClient) BootVM ¶
func (c *CloudHypervisorClient) BootVM(ctx context.Context) error
BootVM boots a previously created VM instance.
func (*CloudHypervisorClient) CoredumpVM ¶
func (c *CloudHypervisorClient) CoredumpVM(ctx context.Context, coredump VmCoredumpData) error
CoredumpVM takes a coredump of the VM instance to the given destination URL.
func (*CloudHypervisorClient) CreateVM ¶
func (c *CloudHypervisorClient) CreateVM(ctx context.Context, cfg VmConfig) error
CreateVM creates a new VM instance from the provided configuration. The VM is only created, not booted; call BootVM to start it.
func (*CloudHypervisorClient) DeleteVM ¶
func (c *CloudHypervisorClient) DeleteVM(ctx context.Context) error
DeleteVM deletes the current VM instance.
func (*CloudHypervisorClient) GetVMCounters ¶
func (c *CloudHypervisorClient) GetVMCounters(ctx context.Context) (VmCounters, error)
GetVMCounters returns the current device counters for the VM instance.
func (*CloudHypervisorClient) GetVMInfo ¶
func (c *CloudHypervisorClient) GetVMInfo(ctx context.Context) (VmInfo, error)
GetVMInfo returns general information about the VM instance.
func (*CloudHypervisorClient) InjectNMI ¶
func (c *CloudHypervisorClient) InjectNMI(ctx context.Context) error
InjectNMI injects a Non-Maskable Interrupt into the VM.
func (*CloudHypervisorClient) PauseVM ¶
func (c *CloudHypervisorClient) PauseVM(ctx context.Context) error
PauseVM pauses a running VM instance.
func (*CloudHypervisorClient) PingCloudHypervisor ¶
func (c *CloudHypervisorClient) PingCloudHypervisor(ctx context.Context) (VmmPingResponse, error)
PingCloudHypervisor checks API server availability and returns VMM information.
func (*CloudHypervisorClient) PowerButtonVM ¶
func (c *CloudHypervisorClient) PowerButtonVM(ctx context.Context) error
PowerButtonVM triggers the power button on the VM instance.
func (*CloudHypervisorClient) RebootVM ¶
func (c *CloudHypervisorClient) RebootVM(ctx context.Context) error
RebootVM reboots the VM instance.
func (*CloudHypervisorClient) ReceiveMigration ¶
func (c *CloudHypervisorClient) ReceiveMigration(ctx context.Context, data ReceiveMigrationData) error
ReceiveMigration prepares the VMM to receive an incoming VM migration.
func (*CloudHypervisorClient) RemoveDevice ¶
func (c *CloudHypervisorClient) RemoveDevice(ctx context.Context, device VmRemoveDevice) error
RemoveDevice removes a device from the VM instance by its identifier.
func (*CloudHypervisorClient) ResizeDisk ¶
func (c *CloudHypervisorClient) ResizeDisk(ctx context.Context, resize VmResizeDisk) error
ResizeDisk resizes a disk attached to the VM instance.
func (*CloudHypervisorClient) ResizeMemoryZone ¶
func (c *CloudHypervisorClient) ResizeMemoryZone(ctx context.Context, resize VmResizeZone) error
ResizeMemoryZone resizes a memory zone of the VM instance.
func (*CloudHypervisorClient) ResizeVM ¶
func (c *CloudHypervisorClient) ResizeVM(ctx context.Context, resize VmResize) error
ResizeVM resizes the vCPUs and/or memory of the VM instance.
func (*CloudHypervisorClient) RestoreVM ¶
func (c *CloudHypervisorClient) RestoreVM(ctx context.Context, restore RestoreConfig) error
RestoreVM restores the VM instance from a previously taken snapshot.
func (*CloudHypervisorClient) ResumeVM ¶
func (c *CloudHypervisorClient) ResumeVM(ctx context.Context) error
ResumeVM resumes a previously paused VM instance.
func (*CloudHypervisorClient) SendMigration ¶
func (c *CloudHypervisorClient) SendMigration(ctx context.Context, data SendMigrationData) error
SendMigration migrates the VM instance to a remote destination.
func (*CloudHypervisorClient) ShutdownVM ¶
func (c *CloudHypervisorClient) ShutdownVM(ctx context.Context) error
ShutdownVM shuts down the VM instance.
func (*CloudHypervisorClient) ShutdownVMM ¶
func (c *CloudHypervisorClient) ShutdownVMM(ctx context.Context) error
ShutdownVMM shuts down the cloud-hypervisor VMM process entirely.
func (*CloudHypervisorClient) SnapshotVM ¶
func (c *CloudHypervisorClient) SnapshotVM(ctx context.Context, snapshot VmSnapshotConfig) error
SnapshotVM takes a snapshot of the VM instance to the given destination URL.
type CloudHypervisorClientConfig ¶
type CloudHypervisorClientConfig struct {
CloudHypervisorSocket string
}
func NewCloudHypervisorClientConfig ¶
func NewCloudHypervisorClientConfig(socket string) *CloudHypervisorClientConfig
type CloudHypervisorDriverPlugin ¶
type CloudHypervisorDriverPlugin struct {
// contains filtered or unexported fields
}
CloudHypervisorDriverPlugin is an example driver plugin. When provisioned in a job, the taks will output a greet specified by the user.
func (*CloudHypervisorDriverPlugin) Capabilities ¶
func (d *CloudHypervisorDriverPlugin) Capabilities() (*drivers.Capabilities, error)
Capabilities returns the features supported by the driver.
func (*CloudHypervisorDriverPlugin) ConfigSchema ¶
func (d *CloudHypervisorDriverPlugin) ConfigSchema() (*hclspec.Spec, error)
ConfigSchema returns the plugin configuration schema.
func (*CloudHypervisorDriverPlugin) DestroyTask ¶
func (d *CloudHypervisorDriverPlugin) DestroyTask(taskID string, force bool) error
DestroyTask cleans up and removes a task that has terminated.
func (*CloudHypervisorDriverPlugin) ExecTask ¶
func (d *CloudHypervisorDriverPlugin) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)
ExecTask returns the result of executing the given command inside a task. This is an optional capability.
func (*CloudHypervisorDriverPlugin) Fingerprint ¶
func (d *CloudHypervisorDriverPlugin) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)
Fingerprint returns a channel that will be used to send health information and other driver specific node attributes.
func (*CloudHypervisorDriverPlugin) InspectTask ¶
func (d *CloudHypervisorDriverPlugin) InspectTask(taskID string) (*drivers.TaskStatus, error)
InspectTask returns detailed status information for the referenced taskID.
func (*CloudHypervisorDriverPlugin) PluginInfo ¶
func (d *CloudHypervisorDriverPlugin) PluginInfo() (*base.PluginInfoResponse, error)
PluginInfo returns information describing the plugin.
func (*CloudHypervisorDriverPlugin) RecoverTask ¶
func (d *CloudHypervisorDriverPlugin) RecoverTask(handle *drivers.TaskHandle) error
RecoverTask recreates the in-memory state of a task from a TaskHandle.
func (*CloudHypervisorDriverPlugin) SetConfig ¶
func (d *CloudHypervisorDriverPlugin) SetConfig(cfg *base.Config) error
func (*CloudHypervisorDriverPlugin) SignalTask ¶
func (d *CloudHypervisorDriverPlugin) SignalTask(taskID string, signal string) error
SignalTask forwards a signal to a task. This is an optional capability.
func (*CloudHypervisorDriverPlugin) StartTask ¶
func (d *CloudHypervisorDriverPlugin) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
StartTask returns a task handle and a driver network if necessary.
func (*CloudHypervisorDriverPlugin) StopTask ¶
func (d *CloudHypervisorDriverPlugin) StopTask(taskID string, timeout time.Duration, signal string) (err error)
StopTask stops a running task with the given signal and within the timeout window.
func (*CloudHypervisorDriverPlugin) TaskConfigSchema ¶
func (d *CloudHypervisorDriverPlugin) TaskConfigSchema() (*hclspec.Spec, error)
TaskConfigSchema returns the HCL schema for the configuration of a task.
func (*CloudHypervisorDriverPlugin) TaskEvents ¶
func (d *CloudHypervisorDriverPlugin) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)
TaskEvents returns a channel that the plugin can use to emit task related events.
func (*CloudHypervisorDriverPlugin) TaskStats ¶
func (d *CloudHypervisorDriverPlugin) TaskStats( ctx context.Context, taskID string, interval time.Duration, ) (<-chan *drivers.TaskResourceUsage, error)
TaskStats returns a channel which the driver should send stats to at the given interval.
func (*CloudHypervisorDriverPlugin) WaitTask ¶
func (d *CloudHypervisorDriverPlugin) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)
WaitTask returns a channel used to notify Nomad when a task exits.
type CloudHypervisorProcess ¶
type CloudHypervisorProcess struct {
Pid int
SocketBasePath string
// contains filtered or unexported fields
}
CloudHypervisorProcess holds the identifiers needed to track a running cloud-hypervisor instance.
type Config ¶
type Config struct {
CloudHypervisorBinaryPath string `codec:"cloud-hypervisor-binary-path"`
CloudHypervisorSocketDir string `codec:"cloud-hypervisor-socket-dir"`
CacheDir string `codec:"cache-dir"`
Auth *AuthConfig `codec:"auth"`
}
Config contains configuration information for the plugin
type ConsoleConfig ¶
type ConsoleConfig struct {
File string `json:"file,omitempty"`
Socket string `json:"socket,omitempty"`
Mode ConsoleMode `json:"mode"`
Iommu *bool `json:"iommu,omitempty"`
}
ConsoleConfig describes a serial or virtio console device.
type ConsoleMode ¶
type ConsoleMode string
ConsoleMode controls how a console device is exposed.
const ( ConsoleModeOff ConsoleMode = "Off" ConsoleModePty ConsoleMode = "Pty" ConsoleModeTty ConsoleMode = "Tty" ConsoleModeFile ConsoleMode = "File" ConsoleModeSocket ConsoleMode = "Socket" ConsoleModeNull ConsoleMode = "Null" )
type CoreSchedulingMode ¶
type CoreSchedulingMode string
CoreSchedulingMode controls the core scheduling granularity.
const ( CoreSchedulingModeVm CoreSchedulingMode = "Vm" CoreSchedulingModeVcpu CoreSchedulingMode = "Vcpu" CoreSchedulingModeOff CoreSchedulingMode = "Off" )
type CpuAffinity ¶
CpuAffinity pins a vCPU to a set of host CPUs.
type CpuFeatures ¶
type CpuFeatures struct {
Amx *bool `json:"amx,omitempty"`
}
CpuFeatures enables optional CPU feature flags.
type CpuTopology ¶
type CpuTopology struct {
ThreadsPerCore *int `json:"threads_per_core,omitempty"`
CoresPerDie *int `json:"cores_per_die,omitempty"`
DiesPerPackage *int `json:"dies_per_package,omitempty"`
Packages *int `json:"packages,omitempty"`
}
CpuTopology describes the CPU topology exposed to the guest.
type CpusConfig ¶
type CpusConfig struct {
BootVcpus int `json:"boot_vcpus"`
MaxVcpus int `json:"max_vcpus"`
Topology *CpuTopology `json:"topology,omitempty"`
KvmHyperv *bool `json:"kvm_hyperv,omitempty"`
MaxPhysBits *int `json:"max_phys_bits,omitempty"`
Nested *bool `json:"nested,omitempty"`
Affinity []CpuAffinity `json:"affinity,omitempty"`
Features *CpuFeatures `json:"features,omitempty"`
CoreScheduling *CoreSchedulingMode `json:"core_scheduling,omitempty"`
}
CpusConfig describes the CPU configuration of a VM.
type DebugConsoleConfig ¶
type DebugConsoleConfig struct {
File string `json:"file,omitempty"`
Mode ConsoleMode `json:"mode"`
Iobase *int `json:"iobase,omitempty"`
}
DebugConsoleConfig describes the debug console device.
type DeviceConfig ¶
type DeviceConfig struct {
Path string `json:"path"`
Iommu *bool `json:"iommu,omitempty"`
PciSegment *int16 `json:"pci_segment,omitempty"`
ID string `json:"id,omitempty"`
XNvGpudirectClique *int8 `json:"x_nv_gpudirect_clique,omitempty"`
}
DeviceConfig describes a host device passed through to the VM.
type DeviceNode ¶
type DeviceNode struct {
ID string `json:"id,omitempty"`
Children []string `json:"children,omitempty"`
PciBdf string `json:"pci_bdf,omitempty"`
}
DeviceNode represents a node in the VM device tree.
type DiskConfig ¶
type DiskConfig struct {
Path string `json:"path,omitempty"`
Readonly *bool `json:"readonly,omitempty"`
Direct *bool `json:"direct,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
NumQueues *int `json:"num_queues,omitempty"`
QueueSize *int `json:"queue_size,omitempty"`
VhostUser *bool `json:"vhost_user,omitempty"`
VhostSocket string `json:"vhost_socket,omitempty"`
RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"`
PciSegment *int16 `json:"pci_segment,omitempty"`
ID string `json:"id,omitempty"`
Serial string `json:"serial,omitempty"`
RateLimitGroup string `json:"rate_limit_group,omitempty"`
QueueAffinity []VirtQueueAffinity `json:"queue_affinity,omitempty"`
BackingFiles *bool `json:"backing_files,omitempty"`
Sparse *bool `json:"sparse,omitempty"`
ImageType *ImageType `json:"image_type,omitempty"`
LockGranularity *LockGranularity `json:"lock_granularity,omitempty"`
}
DiskConfig describes a disk device attached to a VM.
type FsConfig ¶
type FsConfig struct {
Tag string `json:"tag"`
Socket string `json:"socket"`
NumQueues int `json:"num_queues"`
QueueSize int `json:"queue_size"`
PciSegment *int16 `json:"pci_segment,omitempty"`
ID string `json:"id,omitempty"`
}
FsConfig describes a virtio-fs device.
type LandlockConfig ¶
LandlockConfig describes a Landlock filesystem rule.
type LockGranularity ¶
type LockGranularity string
LockGranularity controls disk locking granularity.
const ( LockGranularityByteRange LockGranularity = "ByteRange" LockGranularityFull LockGranularity = "Full" )
type MemoryConfig ¶
type MemoryConfig struct {
Size int64 `json:"size"`
HotplugSize *int64 `json:"hotplug_size,omitempty"`
HotpluggedSize *int64 `json:"hotplugged_size,omitempty"`
Mergeable *bool `json:"mergeable,omitempty"`
HotplugMethod string `json:"hotplug_method,omitempty"`
Hugepages *bool `json:"hugepages,omitempty"`
HugepageSize *int64 `json:"hugepage_size,omitempty"`
Prefault *bool `json:"prefault,omitempty"`
Thp *bool `json:"thp,omitempty"`
Zones []MemoryZoneConfig `json:"zones,omitempty"`
}
MemoryConfig describes the memory configuration of a VM.
type MemoryRestoreMode ¶
type MemoryRestoreMode string
MemoryRestoreMode controls how memory is restored from a snapshot.
const ( MemoryRestoreModeCopy MemoryRestoreMode = "Copy" MemoryRestoreModeOnDemand MemoryRestoreMode = "OnDemand" )
type MemoryZoneConfig ¶
type MemoryZoneConfig struct {
ID string `json:"id"`
Size int64 `json:"size"`
File string `json:"file,omitempty"`
Mergeable *bool `json:"mergeable,omitempty"`
Hugepages *bool `json:"hugepages,omitempty"`
HugepageSize *int64 `json:"hugepage_size,omitempty"`
HostNumaNode *int32 `json:"host_numa_node,omitempty"`
HotplugSize *int64 `json:"hotplug_size,omitempty"`
HotpluggedSize *int64 `json:"hotplugged_size,omitempty"`
Prefault *bool `json:"prefault,omitempty"`
}
MemoryZoneConfig describes a single memory zone.
type NetConfig ¶
type NetConfig struct {
Tap string `json:"tap,omitempty"`
IP string `json:"ip,omitempty"`
Mask string `json:"mask,omitempty"`
Mac string `json:"mac,omitempty"`
HostMac string `json:"host_mac,omitempty"`
Mtu *int `json:"mtu,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
NumQueues *int `json:"num_queues,omitempty"`
QueueSize *int `json:"queue_size,omitempty"`
VhostUser *bool `json:"vhost_user,omitempty"`
VhostSocket string `json:"vhost_socket,omitempty"`
VhostMode string `json:"vhost_mode,omitempty"`
ID string `json:"id,omitempty"`
PciSegment *int16 `json:"pci_segment,omitempty"`
RateLimiterConfig *RateLimiterConfig `json:"rate_limiter_config,omitempty"`
OffloadTso *bool `json:"offload_tso,omitempty"`
OffloadUfo *bool `json:"offload_ufo,omitempty"`
OffloadCsum *bool `json:"offload_csum,omitempty"`
}
NetConfig describes a network device attached to a VM.
type NumaConfig ¶
type NumaConfig struct {
GuestNumaID int32 `json:"guest_numa_id"`
Cpus []int32 `json:"cpus,omitempty"`
Distances []NumaDistance `json:"distances,omitempty"`
MemoryZones []string `json:"memory_zones,omitempty"`
PciSegments []int32 `json:"pci_segments,omitempty"`
DeviceID string `json:"device_id,omitempty"`
}
NumaConfig describes a NUMA node.
type NumaDistance ¶
type NumaDistance struct {
Destination int32 `json:"destination"`
Distance int32 `json:"distance"`
}
NumaDistance describes the NUMA distance between two nodes.
type OCIMetadata ¶
type OCIMetadata struct {
Name string `json:"name"`
Version string `json:"version"`
Arch string `json:"arch"`
Config *OCIMetadataConfig `json:"config,omitempty"`
}
type OCIMetadataConfig ¶
type OCIMetadataConfig struct {
Payload *TaskPayloadConfig `json:"payload,omitempty"`
Disk []TaskDiskConfig `json:"disk,omitempty"`
Console *TaskConsoleConfig `json:"console,omitempty"`
Network []TaskNetworkConfig `json:"network,omitempty"`
CloudInit *CloudInit `json:"cloud-init,omitempty"`
Serial string `json:"serial,omitempty"`
}
type OverlayDisk ¶
type OverlayDisk struct {
// contains filtered or unexported fields
}
func NewOverlayDiskFromDiskConfig ¶
func NewOverlayDiskFromDiskConfig(diskConfig TaskDiskConfig, overlayPath string, useReflink bool) *OverlayDisk
func (*OverlayDisk) BaseImagePath ¶
func (o *OverlayDisk) BaseImagePath() string
func (*OverlayDisk) Create ¶
func (o *OverlayDisk) Create() error
func (*OverlayDisk) OverlayPath ¶
func (o *OverlayDisk) OverlayPath() string
type PayloadConfig ¶
type PayloadConfig struct {
Firmware string `json:"firmware,omitempty"`
Kernel string `json:"kernel,omitempty"`
Cmdline string `json:"cmdline,omitempty"`
Initramfs string `json:"initramfs,omitempty"`
Igvm string `json:"igvm,omitempty"`
HostData string `json:"host_data,omitempty"`
}
PayloadConfig describes the bootable payload of a VM.
type PciDeviceInfo ¶
PciDeviceInfo holds identifying information about a PCI device.
type PciSegmentConfig ¶
type PciSegmentConfig struct {
PciSegment int16 `json:"pci_segment"`
Mmio32ApertureWeight *int32 `json:"mmio32_aperture_weight,omitempty"`
Mmio64ApertureWeight *int32 `json:"mmio64_aperture_weight,omitempty"`
}
PciSegmentConfig describes a PCI segment.
type PlatformConfig ¶
type PlatformConfig struct {
NumPciSegments *int16 `json:"num_pci_segments,omitempty"`
IommuSegments []int16 `json:"iommu_segments,omitempty"`
IommuAddressWidth *uint8 `json:"iommu_address_width,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
UUID string `json:"uuid,omitempty"`
OemStrings []string `json:"oem_strings,omitempty"`
Tdx *bool `json:"tdx,omitempty"`
SevSnp *bool `json:"sev_snp,omitempty"`
}
PlatformConfig describes platform-level VM configuration.
type PmemConfig ¶
type PmemConfig struct {
File string `json:"file"`
Size *int64 `json:"size,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
DiscardWrites *bool `json:"discard_writes,omitempty"`
PciSegment *int16 `json:"pci_segment,omitempty"`
ID string `json:"id,omitempty"`
}
PmemConfig describes a persistent memory device.
type RateLimitGroupConfig ¶
type RateLimitGroupConfig struct {
ID string `json:"id"`
RateLimiterConfig RateLimiterConfig `json:"rate_limiter_config"`
}
RateLimitGroupConfig associates a named rate limit group with a limiter config.
type RateLimiterConfig ¶
type RateLimiterConfig struct {
Bandwidth *TokenBucket `json:"bandwidth,omitempty"`
Ops *TokenBucket `json:"ops,omitempty"`
}
RateLimiterConfig configures independent bandwidth and ops rate limits.
type ReceiveMigrationData ¶
type ReceiveMigrationData struct {
ReceiverURL string `json:"receiver_url"`
}
ReceiveMigrationData describes the local endpoint for an incoming migration.
type RestoreConfig ¶
type RestoreConfig struct {
SourceURL string `json:"source_url"`
Prefault *bool `json:"prefault,omitempty"`
MemoryRestoreMode *MemoryRestoreMode `json:"memory_restore_mode,omitempty"`
Resume *bool `json:"resume,omitempty"`
}
RestoreConfig describes how to restore a VM from a snapshot.
type SendMigrationData ¶
type SendMigrationData struct {
DestinationURL string `json:"destination_url"`
Local *bool `json:"local,omitempty"`
}
SendMigrationData describes the remote endpoint for an outgoing migration.
type TaskBalloonConfig ¶
type TaskBalloonConfig struct {
Enabled bool `codec:"enabled"`
Size string `codec:"size"`
DeflateOnOOM bool `codec:"deflate_on_oom"`
FreePageReporting bool `codec:"free_page_reporting"`
}
TaskBalloonConfig configures the virtio-balloon device.
type TaskConfig ¶
type TaskConfig struct {
Payload TaskPayloadConfig `codec:"payload"`
Disk []TaskDiskConfig `codec:"disk"`
Console TaskConsoleConfig `codec:"console"`
Network []TaskNetworkConfig `codec:"network"`
CloudInit *CloudInit `codec:"cloud-init"`
OCIImage string `codec:"oci_image"`
Serial string `codec:"serial"`
Balloon *TaskBalloonConfig `codec:"balloon"`
}
TaskConfig contains configuration information for a task that runs with this plugin
type TaskConsoleConfig ¶
type TaskConsoleConfig struct {
Mode string `codec:"mode" json:"mode,omitempty"`
}
TaskConsoleConfig corresponds to ConsoleConfig in chtypes (required fields only).
type TaskDiskConfig ¶
type TaskDiskConfig struct {
Path string `codec:"path" json:"path,omitempty"`
ImageType string `codec:"image_type" json:"image_type,omitempty"`
Readonly bool `codec:"readonly" json:"readonly"`
EphemeralOverlay bool `codec:"ephemeral_overlay" json:"ephemeral_overlay"`
// ReflinkCopy is set by the driver (not user-configurable) when the
// ephemeral overlay was created via XFS reflink rather than a qcow2
// backing-file chain. It changes the cloud-hypervisor disk arguments:
// no backing_files=on, and direct=on is safe to use.
ReflinkCopy bool `codec:"-" json:"-"`
}
TaskDiskConfig corresponds to DiskConfig in chtypes.
type TaskNetworkConfig ¶
type TaskPayloadConfig ¶
type TaskPayloadConfig struct {
Kernel string `codec:"kernel" json:"kernel,omitempty"`
Initramfs string `codec:"initramfs" json:"initramfs,omitempty"`
Cmdline string `codec:"cmdline" json:"cmdline,omitempty"`
}
TaskPayloadConfig corresponds to PayloadConfig in chtypes.
type TaskState ¶
type TaskState struct {
TaskConfig *drivers.TaskConfig
StartedAt time.Time
ReattachConfig *structs.ReattachConfig
Pid int
SocketPath string
}
TaskState is the runtime state which is encoded in the handle returned to Nomad client. This information is needed to rebuild the task state and handler during recovery.
type TokenBucket ¶
type TokenBucket struct {
Size int64 `json:"size"`
OneTimeBurst *int64 `json:"one_time_burst,omitempty"`
RefillTime int64 `json:"refill_time"`
}
TokenBucket defines a rate-limiting token bucket.
type TpmConfig ¶
type TpmConfig struct {
Socket string `json:"socket"`
}
TpmConfig describes a TPM device.
type VdpaConfig ¶
type VdpaConfig struct {
Path string `json:"path"`
NumQueues int `json:"num_queues"`
Iommu *bool `json:"iommu,omitempty"`
PciSegment *int16 `json:"pci_segment,omitempty"`
ID string `json:"id,omitempty"`
}
VdpaConfig describes a vDPA device.
type VirtQueueAffinity ¶
type VirtQueueAffinity struct {
QueueIndex int `json:"queue_index"`
HostCpus []int `json:"host_cpus"`
}
VirtQueueAffinity pins a virtqueue to a set of host CPUs.
type VmAddUserDevice ¶
type VmAddUserDevice struct {
Socket string `json:"socket"`
}
VmAddUserDevice describes a userspace device to be added to a running VM.
type VmConfig ¶
type VmConfig struct {
Cpus *CpusConfig `json:"cpus,omitempty"`
Memory *MemoryConfig `json:"memory,omitempty"`
Payload PayloadConfig `json:"payload"`
RateLimitGroups []RateLimitGroupConfig `json:"rate_limit_groups,omitempty"`
Disks []DiskConfig `json:"disks,omitempty"`
Net []NetConfig `json:"net,omitempty"`
Rng *RngConfig `json:"rng,omitempty"`
Balloon *BalloonConfig `json:"balloon,omitempty"`
Fs []FsConfig `json:"fs,omitempty"`
Pmem []PmemConfig `json:"pmem,omitempty"`
Serial *ConsoleConfig `json:"serial,omitempty"`
Console *ConsoleConfig `json:"console,omitempty"`
DebugConsole *DebugConsoleConfig `json:"debug_console,omitempty"`
Devices []DeviceConfig `json:"devices,omitempty"`
Vdpa []VdpaConfig `json:"vdpa,omitempty"`
Vsock *VsockConfig `json:"vsock,omitempty"`
Numa []NumaConfig `json:"numa,omitempty"`
Iommu *bool `json:"iommu,omitempty"`
Watchdog *bool `json:"watchdog,omitempty"`
Pvpanic *bool `json:"pvpanic,omitempty"`
PciSegments []PciSegmentConfig `json:"pci_segments,omitempty"`
Platform *PlatformConfig `json:"platform,omitempty"`
Tpm *TpmConfig `json:"tpm,omitempty"`
LandlockEnable *bool `json:"landlock_enable,omitempty"`
LandlockRules []LandlockConfig `json:"landlock_rules,omitempty"`
}
VmConfig is the top-level configuration used to create a VM instance.
type VmCoredumpData ¶
type VmCoredumpData struct {
DestinationURL string `json:"destination_url,omitempty"`
}
VmCoredumpData describes the destination for a VM coredump.
type VmCounters ¶
VmCounters holds per-device counters keyed by device name and counter name.
type VmInfo ¶
type VmInfo struct {
Config VmConfig `json:"config"`
State VmState `json:"state"`
MemoryActualSize *int64 `json:"memory_actual_size,omitempty"`
DeviceTree map[string]DeviceNode `json:"device_tree,omitempty"`
}
VmInfo holds general information about a VM instance.
type VmRemoveDevice ¶
type VmRemoveDevice struct {
ID string `json:"id,omitempty"`
}
VmRemoveDevice identifies a device to be removed from a running VM.
type VmResize ¶
type VmResize struct {
DesiredVcpus *int `json:"desired_vcpus,omitempty"`
DesiredRam *int64 `json:"desired_ram,omitempty"`
DesiredBalloon *int64 `json:"desired_balloon,omitempty"`
}
VmResize describes a request to resize the VM's vCPUs or memory.
type VmResizeDisk ¶
type VmResizeDisk struct {
ID string `json:"id,omitempty"`
DesiredSize int64 `json:"desired_size,omitempty"`
}
VmResizeDisk describes a request to resize an attached disk.
type VmResizeZone ¶
type VmResizeZone struct {
ID string `json:"id,omitempty"`
DesiredRam int64 `json:"desired_ram,omitempty"`
}
VmResizeZone describes a request to resize a memory zone.
type VmSnapshotConfig ¶
type VmSnapshotConfig struct {
DestinationURL string `json:"destination_url,omitempty"`
}
VmSnapshotConfig describes the destination for a VM snapshot.