Class DataDisk

java.lang.Object
com.microsoft.azure.management.compute.DataDisk

public class DataDisk extends Object
Describes a data disk.
  • Constructor Details

    • DataDisk

      public DataDisk()
  • Method Details

    • lun

      public int lun()
      Get specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
      Returns:
      the lun value
    • withLun

      public DataDisk withLun(int lun)
      Set specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
      Parameters:
      lun - the lun value to set
      Returns:
      the DataDisk object itself.
    • name

      public String name()
      Get the disk name.
      Returns:
      the name value
    • withName

      public DataDisk withName(String name)
      Set the disk name.
      Parameters:
      name - the name value to set
      Returns:
      the DataDisk object itself.
    • vhd

      public VirtualHardDisk vhd()
      Get the virtual hard disk.
      Returns:
      the vhd value
    • withVhd

      public DataDisk withVhd(VirtualHardDisk vhd)
      Set the virtual hard disk.
      Parameters:
      vhd - the vhd value to set
      Returns:
      the DataDisk object itself.
    • image

      public VirtualHardDisk image()
      Get the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
      Returns:
      the image value
    • withImage

      public DataDisk withImage(VirtualHardDisk image)
      Set the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
      Parameters:
      image - the image value to set
      Returns:
      the DataDisk object itself.
    • caching

      public CachingTypes caching()
      Get specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'.
      Returns:
      the caching value
    • withCaching

      public DataDisk withCaching(CachingTypes caching)
      Set specifies the caching requirements. <br><br> Possible values are: <br><br> **None** <br><br> **ReadOnly** <br><br> **ReadWrite** <br><br> Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'.
      Parameters:
      caching - the caching value to set
      Returns:
      the DataDisk object itself.
    • writeAcceleratorEnabled

      public Boolean writeAcceleratorEnabled()
      Get specifies whether writeAccelerator should be enabled or disabled on the disk.
      Returns:
      the writeAcceleratorEnabled value
    • withWriteAcceleratorEnabled

      public DataDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
      Set specifies whether writeAccelerator should be enabled or disabled on the disk.
      Parameters:
      writeAcceleratorEnabled - the writeAcceleratorEnabled value to set
      Returns:
      the DataDisk object itself.
    • createOption

      public DiskCreateOptionTypes createOption()
      Get specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** – This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** – This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'.
      Returns:
      the createOption value
    • withCreateOption

      public DataDisk withCreateOption(DiskCreateOptionTypes createOption)
      Set specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> **Attach** – This value is used when you are using a specialized disk to create the virtual machine.<br><br> **FromImage** – This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'.
      Parameters:
      createOption - the createOption value to set
      Returns:
      the DataDisk object itself.
    • diskSizeGB

      public Integer diskSizeGB()
      Get specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB.
      Returns:
      the diskSizeGB value
    • withDiskSizeGB

      public DataDisk withDiskSizeGB(Integer diskSizeGB)
      Set specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. <br><br> This value cannot be larger than 1023 GB.
      Parameters:
      diskSizeGB - the diskSizeGB value to set
      Returns:
      the DataDisk object itself.
    • managedDisk

      public ManagedDiskParameters managedDisk()
      Get the managed disk parameters.
      Returns:
      the managedDisk value
    • withManagedDisk

      public DataDisk withManagedDisk(ManagedDiskParameters managedDisk)
      Set the managed disk parameters.
      Parameters:
      managedDisk - the managedDisk value to set
      Returns:
      the DataDisk object itself.
    • toBeDetached

      public Boolean toBeDetached()
      Get specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.
      Returns:
      the toBeDetached value
    • withToBeDetached

      public DataDisk withToBeDetached(Boolean toBeDetached)
      Set specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.
      Parameters:
      toBeDetached - the toBeDetached value to set
      Returns:
      the DataDisk object itself.
    • diskIOPSReadWrite

      public Long diskIOPSReadWrite()
      Get specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set.
      Returns:
      the diskIOPSReadWrite value
    • diskMBpsReadWrite

      public Long diskMBpsReadWrite()
      Get specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set.
      Returns:
      the diskMBpsReadWrite value
    • detachOption

      public DiskDetachOptionTypes detachOption()
      Get specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach**. <br><br> detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. <br><br> This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible values include: 'ForceDetach'.
      Returns:
      the detachOption value
    • withDetachOption

      public DataDisk withDetachOption(DiskDetachOptionTypes detachOption)
      Set specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach**. <br><br> detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. <br><br> This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'. Possible values include: 'ForceDetach'.
      Parameters:
      detachOption - the detachOption value to set
      Returns:
      the DataDisk object itself.