Documentation ¶
Index ¶
- Constants
- Variables
- func BootStrapCloudInit(vmCtx context.VirtualMachineContextA2, config *types.VirtualMachineConfigInfo, ...) (*types.VirtualMachineConfigSpec, *types.CustomizationSpec, error)
- func BootStrapLinuxPrep(ctx goctx.Context, config *vimTypes.VirtualMachineConfigInfo, ...) (*vimTypes.VirtualMachineConfigSpec, *vimTypes.CustomizationSpec, error)
- func BootstrapSysPrep(_ goctx.Context, config *vimTypes.VirtualMachineConfigInfo, ...) (*vimTypes.VirtualMachineConfigSpec, *vimTypes.CustomizationSpec, error)
- func BootstrapVAppConfig(_ goctx.Context, config *vimTypes.VirtualMachineConfigInfo, ...) (*vimTypes.VirtualMachineConfigSpec, *vimTypes.CustomizationSpec, error)
- func CreateVirtualMachine(vmCtx context.VirtualMachineContextA2, clClient contentlibrary.Provider, ...) (*types.ManagedObjectReference, error)
- func DoBootstrap(vmCtx context.VirtualMachineContextA2, vcVM *object.VirtualMachine, ...) error
- func GetCloudInitGuestInfoCustSpec(config *types.VirtualMachineConfigInfo, metadata, userdata string) (*types.VirtualMachineConfigSpec, error)
- func GetCloudInitMetadata(uid string, hostname string, netplan *network.Netplan, sshPublicKeys string) (string, error)
- func GetCloudInitPrepCustSpec(config *types.VirtualMachineConfigInfo, metadata, userdata string) (*types.VirtualMachineConfigSpec, *types.CustomizationSpec, error)
- func GetMergedvAppConfigSpec(inProps map[string]string, vmProps []vimTypes.VAppPropertyInfo) *vimTypes.VmConfigSpec
- func GetOVFVAppConfigForConfigSpec(config *vimTypes.VirtualMachineConfigInfo, ...) vimTypes.BaseVmConfigSpec
- func IsCustomizationPendingExtraConfig(extraConfig []vimTypes.BaseOptionValue) bool
- func MarkBootstrapCondition(vm *vmopv1.VirtualMachine, configInfo *types.VirtualMachineConfigInfo)
- func MarkCustomizationInfoCondition(vm *vmopv1.VirtualMachine, guestInfo *types.GuestInfo)
- func MarkVMToolsRunningStatusCondition(vm *vmopv1.VirtualMachine, guestInfo *types.GuestInfo)
- func UpdateNetworkStatusConfig(vm *vmopv1.VirtualMachine, args BootstrapArgs)
- func UpdateStatus(vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client, ...) error
- type BootstrapArgs
- type BootstrapData
- type CloudInitMetadata
- type CreateArgs
- type TemplateRenderFunc
Constants ¶
const ( // OvfEnvironmentTransportGuestInfo is the OVF transport type that uses // GuestInfo. The other valid type is "iso". OvfEnvironmentTransportGuestInfo = "com.vmware.guestInfo" )
Variables ¶
var CloudInitUserDataSecretKeys = []string{"user-data", "value"}
CloudInitUserDataSecretKeys are the Secret keys that in v1a1 we'd check for the userdata. Specifically, CAPBK uses "value" for its key, while "user-data" is the preferred key nowadays. The 'value' key lookup will eventually be deprecated.
var ( // VMStatusPropertiesSelector is the minimum properties needed to be retrieved in order to populate // the Status. Callers may provide a MO with more. This often saves us a second round trip in the // common steady state. VMStatusPropertiesSelector = []string{ "config.changeTrackingEnabled", "config.extraConfig", "guest", "summary", } )
Functions ¶
func BootStrapCloudInit ¶
func BootStrapCloudInit( vmCtx context.VirtualMachineContextA2, config *types.VirtualMachineConfigInfo, cloudInitSpec *vmopv1.VirtualMachineBootstrapCloudInitSpec, bsArgs *BootstrapArgs) (*types.VirtualMachineConfigSpec, *types.CustomizationSpec, error)
func BootStrapLinuxPrep ¶
func BootStrapLinuxPrep( ctx goctx.Context, config *vimTypes.VirtualMachineConfigInfo, linuxPrepSpec *vmopv1.VirtualMachineBootstrapLinuxPrepSpec, vAppConfigSpec *vmopv1.VirtualMachineBootstrapVAppConfigSpec, bsArgs *BootstrapArgs) (*vimTypes.VirtualMachineConfigSpec, *vimTypes.CustomizationSpec, error)
func BootstrapSysPrep ¶
func BootstrapSysPrep( _ goctx.Context, config *vimTypes.VirtualMachineConfigInfo, sysPrepSpec *vmopv1.VirtualMachineBootstrapSysprepSpec, vAppConfigSpec *vmopv1.VirtualMachineBootstrapVAppConfigSpec, bsArgs *BootstrapArgs) (*vimTypes.VirtualMachineConfigSpec, *vimTypes.CustomizationSpec, error)
func BootstrapVAppConfig ¶
func BootstrapVAppConfig( _ goctx.Context, config *vimTypes.VirtualMachineConfigInfo, vAppConfigSpec *vmopv1.VirtualMachineBootstrapVAppConfigSpec, bsArgs *BootstrapArgs) (*vimTypes.VirtualMachineConfigSpec, *vimTypes.CustomizationSpec, error)
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, bootstrapArgs BootstrapArgs) error
func GetCloudInitGuestInfoCustSpec ¶
func GetCloudInitGuestInfoCustSpec( config *types.VirtualMachineConfigInfo, metadata, userdata string) (*types.VirtualMachineConfigSpec, error)
func GetCloudInitMetadata ¶
func GetCloudInitPrepCustSpec ¶
func GetCloudInitPrepCustSpec( config *types.VirtualMachineConfigInfo, 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 MarkBootstrapCondition ¶ added in v1.8.6
func MarkBootstrapCondition( vm *vmopv1.VirtualMachine, configInfo *types.VirtualMachineConfigInfo)
func MarkCustomizationInfoCondition ¶
func MarkCustomizationInfoCondition(vm *vmopv1.VirtualMachine, guestInfo *types.GuestInfo)
func MarkVMToolsRunningStatusCondition ¶
func MarkVMToolsRunningStatusCondition( vm *vmopv1.VirtualMachine, guestInfo *types.GuestInfo)
func UpdateNetworkStatusConfig ¶ added in v1.8.6
func UpdateNetworkStatusConfig(vm *vmopv1.VirtualMachine, args BootstrapArgs)
UpdateNetworkStatusConfig updates the provided VM's status.network.config field with information from the provided bootstrap arguments. This is useful for folks booting VMs without bootstrap engines who may wish to manually configure the VM's networking with the valid IP configuration for this VM.
func UpdateStatus ¶
func UpdateStatus( vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client, vcVM *object.VirtualMachine, moVM *mo.VirtualMachine) error
Types ¶
type BootstrapArgs ¶
type BootstrapArgs struct { BootstrapData TemplateRenderFn TemplateRenderFunc NetworkResults network.NetworkInterfaceResults Hostname string DNSServers []string SearchSuffixes []string }
func GetBootstrapArgs ¶ added in v1.8.6
func GetBootstrapArgs( ctx context.VirtualMachineContextA2, k8sClient ctrl.Client, networkResults network.NetworkInterfaceResults, bootstrapData BootstrapData) (BootstrapArgs, error)
GetBootstrapArgs returns the information used to bootstrap the VM via one of the many, possible bootstrap engines.
type BootstrapData ¶
type CloudInitMetadata ¶
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 ¶
func GetTemplateRenderFunc ¶
func GetTemplateRenderFunc( vmCtx context.VirtualMachineContextA2, bsArgs *BootstrapArgs, ) TemplateRenderFunc