vmx

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package vmx implements driver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	VmrunPath        string `json:"vmrun_path"`        // '/Applications/VMware Fusion.app/Contents/Library/vmrun'
	VdiskmanagerPath string `json:"vdiskmanager_path"` // '/Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager'

	ImagesPath    string `json:"images_path"`    // Where to look/store VM images
	WorkspacePath string `json:"workspace_path"` // Where to place the cloned VM and disks

	// Alter allows you to control how much resources will be used:
	// * Negative (<0) value will alter the total resource count before provisioning so you will be
	//   able to save some resources for the host system (recommended -2 for CPU and -10 for RAM
	//   for disk caching)
	// * Positive (>0) value could also be available (but check it in your vmware dist in advance)
	//   Please be careful here - noone wants the VM to fail allocation because of that...
	CPUAlter int32 `json:"cpu_alter"` // 0 do nothing, <0 reduces number available CPUs, >0 increases it (dangerous)
	RAMAlter int32 `json:"ram_alter"` // 0 do nothing, <0 reduces amount of available RAM (GB), >0 increases it (dangerous)

	// Overbook options allows tenants to reuse the resources
	// It will be used only when overbook is allowed by the tenants. It works by just adding those
	// amounts to the existing total before checking availability. For example if you have 16CPU
	// and want to run 2 tenants with requirement of 14 CPUs each - you can put 12 in CPUOverbook -
	// to have virtually 28 CPUs. 3rd will not be running because 2 tenants will eat all 28 virtual
	// CPUs. Same applies to the RamOverbook.
	CPUOverbook uint32 `json:"cpu_overbook"` // How much CPUs could be reused by multiple tenants
	RAMOverbook uint32 `json:"ram_overbook"` // How much RAM (GB) could be reused by multiple tenants

	DownloadUser     string `json:"download_user"`     // The user will be used in download operations
	DownloadPassword string `json:"download_password"` // The password will be used in download operations

	LogMonitor bool `json:"log_monitor"` // Actively monitor the vmware.log of VM and reset it on halt
}

Config - node driver configuration

func (*Config) Apply

func (c *Config) Apply(config []byte) error

Apply takes json and applies it to the config structure

func (*Config) Validate

func (c *Config) Validate() (err error)

Validate makes sure the config have the required defaults & that the required fields are set

type Driver

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

Driver implements provider.Driver interface

func (*Driver) Allocate

Allocate VM with provided images

It automatically download the required images, unpack them and runs the VM. Not using metadata because there is no good interfaces to pass it to VM.

func (*Driver) AvailableCapacity

func (d *Driver) AvailableCapacity(nodeUsage typesv2.Resources, req typesv2.LabelDefinition) int64

AvailableCapacity allows Fish to ask the driver about it's capacity (free slots) of a specific definition

func (*Driver) Deallocate

func (d *Driver) Deallocate(res typesv2.ApplicationResource) error

Deallocate the resource

func (*Driver) GetTask

func (d *Driver) GetTask(name, options string) provider.DriverTask

GetTask returns task struct by name

func (*Driver) IsRemote

func (*Driver) IsRemote() bool

IsRemote needed to detect the out-of-node resources managed by this driver

func (*Driver) Name

func (d *Driver) Name() string

Name returns name of the driver

func (*Driver) Prepare

func (d *Driver) Prepare(config []byte) error

Prepare initializes the driver

func (*Driver) SetName

func (d *Driver) SetName(name string)

Name returns name of the gate

func (*Driver) Status

func (d *Driver) Status(res typesv2.ApplicationResource) (string, error)

Status shows status of the resource

func (*Driver) ValidateDefinition

func (d *Driver) ValidateDefinition(def typesv2.LabelDefinition) error

ValidateDefinition checks LabelDefinition is ok

type Factory

type Factory struct{}

Factory implements provider.DriverFactory interface

func (*Factory) Name

func (*Factory) Name() string

Name shows name of the driver factory

func (*Factory) New

func (f *Factory) New() provider.Driver

New creates new provider driver

type Options

type Options struct{}

Options for label definition (empty)

func (*Options) Apply

func (o *Options) Apply(options util.UnparsedJSON) error

Apply takes json and applies it to the options structure

func (*Options) Validate

func (*Options) Validate() error

Validate makes sure the options have the required defaults & that the required fields are set

Jump to

Keyboard shortcuts

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