Documentation ¶
Index ¶
- Constants
- Variables
- func AgentIsRunning(vmName, nodeName string) bool
- func CheckContainerDelta(container *proxmoxv1alpha1.Container) (bool, error)
- func CheckManagedVMDelta(managedVM *proxmoxv1alpha1.ManagedVirtualMachine) (bool, error)
- func CheckManagedVMExists(managedVM string) bool
- func CheckVM(vmName, nodeName string) bool
- func CheckVMType(vm *proxmoxv1alpha1.VirtualMachine) string
- func CheckVirtualMachineDelta(vm *proxmoxv1alpha1.VirtualMachine) (bool, error)
- func CloneContainer(container *proxmoxv1alpha1.Container) error
- func ConfigureVirtualMachine(vm *proxmoxv1alpha1.VirtualMachine) error
- func ContainerExists(containerName, nodeName string) bool
- func CreateCustomCertificate(nodeName string, proxmoxCertSpec *proxmoxv1alpha1.ProxmoxCertSpec) error
- func CreateManagedVM(managedVM string) *proxmoxv1alpha1.ManagedVirtualMachine
- func CreateProxmoxClient() *proxmox.Client
- func CreateVMFromScratch(vm *proxmoxv1alpha1.VirtualMachine)
- func CreateVMFromTemplate(vm *proxmoxv1alpha1.VirtualMachine)
- func CreateVMSnapshot(vmName, snapshotName string) (statusCode int)
- func DeleteContainer(containerName, nodeName string)
- func DeleteCustomCertificate(nodeName string)
- func DeleteStorageContent(storageName string, spec *proxmoxv1alpha1.StorageDownloadURLSpec) error
- func DeleteVM(vmName, nodeName string)
- func GetContainer(containerName, nodeName string) *proxmox.Container
- func GetContainerID(containerName, nodeName string) int
- func GetContainerState(containerName, nodeName string) string
- func GetDiskConfiguration(vm *proxmoxv1alpha1.VirtualMachine) (map[string]string, error)
- func GetManagedVMSpec(managedVMName, nodeName string) (cores, memory, disk int)
- func GetManagedVMs() []string
- func GetNetworkConfiguration(vmName, nodeName string) (map[string]string, error)
- func GetNodeOfVM(vmName string) string
- func GetNodes() ([]string, error)
- func GetOSInfo(vmName, nodeName string) string
- func GetOnlineNodes() []string
- func GetProxmoxVersion() (*proxmox.Version, error)
- func GetStorageContent(node, storageName string) ([]*proxmox.StorageContent, error)
- func GetTask(taskUPID string) *proxmox.Task
- func GetVMID(vmName, nodeName string) int
- func GetVMIPAddress(vmName, nodeName string) string
- func GetVMSnapshots(vmName string) ([]string, error)
- func GetVMState(vmName, nodeName string) string
- func GetVMUptime(vmName, nodeName string) string
- func HasFile(storageContent []*proxmox.StorageContent, ...) bool
- func RemoveVirtualMachineTag(vmName, nodeName, tag string) error
- func RestartContainer(containerName, nodeName string) bool
- func RestartVM(vmName, nodeName string) *proxmox.Task
- func StartContainer(containerName, nodeName string) error
- func StartVM(vmName, nodeName string) (string, error)
- func StartWatcher(ctx context.Context, resource Resource, stopChan chan struct{}, ...) (ctrl.Result, error)
- func StopContainer(containerName, nodeName string) error
- func StorageDownloadURL(node string, storageDownloadURLSpec *proxmoxv1alpha1.StorageDownloadURLSpec) (string, error)
- func UpdateContainer(container *proxmoxv1alpha1.Container)
- func UpdateContainerStatus(containerName, nodeName string) proxmoxv1alpha1.QEMUStatus
- func UpdateManagedVM(ctx context.Context, managedVM *proxmoxv1alpha1.ManagedVirtualMachine)
- func UpdateVM(vm *proxmoxv1alpha1.VirtualMachine) bool
- func UpdateVMStatus(vmName, nodeName string) (*proxmoxv1alpha1.QEMUStatus, error)
- func VMSnapshotExists(vmName, snapshotName string) bool
- type CheckDeltaFunc
- type DeleteWatcherFunc
- type ExternalWatchers
- type FetchResourceFunc
- type HandleAutoStartFunc
- type HandleReconcileFunc
- type ProxmoxConfig
- type Resource
- type UpdateStatusFunc
- type VirtualMachineComparison
Constants ¶
View Source
const ( // The tag that will be added to VMs in Proxmox cluster VirtualMachineRunningState = "running" VirtualMachineStoppedState = "stopped" // The timeout for qemu-agent to start in seconds AgentTimeoutSeconds = 10 )
Variables ¶
View Source
var ( // Create Proxmox client Client = CreateProxmoxClient() )
View Source
var (
ManagedVirtualMachineTag string
)
View Source
var (
ObserveInterval = 20 * time.Second
)
Functions ¶
func AgentIsRunning ¶
func CheckContainerDelta ¶ added in v0.1.1
func CheckContainerDelta(container *proxmoxv1alpha1.Container) (bool, error)
func CheckManagedVMDelta ¶ added in v0.1.1
func CheckManagedVMDelta(managedVM *proxmoxv1alpha1.ManagedVirtualMachine) ( bool, error)
func CheckManagedVMExists ¶
func CheckVMType ¶
func CheckVMType(vm *proxmoxv1alpha1.VirtualMachine) string
func CheckVirtualMachineDelta ¶ added in v0.1.1
func CheckVirtualMachineDelta(vm *proxmoxv1alpha1.VirtualMachine) (bool, error)
func CloneContainer ¶
func CloneContainer(container *proxmoxv1alpha1.Container) error
func ConfigureVirtualMachine ¶
func ConfigureVirtualMachine(vm *proxmoxv1alpha1.VirtualMachine) error
func ContainerExists ¶
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 CreateVMFromScratch ¶
func CreateVMFromScratch(vm *proxmoxv1alpha1.VirtualMachine)
func CreateVMFromTemplate ¶
func CreateVMFromTemplate(vm *proxmoxv1alpha1.VirtualMachine)
func CreateVMSnapshot ¶
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 GetContainer ¶
func GetContainerID ¶
func GetContainerState ¶
func GetDiskConfiguration ¶
func GetDiskConfiguration(vm *proxmoxv1alpha1.VirtualMachine) (map[string]string, error)
func GetManagedVMSpec ¶
func GetManagedVMs ¶
func GetManagedVMs() []string
func GetNetworkConfiguration ¶
func GetNodeOfVM ¶
func GetOnlineNodes ¶
func GetOnlineNodes() []string
func GetProxmoxVersion ¶
func GetStorageContent ¶
func GetStorageContent(node, storageName string) ([]*proxmox.StorageContent, error)
func GetVMIPAddress ¶
func GetVMSnapshots ¶
func GetVMState ¶
func GetVMUptime ¶
func HasFile ¶
func HasFile(storageContent []*proxmox.StorageContent, storageDownloadSpec *proxmoxv1alpha1.StorageDownloadURLSpec) bool
func RemoveVirtualMachineTag ¶
func RestartContainer ¶
func StartContainer ¶
func StartWatcher ¶ added in v0.1.1
func StartWatcher(ctx context.Context, resource Resource, stopChan chan struct{}, fetchResource FetchResourceFunc, updateStatus UpdateStatusFunc, checkDelta CheckDeltaFunc, handleAutoStart HandleAutoStartFunc, handleReconcile HandleReconcileFunc, deleteWatcher DeleteWatcherFunc) (ctrl.Result, error)
func StopContainer ¶
func StorageDownloadURL ¶
func StorageDownloadURL(node string, storageDownloadURLSpec *proxmoxv1alpha1.StorageDownloadURLSpec) (string, error)
func UpdateContainer ¶
func UpdateContainer(container *proxmoxv1alpha1.Container)
func UpdateContainerStatus ¶
func UpdateContainerStatus(containerName, nodeName string) proxmoxv1alpha1.QEMUStatus
func UpdateManagedVM ¶
func UpdateManagedVM(ctx context.Context, managedVM *proxmoxv1alpha1.ManagedVirtualMachine)
func UpdateVM ¶
func UpdateVM(vm *proxmoxv1alpha1.VirtualMachine) bool
func UpdateVMStatus ¶
func UpdateVMStatus(vmName, nodeName string) (*proxmoxv1alpha1.QEMUStatus, error)
func VMSnapshotExists ¶
Types ¶
type CheckDeltaFunc ¶ added in v0.1.1
type DeleteWatcherFunc ¶ added in v0.1.1
type DeleteWatcherFunc func(name string)
type ExternalWatchers ¶ added in v0.1.1
type ExternalWatchers struct { Watchers map[string]chan struct{} // contains filtered or unexported fields }
func NewExternalWatchers ¶ added in v0.1.1
func NewExternalWatchers() *ExternalWatchers
func (*ExternalWatchers) DeleteWatcher ¶ added in v0.1.1
func (e *ExternalWatchers) DeleteWatcher(name string)
type FetchResourceFunc ¶ added in v0.1.1
type HandleAutoStartFunc ¶ added in v0.1.1
type HandleReconcileFunc ¶ added in v0.1.1
type ProxmoxConfig ¶
type UpdateStatusFunc ¶ added in v0.1.1
type VirtualMachineComparison ¶ added in v0.1.1
type VirtualMachineComparison struct { Sockets int `json:"sockets"` Cores int `json:"cores"` Memory int `json:"memory"` Networks []proxmoxv1alpha1.VirtualMachineSpecTemplateNetwork Disks []proxmoxv1alpha1.VirtualMachineSpecTemplateDisk }
Click to show internal directories.
Click to hide internal directories.