vmutils

package
v61.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package vmutils provides convenience methods for creating Virtual Machine Role configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAzureDockerVMExtensionConfiguration

func AddAzureDockerVMExtensionConfiguration(role *vm.Role, dockerPort int, version string) error

AddAzureDockerVMExtensionConfiguration adds the DockerExtension to the role configuratioon and opens a port "dockerPort" TODO(ahmetalpbalkan) Deprecate this and move to 'docker-machine' codebase.

func AddAzureVMExtensionConfiguration

func AddAzureVMExtensionConfiguration(role *vm.Role, name, publisher, version, referenceName, state string,
	publicConfigurationValue, privateConfigurationValue []byte) error

func ConfigureDeploymentFromExistingOSDisk

func ConfigureDeploymentFromExistingOSDisk(role *vm.Role, osDiskName, label string) error

ConfigureDeploymentFromExistingOSDisk configures VM Role to deploy from an existing disk. 'label' is optional.

func ConfigureDeploymentFromPlatformImage

func ConfigureDeploymentFromPlatformImage(
	role *vm.Role,
	imageName string,
	mediaLink string,
	label string) error

ConfigureDeploymentFromPlatformImage configures VM Role to deploy from a platform image. See osimage package for methods to retrieve a list of the available platform images. "label" is optional.

func ConfigureDeploymentFromPublishedVMImage

func ConfigureDeploymentFromPublishedVMImage(
	role *vm.Role,
	vmImageName string,
	mediaLocation string,
	provisionGuestAgent bool) error

ConfigureDeploymentFromPublishedVMImage configures VM Role to deploy from a published (public) VM image.

func ConfigureDeploymentFromRemoteImage

func ConfigureDeploymentFromRemoteImage(
	role *vm.Role,
	remoteImageSourceURL string,
	os string,
	newDiskName string,
	destinationVhdStorageURL string,
	label string) error

ConfigureDeploymentFromRemoteImage configures VM Role to deploy from a remote image source. "remoteImageSourceURL" can be any publically accessible URL to a VHD file, including but not limited to a SAS Azure Storage blob url. "os" needs to be either "Linux" or "Windows". "label" is optional.

func ConfigureDeploymentFromUserVMImage

func ConfigureDeploymentFromUserVMImage(
	role *vm.Role,
	vmImageName string) error

ConfigureDeploymentFromUserVMImage configures VM Role to deploy from a previously captured (user generated) VM image.

func ConfigureForLinux

func ConfigureForLinux(role *vm.Role, hostname, user, password string, sshPubkeyCertificateThumbprint ...string) error

ConfigureForLinux adds configuration when deploying a generalized Linux image. If "password" is left empty, SSH password security will be disabled by default. Certificates with SSH public keys should already be uploaded to the cloud service where the VM will be deployed and referenced here only by their thumbprint.

func ConfigureForWindows

func ConfigureForWindows(role *vm.Role, hostname, user, password string, enableAutomaticUpdates bool, timeZone string) error

ConfigureForWindows adds configuration when deploying a generalized Windows image. timeZone can be left empty. For a complete list of supported time zone entries, you can either refer to the values listed in the registry entry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones" or you can use the tzutil command-line tool to list the valid time.

func ConfigureWinRMListener

func ConfigureWinRMListener(role *vm.Role, protocol vm.WinRMProtocol, certificateThumbprint string) error

func ConfigureWinRMOverHTTP

func ConfigureWinRMOverHTTP(role *vm.Role) error

func ConfigureWinRMOverHTTPS

func ConfigureWinRMOverHTTPS(role *vm.Role, certificateThumbprint string) error

func ConfigureWindowsToJoinDomain

func ConfigureWindowsToJoinDomain(role *vm.Role, username, password, domainToJoin, machineOU string) error

ConfigureWindowsToJoinDomain adds configuration to join a new Windows vm to a domain. "username" must be in UPN form (user@domain.com), "machineOU" can be left empty

