Interface VirtualMachine

All Superinterfaces:
com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource<ComputeManager, VirtualMachineInner>, com.azure.resourcemanager.resources.fluentcore.arm.models.HasId, com.azure.resourcemanager.resources.fluentcore.model.HasInnerModel<VirtualMachineInner>, com.azure.resourcemanager.resources.fluentcore.arm.models.HasManager<ComputeManager>, com.azure.resourcemanager.resources.fluentcore.arm.models.HasName, com.azure.resourcemanager.network.models.HasNetworkInterfaces, com.azure.resourcemanager.resources.fluentcore.arm.models.HasResourceGroup, com.azure.resourcemanager.resources.fluentcore.model.Indexable, com.azure.resourcemanager.resources.fluentcore.model.Refreshable<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.arm.models.Resource, com.azure.resourcemanager.resources.fluentcore.model.Updatable<VirtualMachine.Update>

public interface VirtualMachine extends com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource<ComputeManager, VirtualMachineInner>, com.azure.resourcemanager.resources.fluentcore.model.Refreshable<VirtualMachine>, com.azure.resourcemanager.resources.fluentcore.model.Updatable<VirtualMachine.Update>, com.azure.resourcemanager.network.models.HasNetworkInterfaces
An immutable client-side representation of an Azure virtual machine.
  • Method Details

    • deallocate

      void deallocate()
      Shuts down the virtual machine and releases the compute resources.
    • deallocateAsync

      Mono<Void> deallocateAsync()
      Shuts down the virtual machine and releases the compute resources asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • deallocate

      void deallocate(boolean hibernate)
      Shuts down the virtual machine and releases the compute resources.
      Parameters:
      hibernate - hibernate the virtual machine
    • deallocateAsync

      Mono<Void> deallocateAsync(boolean hibernate)
      Shuts down the virtual machine and releases the compute resources asynchronously.
      Parameters:
      hibernate - hibernate the virtual machine
      Returns:
      a representation of the deferred computation of this call
    • generalize

      void generalize()
      Generalizes the virtual machine.
    • generalizeAsync

      Mono<Void> generalizeAsync()
      Generalizes the virtual machine asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • powerOff

      void powerOff()
      Powers off (stops) the virtual machine.
    • powerOffAsync

      Mono<Void> powerOffAsync()
      Powers off (stops) the virtual machine asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • powerOff

      void powerOff(boolean skipShutdown)
      Stops the virtual machine.
      Parameters:
      skipShutdown - power off without graceful shutdown
    • powerOffAsync

      Mono<Void> powerOffAsync(boolean skipShutdown)
      Stops the virtual machine.
      Parameters:
      skipShutdown - power off without graceful shutdown
      Returns:
      a representation of the deferred computation of this call.
    • restart

      void restart()
      Restarts the virtual machine.
    • restartAsync

      Mono<Void> restartAsync()
      Restarts the virtual machine asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • start

      void start()
      Starts the virtual machine.
    • startAsync

      Mono<Void> startAsync()
      Starts the virtual machine asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • redeploy

      void redeploy()
      Redeploys the virtual machine.
    • redeployAsync

      Mono<Void> redeployAsync()
      Redeploys the virtual machine asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • simulateEviction

      void simulateEviction()
      Simulates the eviction of spot virtual machine. The eviction will occur with 30 minutes after calling this API.
    • simulateEvictionAsync

      Mono<Void> simulateEvictionAsync()
      Simulates the eviction of spot virtual machine asynchronously. The eviction will occur with 30 minutes after calling this API.
      Returns:
      a representation of the deferred computation of this call
    • diskEncryption

      VirtualMachineEncryption diskEncryption()
      Gets entry point to enabling, disabling and querying disk encryption.
      Returns:
      entry point to enabling, disabling and querying disk encryption
    • convertToManaged

      void convertToManaged()
      Converts (migrates) the virtual machine with un-managed disks to use managed disk.
    • convertToManagedAsync

      Mono<Void> convertToManagedAsync()
      Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.
      Returns:
      a representation of the deferred computation of this call
    • availableSizes

      com.azure.core.http.rest.PagedIterable<VirtualMachineSize> availableSizes()
      Lists all available virtual machine sizes this virtual machine can resized to.
      Returns:
      the virtual machine sizes
    • capture

      String capture(String containerName, String vhdPrefix, boolean overwriteVhd)
      Captures the virtual machine by copying virtual hard disks of the VM.
      Parameters:
      containerName - destination container name to store the captured VHD
      vhdPrefix - the prefix for the VHD holding captured image
      overwriteVhd - whether to overwrites destination VHD if it exists
      Returns:
      the JSON template for creating more such virtual machines
    • captureAsync

      Mono<String> captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd)
      Captures the virtual machine by copying virtual hard disks of the VM asynchronously.
      Parameters:
      containerName - destination container name to store the captured VHD
      vhdPrefix - the prefix for the VHD holding captured image
      overwriteVhd - whether to overwrites destination VHD if it exists
      Returns:
      a representation of the deferred computation of this call
    • refreshInstanceView

      VirtualMachineInstanceView refreshInstanceView()
      Refreshes the virtual machine instance view to sync with Azure.

      The instance view will be cached for later retrieval using instanceView.

      Returns:
      the refreshed instance view
    • refreshInstanceViewAsync

      Mono<VirtualMachineInstanceView> refreshInstanceViewAsync()
      Refreshes the virtual machine instance view to sync with Azure.
      Returns:
      an observable that emits the instance view of the virtual machine.
    • runPowerShellScript

      RunCommandResult runPowerShellScript(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
      Run shell script in a virtual machine.
      Parameters:
      scriptLines - PowerShell script lines
      scriptParameters - script parameters
      Returns:
      result of PowerShell script execution
    • runPowerShellScriptAsync

      Mono<RunCommandResult> runPowerShellScriptAsync(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
      Run shell script in the virtual machine asynchronously.
      Parameters:
      scriptLines - PowerShell script lines
      scriptParameters - script parameters
      Returns:
      handle to the asynchronous execution
    • runShellScript

      RunCommandResult runShellScript(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
      Run shell script in the virtual machine.
      Parameters:
      scriptLines - shell script lines
      scriptParameters - script parameters
      Returns:
      result of shell script execution
    • runShellScriptAsync

      Mono<RunCommandResult> runShellScriptAsync(List<String> scriptLines, List<RunCommandInputParameter> scriptParameters)
      Run shell script in the virtual machine asynchronously.
      Parameters:
      scriptLines - shell script lines
      scriptParameters - script parameters
      Returns:
      handle to the asynchronous execution
    • runCommand

      RunCommandResult runCommand(RunCommandInput inputCommand)
      Run commands in the virtual machine.
      Parameters:
      inputCommand - command input
      Returns:
      result of execution
    • runCommandAsync

      Mono<RunCommandResult> runCommandAsync(RunCommandInput inputCommand)
      Run commands in the virtual machine asynchronously.
      Parameters:
      inputCommand - command input
      Returns:
      handle to the asynchronous execution
    • isManagedDiskEnabled

      boolean isManagedDiskEnabled()
      Checks whether managed disks are used for the virtual machine's disks (OS, data).
      Returns:
      true if managed disks are used for the virtual machine's disks (OS, data)
    • computerName

      String computerName()
      Gets name of this virtual machine.
      Returns:
      name of this virtual machine
    • size

      Gets the virtual machine size.
      Returns:
      the virtual machine size
    • osType

      Gets the operating system of this virtual machine.
      Returns:
      the operating system of this virtual machine
    • osUnmanagedDiskVhdUri

      String osUnmanagedDiskVhdUri()
      Gets the URI to the VHD file backing this virtual machine's operating system disk.
      Returns:
      the URI to the VHD file backing this virtual machine's operating system disk
    • osDiskCachingType

      CachingTypes osDiskCachingType()
      Gets the operating system disk caching type.
      Returns:
      the operating system disk caching type
    • osDiskSize

      int osDiskSize()
      Gets the size of the operating system disk in GB.
      Returns:
      the size of the operating system disk in GB
    • osDiskStorageAccountType

      StorageAccountTypes osDiskStorageAccountType()
      Gets the storage account type of the managed disk backing OS disk.
      Returns:
      the storage account type of the managed disk backing OS disk
    • osDiskId

      String osDiskId()
      Gets resource ID of the managed disk backing the OS disk.
      Returns:
      resource ID of the managed disk backing the OS disk
    • osDiskDeleteOptions

      DeleteOptions osDiskDeleteOptions()
      Gets the delete options of the OS disk.
      Returns:
      the delete options of the OS disk
    • osDiskDiskEncryptionSetId

      String osDiskDiskEncryptionSetId()
      Gets resource ID of the disk encryption set of the OS disk.
      Returns:
      resource ID of the disk encryption set of the OS disk
    • isOsDiskWriteAcceleratorEnabled

      boolean isOsDiskWriteAcceleratorEnabled()
      Gets whether the write accelerator is enabled.
      Returns:
      whether the write accelerator is enabled
    • isOSDiskEphemeral

      boolean isOSDiskEphemeral()
      Checks whether the os disk is ephemeral.
      Returns:
      whether the os disk is ephemeral
    • isEncryptionAtHost

      boolean isEncryptionAtHost()
      Checks whether encryption at host.
      Returns:
      whether encryption at host
    • unmanagedDataDisks

      Gets the unmanaged data disks associated with this virtual machine, indexed by LUN number.
      Returns:
      the unmanaged data disks associated with this virtual machine, indexed by LUN number
    • dataDisks

      Gets the managed data disks associated with this virtual machine, indexed by LUN.
      Returns:
      the managed data disks associated with this virtual machine, indexed by LUN
    • getPrimaryPublicIPAddress

      com.azure.resourcemanager.network.models.PublicIpAddress getPrimaryPublicIPAddress()
      Gets the public IP address associated with this virtual machine's primary network interface.

      Note that this method makes a rest API call to fetch the resource.

      Returns:
      the public IP of the primary network interface
    • getPrimaryPublicIPAddressId

      String getPrimaryPublicIPAddressId()
      Gets the resource ID of the public IP address associated with this virtual machine's primary network interface.
      Returns:
      the resource ID of the public IP address associated with this virtual machine's primary network interface
    • availabilitySetId

      String availabilitySetId()
      Gets the resource ID of the availability set associated with this virtual machine.
      Returns:
      the resource ID of the availability set associated with this virtual machine
    • virtualMachineScaleSetId

      String virtualMachineScaleSetId()
      Gets the resource ID of the virtual machine scale set associated with this virtual machine.
      Returns:
      the resource ID of the virtual machine scale set associated with this virtual machine
    • provisioningState

      String provisioningState()
      Gets the provisioningState value.
      Returns:
      the provisioningState value
    • licenseType

      String licenseType()
      Gets the licenseType value.
      Returns:
      the licenseType value
    • proximityPlacementGroup

      ProximityPlacementGroup proximityPlacementGroup()
      Get specifies information about the proximity placement group that the virtual machine scale set should be assigned to.
      Returns:
      the proximityPlacementGroup.
    • listExtensionsAsync

      Mono<List<VirtualMachineExtension>> listExtensionsAsync()
      Gets extensions attached to the virtual machine.
      Returns:
      a representation of the deferred computation of this call, returning extensions attached to the virtual machine
    • listExtensions

      Map<String, VirtualMachineExtension> listExtensions()
      Gets extensions attached to the virtual machine.
      Returns:
      extensions attached to the virtual machine
    • plan

      Plan plan()
      Gets the plan value.
      Returns:
      the plan value
    • storageProfile

      StorageProfile storageProfile()
      Returns the storage profile of an Azure virtual machine.
      Returns:
      the storageProfile value
    • osProfile

      OSProfile osProfile()
      Gets the operating system profile.
      Returns:
      the operating system profile
    • diagnosticsProfile

      DiagnosticsProfile diagnosticsProfile()
      Gets the diagnostics profile.
      Returns:
      the diagnostics profile
    • vmId

      String vmId()
      Gets the virtual machine unique ID.
      Returns:
      the virtual machine unique ID.
    • powerState

      PowerState powerState()
      Gets the power state of the virtual machine.
      Returns:
      the power state of the virtual machine
    • instanceView

      Get the virtual machine instance view.

      The instance view will be cached for later retrieval using instanceView.

      Returns:
      the virtual machine's instance view
    • availabilityZones

      Set<com.azure.resourcemanager.resources.fluentcore.arm.AvailabilityZoneId> availabilityZones()
      Gets the availability zones assigned to the virtual machine.
      Returns:
      the availability zones assigned to the virtual machine
    • isBootDiagnosticsEnabled

      boolean isBootDiagnosticsEnabled()
      Checks whether boot diagnostics is enabled for the virtual machine.
      Returns:
      true if boot diagnostics is enabled for the virtual machine
    • bootDiagnosticsStorageUri

      String bootDiagnosticsStorageUri()
      Gets the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine.
      Returns:
      the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine
    • isManagedServiceIdentityEnabled

      boolean isManagedServiceIdentityEnabled()
      Checks whether Managed Service Identity is enabled for the virtual machine.
      Returns:
      true if Managed Service Identity is enabled for the virtual machine
    • systemAssignedManagedServiceIdentityTenantId

      String systemAssignedManagedServiceIdentityTenantId()
      Gets System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the virtual machine.
      Returns:
      the System Assigned (Local) Managed Service Identity specific Active Directory tenant ID assigned to the virtual machine.
    • systemAssignedManagedServiceIdentityPrincipalId

      String systemAssignedManagedServiceIdentityPrincipalId()
      Gets the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID assigned to the virtual machine.
      Returns:
      the System Assigned (Local) Managed Service Identity specific Active Directory service principal ID assigned to the virtual machine.
    • managedServiceIdentityType

      ResourceIdentityType managedServiceIdentityType()
      Gets the type of Managed Service Identity used for the virtual machine.
      Returns:
      the type of Managed Service Identity used for the virtual machine.
    • userAssignedManagedServiceIdentityIds

      Set<String> userAssignedManagedServiceIdentityIds()
      Gets the resource ids of User Assigned Managed Service Identities associated with the virtual machine.
      Returns:
      the resource ids of User Assigned Managed Service Identities associated with the virtual machine.
    • priority

      Gets the priority for the virtual machine.
      Returns:
      the priority for the virtual machine.
    • evictionPolicy

      Gets the eviction policy for the virtual machine.
      Returns:
      the eviction policy for the virtual machine.
    • billingProfile

      BillingProfile billingProfile()
      Gets the billing related details of a low priority virtual machine.
      Returns:
      the billing related details of a low priority virtual machine
    • isHibernationEnabled

      boolean isHibernationEnabled()
      Checks whether hibernation feature is enabled on the virtual machine.
      Returns:
      true if hibernation feature is enabled on the virtual machine.
    • isUltraSsdEnabled

      boolean isUltraSsdEnabled()
      Checks whether ultra SSD feature is enabled.
      Returns:
      true if ultra SSD feature is enabled on the virtual machine.
    • securityType

      SecurityTypes securityType()
      Gets the SecurityTypes of the virtual machine.
      Returns:
      the SecurityTypes of the virtual machine
    • isSecureBootEnabled

      boolean isSecureBootEnabled()
      Checks whether secure boot is enabled on the virtual machine
      Returns:
      whether secure boot is enabled on the virtual machine
    • isVTpmEnabled

      boolean isVTpmEnabled()
      Checks whether vTPM is enabled on the virtual machine.
      Returns:
      whether vTPM is enabled on the virtual machine
    • timeCreated

      OffsetDateTime timeCreated()
      Gets the time at which the Virtual Machine resource was created.
      Returns:
      the time at which the Virtual Machine resource was created
    • primaryNetworkInterfaceDeleteOptions

      DeleteOptions primaryNetworkInterfaceDeleteOptions()
      Gets the delete options for the primary network interface.
      Returns:
      the delete options for the primary network interface
    • networkInterfaceDeleteOptions

      DeleteOptions networkInterfaceDeleteOptions(String networkInterfaceId)
      Gets the delete options for the given network interface.
      Parameters:
      networkInterfaceId - resource ID of the network interface
      Returns:
      the delete options for the network interface
    • userData

      String userData()
      Gets the base64 encoded user data for the virtual machine.
      Returns:
      the base64 encoded user data for the virtual machine.
    • capacityReservationGroupId

      String capacityReservationGroupId()
      Gets resource id of capacity reservation group for the virtual machine.
      Returns:
      the resource id of capacity reservation group for the virtual machine.