disk

package
v0.57.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MPL-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// MkDisk is the name of the disk resource.
	MkDisk = "disk"
)

Variables

This section is empty.

Functions

func CreateClone

func CreateClone(
	ctx context.Context,
	d *schema.ResourceData,
	planDisks map[string]vms.CustomStorageDevices,
	allDiskInfo vms.CustomStorageDevices,
	vmAPI *vms.Client,
) error

CreateClone creates disks for a cloned VM.

func CreateCustomDisks

func CreateCustomDisks(
	ctx context.Context,
	client proxmox.Client,
	nodeName string,
	vmID int,
	storageDevices map[string]vms.CustomStorageDevices,
) diag.Diagnostics

CreateCustomDisks creates custom disks for a VM.

func DigitPrefix

func DigitPrefix(s string) string

DigitPrefix returns the prefix of a string that is not a digit.

func GetDiskDeviceObjects

func GetDiskDeviceObjects(
	d *schema.ResourceData,
	resource *schema.Resource,
	disks []interface{},
) (map[string]vms.CustomStorageDevices, error)

GetDiskDeviceObjects returns a map of disk devices for a VM.

func GetInfo

GetInfo returns the disk information for a VM.

func Read

func Read(
	ctx context.Context,
	d *schema.ResourceData,
	diskObjects vms.CustomStorageDevices,
	vmID int,
	api proxmox.Client,
	nodeName string,
	isClone bool,
) diag.Diagnostics

Read reads the disk configuration of a VM.

func Schema

func Schema() map[string]*schema.Schema

Schema returns the schema for the disk resource.

func Update

func Update(
	d *schema.ResourceData,
	planDisks map[string]vms.CustomStorageDevices,
	allDiskInfo vms.CustomStorageDevices,
	updateBody *vms.UpdateRequestBody,
) (bool, error)

Update updates the disk configuration of a VM.

Types

This section is empty.

Jump to

Keyboard shortcuts

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