func ConfigureWithCustomDataForLinux

func ConfigureWithCustomDataForLinux(role *vm.Role, customData string) error

ConfigureWithCustomDataForLinux configures custom data for Linux-based images. The customData contains either cloud-init or shell script to be executed upon start.

The function expects the customData to be base64-encoded.

func ConfigureWithCustomDataForWindows

func ConfigureWithCustomDataForWindows(role *vm.Role, customData string) error

ConfigureWithCustomDataForWindows configures custom data for Windows-based images. The customData contains either cloud-init or shell script to be executed upon start.

The function expects the customData to be base64-encoded.

func ConfigureWithExistingDataDisk

func ConfigureWithExistingDataDisk(role *vm.Role, diskName string, cachingType vmdisk.HostCachingType) error

ConfigureWithExistingDataDisk adds configuration for an existing data disk

func ConfigureWithExternalPort

func ConfigureWithExternalPort(role *vm.Role, name string, localport, externalport int, protocol vm.InputEndpointProtocol) error

ConfigureWithExternalPort adds a new InputEndpoint to the Role, exposing a port externally

func ConfigureWithNewDataDisk

func ConfigureWithNewDataDisk(role *vm.Role, label, destinationVhdStorageURL string, sizeInGB int, cachingType vmdisk.HostCachingType) error

ConfigureWithNewDataDisk adds configuration for a new (empty) data disk

func ConfigureWithPublicPowerShell

func ConfigureWithPublicPowerShell(role *vm.Role) error

ConfigureWithPublicPowerShell adds configuration exposing port 5986 externally

func ConfigureWithPublicRDP

func ConfigureWithPublicRDP(role *vm.Role) error

ConfigureWithPublicRDP adds configuration exposing port 3389 externally

func ConfigureWithPublicSSH

func ConfigureWithPublicSSH(role *vm.Role) error

ConfigureWithPublicSSH adds configuration exposing port 22 externally

func ConfigureWithSecurityGroup

func ConfigureWithSecurityGroup(role *vm.Role, networkSecurityGroup string) error

ConfigureWithSecurityGroup associates the Role with a specific network security group

func ConfigureWithSubnet

func ConfigureWithSubnet(role *vm.Role, subnet string) error

ConfigureWithSubnet associates the Role with a specific subnet

func ConfigureWithVhdDataDisk

func ConfigureWithVhdDataDisk(role *vm.Role, sourceVhdStorageURL string, cachingType vmdisk.HostCachingType) error

ConfigureWithVhdDataDisk adds configuration for adding a vhd in a storage account as a data disk

func IsRoleSizeAvailableInLocation

func IsRoleSizeAvailableInLocation(managementclient management.Client, location, roleSizeName string) (bool, error)

IsRoleSizeAvailableInLocation retrieves all available sizes in the specified location and returns whether that the provided roleSizeName is part of that list.

func IsRoleSizeValid

func IsRoleSizeValid(vmclient vm.VirtualMachineClient, roleSizeName string) (bool, error)

IsRoleSizeValid retrieves the available rolesizes using vmclient.GetRoleSizeList() and returns whether that the provided roleSizeName is part of that list

func NewVMConfiguration

func NewVMConfiguration(name string, roleSize string) vm.Role

NewVMConfiguration creates configuration for a new virtual machine Role.

func WaitForDeploymentInstanceStatus

func WaitForDeploymentInstanceStatus(client management.Client, cloudServiceName, deploymentName string, desiredInstanceStatus vm.InstanceStatus) error

WaitForDeploymentInstanceStatus blocks until all role instances in deployment reach desired InstanceStatus.

func WaitForDeploymentPowerState

func WaitForDeploymentPowerState(client management.Client, cloudServiceName, deploymentName string, desiredPowerstate vm.PowerState) error

WaitForDeploymentPowerState blocks until all role instances in deployment reach desired power state.

Types

This section is empty.

Jump to

Keyboard shortcuts

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