Compartir vía


VirtualMachine Interface

public interface VirtualMachine extends GroupableResource<ComputeManager, VirtualMachineInner>,Refreshable,Updatable<VirtualMachine.Update>,HasNetworkInterfaces

An immutable client-side representation of an Azure virtual machine.

Method Summary

Modifier and Type Method and Description
String availabilitySetId()
Set<AvailabilityZoneId> availabilityZones()
PagedList<VirtualMachineSize> availableSizes()

Lists all available virtual machine sizes this virtual machine can resized to.

String bootDiagnosticsStorageUri()
String capture(String containerName, String vhdPrefix, boolean overwriteVhd)

Captures the virtual machine by copying virtual hard disks of the VM.

Observable<String> captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd)

Captures the virtual machine by copying virtual hard disks of the VM asynchronously.

ServiceFuture<String> captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd, ServiceCallback<String> callback)

Captures the virtual machine by copying virtual hard disks of the VM asynchronously.

String computerName()
void convertToManaged()

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

Completable convertToManagedAsync()

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

ServiceFuture<Void> convertToManagedAsync(ServiceCallback<Void> callback)

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

Map<Integer, VirtualMachineDataDisk> dataDisks()
void deallocate()

Shuts down the virtual machine and releases the compute resources.

Completable deallocateAsync()

Shuts down the virtual machine and releases the compute resources asynchronously.

ServiceFuture<Void> deallocateAsync(ServiceCallback<Void> callback)

Shuts down the virtual machine and releases the compute resources asynchronously.

DiagnosticsProfile diagnosticsProfile()
VirtualMachineEncryption diskEncryption()
void generalize()

Generalizes the virtual machine.

Completable generalizeAsync()

Generalizes the virtual machine asynchronously.

ServiceFuture<Void> generalizeAsync(ServiceCallback<Void> callback)

Generalizes the virtual machine asynchronously.

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.

String getPrimaryPublicIPAddressId()
VirtualMachineInstanceView instanceView()

Get the virtual machine instance view.

The instance view will be cached for later retrieval using .

boolean isBootDiagnosticsEnabled()
boolean isManagedDiskEnabled()
boolean isManagedServiceIdentityEnabled()
String licenseType()
Map<String, VirtualMachineExtension> listExtensions()
Observable<VirtualMachineExtension> listExtensionsAsync()
String managedServiceIdentityPrincipalId()
String managedServiceIdentityTenantId()
CachingTypes osDiskCachingType()
String osDiskId()
int osDiskSize()
StorageAccountTypes osDiskStorageAccountType()
OSProfile osProfile()
OperatingSystemTypes osType()
String osUnmanagedDiskVhdUri()
Plan plan()
void powerOff()

Powers off (stops) the virtual machine.

Completable powerOffAsync()

Powers off (stops) the virtual machine asynchronously.

ServiceFuture<Void> powerOffAsync(ServiceCallback<Void> callback)

Powers off (stop) the virtual machine asynchronously.

PowerState powerState()
String provisioningState()
void redeploy()

Redeploys the virtual machine.

Completable redeployAsync()

Redeploys the virtual machine asynchronously.

ServiceFuture<Void> redeployAsync(ServiceCallback<Void> callback)

Redeploys the virtual machine asynchronously.

VirtualMachineInstanceView refreshInstanceView()

Refreshes the virtual machine instance view to sync with Azure.

The instance view will be cached for later retrieval using .

Observable<VirtualMachineInstanceView> refreshInstanceViewAsync()

Refreshes the virtual machine instance view to sync with Azure.

void restart()

Restarts the virtual machine.

Completable restartAsync()

Restarts the virtual machine asynchronously.

ServiceFuture<Void> restartAsync(ServiceCallback<Void> callback)

Restarts the virtual machine asynchronously.

VirtualMachineSizeTypes size()
void start()

Starts the virtual machine.

Completable startAsync()

Starts the virtual machine asynchronously.

ServiceFuture<Void> startAsync(ServiceCallback<Void> callback)

Starts the virtual machine asynchronously.

StorageProfile storageProfile()

Returns the storage profile of an Azure virtual machine.

Map<Integer, VirtualMachineUnmanagedDataDisk> unmanagedDataDisks()
String vmId()

Inherited Members

Method Details

availabilitySetId

public String availabilitySetId()

Returns:

the resource ID of the availability set associated with this virtual machine

availabilityZones

public Set availabilityZones()

Returns:

the availability zones assigned to the virtual machine

availableSizes

public PagedList availableSizes()

Lists all available virtual machine sizes this virtual machine can resized to.

Returns:

the virtual machine sizes

bootDiagnosticsStorageUri

public String bootDiagnosticsStorageUri()

Returns:

the storage blob endpoint uri if boot diagnostics is enabled for the virtual machine

capture

public 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

public Observable 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

captureAsync

public ServiceFuture captureAsync(String containerName, String vhdPrefix, boolean overwriteVhd, ServiceCallback callback)

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
callback - the callback to call on success or failure

Returns:

a representation of the deferred computation of this call

computerName

public String computerName()

Returns:

name of this virtual machine

convertToManaged

public void convertToManaged()

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

convertToManagedAsync

public Completable 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

convertToManagedAsync

public ServiceFuture convertToManagedAsync(ServiceCallback callback)

Converts (migrates) the virtual machine with un-managed disks to use managed disk asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

dataDisks

public Map dataDisks()

Returns:

the managed data disks associated with this virtual machine, indexed by LUN

deallocate

public void deallocate()

