vm

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateCiNetConfig added in v0.0.8

func AllocateCiNetConfig(position int, config *string, input *proxmox.ApplyVirtualMachineConfigurationSyncRequestContent) error

func AllocateDiskConfig added in v0.0.8

func AllocateDiskConfig(t string, position int, config *string, input *proxmox.ApplyVirtualMachineConfigurationSyncRequestContent) error

func AllocateNetworkInterfaceConfig added in v0.0.8

func AllocateNetworkInterfaceConfig(position int, config *string, input *proxmox.ApplyVirtualMachineConfigurationSyncRequestContent) error

func BytesToStr added in v0.0.8

func BytesToStr(bytes int64) string

func DetermineBios added in v0.0.8

func DetermineKeyboardLayout added in v0.0.8

func DetermineKeyboardLayout(k *proxmox.VirtualMachineKeyboard) *proxmox.VirtualMachineKeyboard

func DetermineMachineType added in v0.0.8

func DetermineMachineType(sum proxmox.VirtualMachineConfigurationSummary) *string

func GenerateMAC added in v0.0.8

func GenerateMAC() string

func GigabytesToStr added in v0.0.8

func GigabytesToStr(gb int64) string

Types

type VirtualBios

type VirtualBios string
const (
	VIRTUAL_BIOS_SEABIOS VirtualBios = "seabios"
	VIRTUAL_BIOS_OVMF    VirtualBios = "ovmf"
)

func (*VirtualBios) IsValid

func (e *VirtualBios) IsValid() bool

type VirtualDisk

type VirtualDisk struct {
	Storage  string
	Type     VirtualDiskType
	Position string //virtio0, virtio1, scsi0, scsi1, ide0, ide1, sata0, sata1, etc
	Size     int64
	Discard  bool
}

func ExtractDisksFromConfig

func ExtractDisksFromConfig(cfg *proxmox.VirtualMachineConfigurationSummary) ([]VirtualDisk, error)

doing some janky stuff here to get the disks out of the config refator this later to use go routines

type VirtualDiskType

type VirtualDiskType string
const (
	VIRTUAL_DISK_SCSI     VirtualDiskType = "scsi"
	VIRTUAL_DISK_VIRTIO_D VirtualDiskType = "virtio"
	VIRTUAL_DISK_SATA     VirtualDiskType = "sata"
	VIRTUAL_DISK_IDE      VirtualDiskType = "ide"
)

func (*VirtualDiskType) IsValid

func (e *VirtualDiskType) IsValid() bool

type VirtualMachine

type VirtualMachine struct {
	Id                    int
	Agent                 bool
	Node                  string
	Name                  string
	Memory                int64
	Cores                 int
	Tags                  []string
	VirtualDisks          []VirtualDisk
	VirtualNetworkDevices []VirtualNetworkDevice
}

type VirtualMachineAgent added in v0.0.8

type VirtualMachineAgent struct {
	Enabled bool
	FsTrim  bool
	Type    *string
}

func DetermineAgentConfig added in v0.0.8

func DetermineAgentConfig(a *string) *VirtualMachineAgent

type VirtualMachineCloudInit added in v0.0.8

type VirtualMachineCloudInit struct {
	User *VirtualMachineCloudInitUser
	Ip   []VirtualMachineCloudInitIp
	Dns  *VirtualMachineCloudInitDns
}

func DetermineCloudInitConfiguration added in v0.0.8

func DetermineCloudInitConfiguration(sum proxmox.VirtualMachineConfigurationSummary) *VirtualMachineCloudInit

type VirtualMachineCloudInitDns added in v0.0.8

type VirtualMachineCloudInitDns struct {
	Nameserver *string
	Domain     *string
}

type VirtualMachineCloudInitIp added in v0.0.8

type VirtualMachineCloudInitIp struct {
	Position int
	V4       *VirtualMachineCloudInitIpConfig
	V6       *VirtualMachineCloudInitIpConfig
}

type VirtualMachineCloudInitIpConfig added in v0.0.8

type VirtualMachineCloudInitIpConfig struct {
	DHCP    bool
	Address *string
	Netmask *string
	Gateway *string
}

type VirtualMachineCloudInitUser added in v0.0.8

type VirtualMachineCloudInitUser struct {
	Name       *string
	Password   *string
	PublicKeys []string
}

type VirtualMachineCpu added in v0.0.8

type VirtualMachineCpu struct {
	Architecture string
	Cores        int
	Sockets      int
	EmulatedType *string
	CpuUnits     *int64
}

func DetermineCPUConfiguration added in v0.0.8

func DetermineCPUConfiguration(sum proxmox.VirtualMachineConfigurationSummary) VirtualMachineCpu

type VirtualMachineDisk added in v0.0.8

type VirtualMachineDisk struct {
	Storage       string
	FileFormat    *string
	Size          int64
	UseIOThreads  bool
	Position      int
	InterfaceType string
	SpeedLimits   *VirtualMachineDiskSpeedLimits
	SSDEmulation  bool
	Discard       bool
	Name          string
}

func DetermineDiskConfiguration added in v0.0.8

func DetermineDiskConfiguration(cfg *proxmox.VirtualMachineConfigurationSummary) ([]VirtualMachineDisk, error)

take 2 of the vm_disk_extraction from previous data source, I'll need to consolidate these at some point

type VirtualMachineDiskSpeedLimits added in v0.0.8

type VirtualMachineDiskSpeedLimits struct {
	Read           *int64
	ReadBurstable  *int64
	Write          *int64
	WriteBurstable *int64
}

type VirtualMachineMemory added in v0.0.8

type VirtualMachineMemory struct {
	Dedicated int64
	Shared    *int64
	Floating  *int64
}

func DetermineMemoryConfiguration added in v0.0.8

func DetermineMemoryConfiguration(sum proxmox.VirtualMachineConfigurationSummary) VirtualMachineMemory

type VirtualMachineNetworkInterface added in v0.0.8

type VirtualMachineNetworkInterface struct {
	Bridge    string
	Enabled   bool
	Firewall  bool
	MAC       string
	Model     string
	RateLimit *int64
	VLAN      *int
	MTU       *int64
	Position  int
}

func DetermineNetworkDevicesFromConfig added in v0.0.8

func DetermineNetworkDevicesFromConfig(cfg *proxmox.VirtualMachineConfigurationSummary) ([]VirtualMachineNetworkInterface, error)

type VirtualMachinePCIDevice added in v0.0.8

type VirtualMachinePCIDevice struct {
	Name       string
	ID         string
	PCIE       bool
	MDEV       *string
	ROMBAR     bool
	ROMFile    *string
	PrimaryGPU bool
}

type VirtualNetworkDevice

type VirtualNetworkDevice struct {
	Bridge          string
	Vlan            int
	Model           VirtualNetworkDeviceModel
	Mac             string
	Position        string
	FirewallEnabled bool
}

type VirtualNetworkDeviceModel

type VirtualNetworkDeviceModel string
const (
	VIRTUAL_NIC_INTEL_E1000     VirtualNetworkDeviceModel = "e1000"
	VIRTUAL_NIC_VIRTIO          VirtualNetworkDeviceModel = "virtio"
	VIRTUAL_NIC_REALTEK_RTL8139 VirtualNetworkDeviceModel = "rtl8139"
	VIRTUAL_NIC_VMWARE_VMXNET3  VirtualNetworkDeviceModel = "vmxnet3"
)

func (*VirtualNetworkDeviceModel) IsValid

func (e *VirtualNetworkDeviceModel) IsValid() bool

Jump to

Keyboard shortcuts

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