# Functions
CanUpdateVirtualMachine checks if the VM is not in terminal state and if there are no data disks marked for detachment.
CheckAndDeleteLeftoverNICsAndDisks creates tasks for NIC and DISK deletion and runs them concurrently.
ConstructCreateMachineResponse constructs response for driver.CreateMachine method.
ConstructGetMachineStatusResponse constructs response for driver.GetMachineStatus method.
ConstructMachineListResponse constructs response for driver.ListMachines method.
CreateNICIfNotExists creates a NIC if it does not exist.
CreateVM gathers the VM creation parameters and invokes a call to create or update the VM.
DecodeAndValidateMachineClassProviderSpec decodes v1alpha1.MachineClass.ProviderSpec.Raw into api.AzureProviderSpec.
DeleteVirtualMachine deletes the VirtualMachine, if there is any error it will wrap it into a status.Status error.
DeriveInstanceID creates an instance ID from location and VM name.
DetermineAzureCloudConfiguration returns the Azure cloud.Configuration corresponding to the instance given by the provided api.Configuration.
ExtractCredentialsFromData extracts and trims a value from the given data map.
ExtractProviderSpecAndConnectConfig extracts api.AzureProviderSpec from mcc and access.ConnectConfig from secret.
ExtractVMNamesFromVMsNICsDisks leverages resource graph to extract names from VMs, NICs and Disks (OS and Data disks).
GetDiskNames creates disk names for all configured OSDisk and DataDisk in the provider spec.
GetSubnet gets the subnet for the subnet configuration in the provider config.
IsVirtualMachineInTerminalState checks if the provisioningState of the VM is set to Failed.
LogVMCreation is a convenience method which helps to extract relevant details from the created virtual machine and logs it.
ProcessVMImageConfiguration gets the image configuration from provider spec.
SkipDeleteMachine checks if ResourceGroup exists.
UpdateCascadeDeleteOptions updates the VirtualMachine properties and sets cascade delete options for NIC and DISKs if it is not already set.
ValidateSecretAndCreateConnectConfig validates the secret and creates an instance of azure.ConnectConfig out of it.