Shuts down the virtual machine and releases the compute resources.

deallocateAsync

public Completable deallocateAsync()

Shuts down the virtual machine and releases the compute resources asynchronously.

Returns:

a representation of the deferred computation of this call

deallocateAsync

public ServiceFuture deallocateAsync(ServiceCallback callback)

Shuts down the virtual machine and releases the compute resources asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

diagnosticsProfile

public DiagnosticsProfile diagnosticsProfile()

Returns:

the diagnostics profile

diskEncryption

public VirtualMachineEncryption diskEncryption()

Returns:

entry point to enabling, disabling and querying disk encryption

generalize

public void generalize()

Generalizes the virtual machine.

generalizeAsync

public Completable generalizeAsync()

Generalizes the virtual machine asynchronously.

Returns:

a representation of the deferred computation of this call

generalizeAsync

public ServiceFuture generalizeAsync(ServiceCallback callback)

Generalizes the virtual machine asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

getPrimaryPublicIPAddress

public 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

public String getPrimaryPublicIPAddressId()

Returns:

the resource ID of the public IP address associated with this virtual machine's primary network interface

instanceView

public VirtualMachineInstanceView instanceView()

Get the virtual machine instance view.

The instance view will be cached for later retrieval using .

Returns:

the virtual machine's instance view

isBootDiagnosticsEnabled

public boolean isBootDiagnosticsEnabled()

Returns:

true if boot diagnostics is enabled for the virtual machine

isManagedDiskEnabled

public boolean isManagedDiskEnabled()

Returns:

true if managed disks are used for the virtual machine's disks (OS, data)

isManagedServiceIdentityEnabled

public boolean isManagedServiceIdentityEnabled()

Returns:

true if Managed Service Identity is enabled for the virtual machine

licenseType

public String licenseType()

Returns:

the licenseType value

listExtensions

public Map listExtensions()

Returns:

extensions attached to the virtual machine

listExtensionsAsync

public Observable listExtensionsAsync()

Returns:

a representation of the deferred computation of this call, returning extensions attached to the virtual machine

managedServiceIdentityPrincipalId

public String managedServiceIdentityPrincipalId()

Returns:

the Managed Service Identity specific Active Directory service principal ID assigned to the virtual machine.

managedServiceIdentityTenantId

public String managedServiceIdentityTenantId()

Returns:

the Managed Service Identity specific Active Directory tenant ID assigned to the virtual machine.

osDiskCachingType

public CachingTypes osDiskCachingType()

Returns:

the operating system disk caching type

osDiskId

public String osDiskId()

Returns:

resource ID of the managed disk backing the OS disk

osDiskSize

public int osDiskSize()

Returns:

the size of the operating system disk in GB

osDiskStorageAccountType

public StorageAccountTypes osDiskStorageAccountType()

Returns:

the storage account type of the managed disk backing OS disk

osProfile

public OSProfile osProfile()

Returns:

the operating system profile

osType

public OperatingSystemTypes osType()

Returns:

the operating system of this virtual machine

osUnmanagedDiskVhdUri

public String osUnmanagedDiskVhdUri()

Returns:

the URI to the VHD file backing this virtual machine's operating system disk

plan

public Plan plan()

Returns:

the plan value

powerOff

public void powerOff()

Powers off (stops) the virtual machine.

powerOffAsync

public Completable powerOffAsync()

Powers off (stops) the virtual machine asynchronously.

Returns:

a representation of the deferred computation of this call

powerOffAsync

public ServiceFuture powerOffAsync(ServiceCallback callback)

Powers off (stop) the virtual machine asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

powerState

public PowerState powerState()

Returns:

the power state of the virtual machine

provisioningState

public String provisioningState()

Returns:

the provisioningState value

redeploy

public void redeploy()

Redeploys the virtual machine.

redeployAsync

public Completable redeployAsync()

Redeploys the virtual machine asynchronously.

Returns:

a representation of the deferred computation of this call

redeployAsync

public ServiceFuture redeployAsync(ServiceCallback callback)

Redeploys the virtual machine asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

refreshInstanceView

public VirtualMachineInstanceView refreshInstanceView()

Refreshes the virtual machine instance view to sync with Azure.

The instance view will be cached for later retrieval using .

Returns:

the refreshed instance view

refreshInstanceViewAsync

public Observable refreshInstanceViewAsync()

Refreshes the virtual machine instance view to sync with Azure.

Returns:

an observable that emits the instance view of the virtual machine.

restart

public void restart()

Restarts the virtual machine.

restartAsync

public Completable restartAsync()

Restarts the virtual machine asynchronously.

Returns:

a representation of the deferred computation of this call

restartAsync

public ServiceFuture restartAsync(ServiceCallback callback)

Restarts the virtual machine asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

size

public VirtualMachineSizeTypes size()

Returns:

the virtual machine size

start

public void start()

Starts the virtual machine.

startAsync

public Completable startAsync()

Starts the virtual machine asynchronously.

Returns:

a representation of the deferred computation of this call

startAsync

public ServiceFuture startAsync(ServiceCallback callback)

Starts the virtual machine asynchronously.

Parameters:

callback - the callback to call on success or failure

Returns:

a handle to cancel the request

storageProfile

public StorageProfile storageProfile()

Returns the storage profile of an Azure virtual machine.

Returns:

the storageProfile value

unmanagedDataDisks

public Map unmanagedDataDisks()

Returns:

the unmanaged data disks associated with this virtual machine, indexed by LUN number

vmId

public String vmId()

Returns:

the virtual machine unique ID.

Applies to