Class DataDisk


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

      Constructors 
      Constructor Description
      DataDisk()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CachingTypes caching()
      Get the caching property: Specifies the caching requirements.
      DiskCreateOptionTypes createOption()
      Get the createOption property: 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.
      DiskDeleteOptionTypes deleteOption()
      Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is retained after VM is deleted.<br><br> The default value is set to **detach**.
      DiskDetachOptionTypes detachOption()
      Get the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine.
      Long diskIopsReadWrite()
      Get the diskIopsReadWrite property: Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS.
      Long diskMBpsReadWrite()
      Get the diskMBpsReadWrite property: Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.
      Integer diskSizeGB()
      Get the diskSizeGB property: Specifies the size of an empty data disk in gigabytes.
      VirtualHardDisk image()
      Get the image property: The source user image virtual hard disk.
      int lun()
      Get the lun property: Specifies the logical unit number of the data disk.
      ManagedDiskParameters managedDisk()
      Get the managedDisk property: The managed disk parameters.
      String name()
      Get the name property: The disk name.
      Boolean toBeDetached()
      Get the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.
      void validate()
      Validates the instance.
      VirtualHardDisk vhd()
      Get the vhd property: The virtual hard disk.
      DataDisk withCaching​(CachingTypes caching)
      Set the caching property: Specifies the caching requirements.
      DataDisk withCreateOption​(DiskCreateOptionTypes createOption)
      Set the createOption property: 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.
      DataDisk withDeleteOption​(DiskDeleteOptionTypes deleteOption)
      Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is retained after VM is deleted.<br><br> The default value is set to **detach**.
      DataDisk withDetachOption​(DiskDetachOptionTypes detachOption)
      Set the detachOption property: Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine.
      DataDisk withDiskSizeGB​(Integer diskSizeGB)
      Set the diskSizeGB property: Specifies the size of an empty data disk in gigabytes.
      DataDisk withImage​(VirtualHardDisk image)
      Set the image property: The source user image virtual hard disk.
      DataDisk withLun​(int lun)
      Set the lun property: Specifies the logical unit number of the data disk.
      DataDisk withManagedDisk​(ManagedDiskParameters managedDisk)
      Set the managedDisk property: The managed disk parameters.
      DataDisk withName​(String name)
      Set the name property: The disk name.
      DataDisk withToBeDetached​(Boolean toBeDetached)
      Set the toBeDetached property: Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.
      DataDisk withVhd​(VirtualHardDisk vhd)
      Set the vhd property: The virtual hard disk.
      DataDisk withWriteAcceleratorEnabled​(Boolean writeAcceleratorEnabled)
      Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
      Boolean writeAcceleratorEnabled()
      Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
    • Constructor Detail

      • DataDisk

        public DataDisk()
    • Method Detail

      • lun

        public int lun()
        Get the lun property: 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 the lun property: 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 name property: The disk name.
        Returns:
        the name value.
      • withName

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

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

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

        public VirtualHardDisk image()
        Get the image property: 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 image property: 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 the caching property: 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**.
        Returns:
        the caching value.
      • withCaching

        public DataDisk withCaching​(CachingTypes caching)
        Set the caching property: 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**.
        Parameters:
        caching - the caching value to set.
        Returns:
        the DataDisk object itself.
      • writeAcceleratorEnabled

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

        public DataDisk withWriteAcceleratorEnabled​(Boolean writeAcceleratorEnabled)
        Set the writeAcceleratorEnabled property: 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 the createOption property: 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.
        Returns:
        the createOption value.
      • withCreateOption

        public DataDisk withCreateOption​(DiskCreateOptionTypes createOption)
        Set the createOption property: 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.
        Parameters:
        createOption - the createOption value to set.
        Returns:
        the DataDisk object itself.
      • diskSizeGB

        public Integer diskSizeGB()
        Get the diskSizeGB property: 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 the diskSizeGB property: 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 managedDisk property: The managed disk parameters.
        Returns:
        the managedDisk value.
      • withManagedDisk

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

        public Boolean toBeDetached()
        Get the toBeDetached property: 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 the toBeDetached property: 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 the diskIopsReadWrite property: 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 the diskMBpsReadWrite property: 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 the detachOption property: 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'.
        Returns:
        the detachOption value.
      • withDetachOption

        public DataDisk withDetachOption​(DiskDetachOptionTypes detachOption)
        Set the detachOption property: 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'.
        Parameters:
        detachOption - the detachOption value to set.
        Returns:
        the DataDisk object itself.
      • deleteOption

        public DiskDeleteOptionTypes deleteOption()
        Get the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is retained after VM is deleted.<br><br> The default value is set to **detach**.
        Returns:
        the deleteOption value.
      • withDeleteOption

        public DataDisk withDeleteOption​(DiskDeleteOptionTypes deleteOption)
        Set the deleteOption property: Specifies whether data disk should be deleted or detached upon VM deletion.<br><br> Possible values: <br><br> **Delete** If this value is used, the data disk is deleted when VM is deleted.<br><br> **Detach** If this value is used, the data disk is retained after VM is deleted.<br><br> The default value is set to **detach**.
        Parameters:
        deleteOption - the deleteOption value to set.
        Returns:
        the DataDisk object itself.
      • validate

        public void validate()
        Validates the instance.
        Throws:
        IllegalArgumentException - thrown if the instance is not valid.