moclibvirt

package
v0.10.1-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateVirtualMachine

func CreateVirtualMachine(conn *libvirt.Connect, vmName, macAddress, vnicID, vhdPath string, size vmsize.VmSize) error

CreateVirtualMachine: Creates a vm using the specified params using libvirt.

func StoragePoolActivate

func StoragePoolActivate(pool *libvirt.StoragePool) (err error)

Activates a storage pool if it is inactive (building the pool if necessary) and ensures that auto-start is enabled on the pool.

func StoragePoolArrayFree

func StoragePoolArrayFree(pools []libvirt.StoragePool)

Calls Free() on all the storage pools in a slice.

func StoragePoolCreateName

func StoragePoolCreateName(conn *libvirt.Connect, baseName string) string

Tries to find a unique name for a storage pool. If provided base name isn't available, then "-X" is appended where X is the smallest natural number that produces a unique name.

func StoragePoolDeactivate

func StoragePoolDeactivate(pool *libvirt.StoragePool) (err error)

Deactivates a storage pool if it is active.

func StoragePoolDirectoryDefine

func StoragePoolDirectoryDefine(conn *libvirt.Connect, poolName string, directoryPath string) (pool *libvirt.StoragePool, err error)

Creates a basic directory backed storage pool.

func StoragePoolDirectoryDefineWithAutoName

func StoragePoolDirectoryDefineWithAutoName(conn *libvirt.Connect, directoryPath string) (pool *libvirt.StoragePool, err error)

Automatically generates a name for a storage pool and then creates it.

func StoragePoolDirectoryGetAndActivate

func StoragePoolDirectoryGetAndActivate(conn *libvirt.Connect, directoryPath string) (pool *libvirt.StoragePool, isNew bool, err error)

Gets a storage pool for a file directory and ensure it has been activated and auto-start is enabled. If a storage pool already exists, then it is returned. Otherwise, one is created.

func StoragePoolDirectoryLookup

func StoragePoolDirectoryLookup(conn *libvirt.Connect, directoryPath string) (pool *libvirt.StoragePool, err error)

Searches for an existing directory storage pool (inactive or active) for a file directory. Returns nil if none is found.

func StoragePoolFree

func StoragePoolFree(pool *libvirt.StoragePool)

Nil checks a storage pool before calling Free() on it.

func StoragePoolRemove

func StoragePoolRemove(pool *libvirt.StoragePool) (err error)

Tries to remove a storage pool. This includes attempting to stop the storage pool before removing it.

func StoragePoolRemoveIfEmpty

func StoragePoolRemoveIfEmpty(pool *libvirt.StoragePool) (err error)

If the storage pool is empty, then remove it.

func StorageVolumeCreate

func StorageVolumeCreate(conn *libvirt.Connect, pool *libvirt.StoragePool, name string, size uint64, dynamicSize bool) (vol *libvirt.StorageVol, err error)

Creates a new raw file storage volume.

func StorageVolumeGet

func StorageVolumeGet(conn *libvirt.Connect, pool *libvirt.StoragePool, name string, size uint64, dynamicSize bool) (vol *libvirt.StorageVol, isNew bool, err error)

Attempts to retrieve an existing storage volume. If it doesn't exist, then a new one is created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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