vmlifecycle

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OvfEnvironmentTransportGuestInfo is the OVF transport type that uses
	// GuestInfo. The other valid type is "iso".
	OvfEnvironmentTransportGuestInfo = "com.vmware.guestInfo"
)

Variables

This section is empty.

Functions

func CreateVirtualMachine

func CreateVirtualMachine(
	vmCtx context.VirtualMachineContextA2,
	clClient contentlibrary.Provider,
	restClient *rest.Client,
	finder *find.Finder,
	createArgs *CreateArgs) (*types.ManagedObjectReference, error)

func DoBootstrap

func DoBootstrap(
	vmCtx context.VirtualMachineContextA2,
	vcVM *object.VirtualMachine,
	config *vimTypes.VirtualMachineConfigInfo,
	k8sClient ctrl.Client,
	networkResults network.NetworkInterfaceResults,
	bootstrapData BootstrapData) error

func GetCloudInitGuestInfoCustSpec

func GetCloudInitGuestInfoCustSpec(
	config *types.VirtualMachineConfigInfo,
	metadata, userdata string) (*types.VirtualMachineConfigSpec, error)

func GetCloudInitMetadata

func GetCloudInitMetadata(
	uid string,
	hostname string,
	netplan *network.Netplan,
	sshPublicKeys string) (string, error)

func GetCloudInitPrepCustSpec

func GetCloudInitPrepCustSpec(
	metadata, userdata string) (*types.VirtualMachineConfigSpec, *types.CustomizationSpec, error)

func GetMergedvAppConfigSpec

func GetMergedvAppConfigSpec(inProps map[string]string, vmProps []vimTypes.VAppPropertyInfo) *vimTypes.VmConfigSpec

GetMergedvAppConfigSpec prepares a vApp VmConfigSpec which will set the provided key/value fields. Only fields marked userConfigurable and pre-existing on the VM (ie. originated from the OVF Image) will be set, and all others will be ignored.

func GetOVFVAppConfigForConfigSpec

func GetOVFVAppConfigForConfigSpec(
	config *vimTypes.VirtualMachineConfigInfo,
	vAppConfigSpec *vmopv1.VirtualMachineBootstrapVAppConfigSpec,
	vAppData map[string]string,
	vAppExData map[string]map[string]string,
	templateRenderFn TemplateRenderFunc) vimTypes.BaseVmConfigSpec

func IsCustomizationPendingExtraConfig

func IsCustomizationPendingExtraConfig(extraConfig []vimTypes.BaseOptionValue) bool

func MarkCustomizationInfoCondition

func MarkCustomizationInfoCondition(vm *vmopv1.VirtualMachine, guestInfo *types.GuestInfo)

func MarkVMToolsRunningStatusCondition

func MarkVMToolsRunningStatusCondition(
	vm *vmopv1.VirtualMachine,
	guestInfo *types.GuestInfo)

func UpdateStatus

func UpdateStatus(
	vmCtx context.VirtualMachineContextA2,
	k8sClient ctrlclient.Client,
	vcVM *object.VirtualMachine,
	vmMO *mo.VirtualMachine) error

Types

type BootstrapArgs

type BootstrapArgs struct {
	BootstrapData

	TemplateRenderFn TemplateRenderFunc
	NetworkResults   network.NetworkInterfaceResults
	Hostname         string
	DNSServers       []string
	SearchSuffixes   []string
}

type BootstrapData

type BootstrapData struct {
	Data       map[string]string
	VAppData   map[string]string
	VAppExData map[string]map[string]string

	CloudConfig *cloudinit.CloudConfigSecretData
}

type CloudInitMetadata

type CloudInitMetadata struct {
	InstanceID    string          `yaml:"instance-id,omitempty"`
	LocalHostname string          `yaml:"local-hostname,omitempty"`
	Hostname      string          `yaml:"hostname,omitempty"`
	Network       network.Netplan `yaml:"network,omitempty"`
	PublicKeys    string          `yaml:"public-keys,omitempty"`
}

type CreateArgs

type CreateArgs struct {
	UseContentLibrary bool
	ProviderItemID    string

	ConfigSpec          *types.VirtualMachineConfigSpec
	StorageProvisioning string
	FolderMoID          string
	ResourcePoolMoID    string
	HostMoID            string
	StorageProfileID    string
	DatastoreMoID       string // gce2e only: used only if StorageProfileID is unset
}

CreateArgs contains the arguments needed to create a VM.

type TemplateRenderFunc

type TemplateRenderFunc func(string, string) string

func GetTemplateRenderFunc

func GetTemplateRenderFunc(
	vmCtx context.VirtualMachineContextA2,
	bsArgs *BootstrapArgs,
) TemplateRenderFunc

Jump to

Keyboard shortcuts

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