proxmox

package
v0.0.6-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// The timeout for qemu-agent to start in seconds
	AgentTimeoutSeconds = 10

	VirtualMachineDeleteTimesNum = 10
	VirtualMachineDeleteSteps    = 20
)

Variables

View Source
var (
	// Create Proxmox client
	Client = CreateProxmoxClient()
)

Functions

func AgentIsRunning

func AgentIsRunning(vmName, nodeName string) bool

func CheckManagedVMExists

func CheckManagedVMExists(managedVM string) bool

func CheckVM

func CheckVM(vmName, nodeName string) bool

func CheckVMType

func CheckVMType(vm *proxmoxv1alpha1.VirtualMachine) string

func CloneContainer

func CloneContainer(container *proxmoxv1alpha1.Container) error

func ContainerExists

func ContainerExists(containerName, nodeName string) bool

func CreateCustomCertificate

func CreateCustomCertificate(nodeName string, proxmoxCertSpec *proxmoxv1alpha1.ProxmoxCertSpec) error

CreateCustomCertificate creates a custom certificate object in proxmox node

func CreateManagedVM

func CreateManagedVM(managedVM string) *proxmoxv1alpha1.ManagedVirtualMachine

func CreateProxmoxClient

func CreateProxmoxClient() *proxmox.Client

func CreateVMFromScratch

func CreateVMFromScratch(vm *proxmoxv1alpha1.VirtualMachine)

func CreateVMFromTemplate

func CreateVMFromTemplate(vm *proxmoxv1alpha1.VirtualMachine)

func CreateVMSnapshot

func CreateVMSnapshot(vmName, snapshotName string) (statusCode int)

func DeleteContainer

func DeleteContainer(containerName, nodeName string)

func DeleteCustomCertificate

func DeleteCustomCertificate(nodeName string)

Delete certificate object from proxmox node

func DeleteStorageContent

func DeleteStorageContent(storageName string, spec *proxmoxv1alpha1.StorageDownloadURLSpec) error

func DeleteVM

func DeleteVM(vmName, nodeName string)

func GetContainer

func GetContainer(containerName, nodeName string) *proxmox.Container

func GetContainerID

func GetContainerID(containerName, nodeName string) int

func GetContainerState

func GetContainerState(containerName, nodeName string) string

func GetControllerVMs

func GetControllerVMs() []string

func GetManagedVMSpec

func GetManagedVMSpec(managedVMName, nodeName string) (cores, memory, disk int)

func GetManagedVMs

func GetManagedVMs() []string

func GetNodeOfVM

func GetNodeOfVM(vmName string) string

func GetNodes

func GetNodes() ([]string, error)

func GetOSInfo

func GetOSInfo(vmName, nodeName string) string

func GetOnlineNodes

func GetOnlineNodes() []string

func GetProxmoxVMs

func GetProxmoxVMs() []string

func GetProxmoxVersion

func GetProxmoxVersion() (*proxmox.Version, error)

func GetStorageContent

func GetStorageContent(node, storageName string) ([]*proxmox.StorageContent, error)

func GetTask

func GetTask(taskUPID string) *proxmox.Task

func GetVMID

func GetVMID(vmName, nodeName string) int

func GetVMIPAddress

func GetVMIPAddress(vmName, nodeName string) string

func GetVMSnapshots

func GetVMSnapshots(vmName string) ([]string, error)

func GetVMState

func GetVMState(vmName, nodeName string) string

func GetVMUptime

func GetVMUptime(vmName, nodeName string) string

func HasFile

func HasFile(storageContent []*proxmox.StorageContent, storageDownloadSpec *proxmoxv1alpha1.StorageDownloadURLSpec) bool

func IsVMLocked

func IsVMLocked(vmName string) bool

func LockVM

func LockVM(vmName string)

func RestartContainer

func RestartContainer(containerName, nodeName string) bool

func RestartVM

func RestartVM(vmName, nodeName string) *proxmox.Task

func StartContainer

func StartContainer(containerName, nodeName string) error

func StartVM

func StartVM(vmName, nodeName string)

func StopContainer

func StopContainer(containerName, nodeName string) (*proxmox.ContainerStatus, error)

func StorageDownloadURL

func StorageDownloadURL(node string, storageDownloadURLSpec *proxmoxv1alpha1.StorageDownloadURLSpec) (string, error)

func UnlockVM

func UnlockVM(vmName string)

func UpdateContainer

func UpdateContainer(container *proxmoxv1alpha1.Container)

func UpdateContainerStatus

func UpdateContainerStatus(containerName, nodeName string) proxmoxv1alpha1.QEMUStatus

func UpdateManagedVM

func UpdateManagedVM(managedVMName, nodeName string, managedVM *proxmoxv1alpha1.ManagedVirtualMachine)

func UpdateVM

func UpdateVM(vmName, nodeName string, vm *proxmoxv1alpha1.VirtualMachine)

func UpdateVMStatus

func UpdateVMStatus(vmName, nodeName string) (*proxmoxv1alpha1.QEMUStatus, error)

func VMSnapshotExists

func VMSnapshotExists(vmName, snapshotName string) bool

Types

type ProxmoxConfig

type ProxmoxConfig struct {
	Endpoint              string
	APIEndpoint           string
	InsecureSkipTLSVerify bool
	Username              string
	Password              string
	TokenID               string
	Secret                string
}

type VMMutex

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

Jump to

Keyboard shortcuts

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