Class DataDisk
java.lang.Object
com.microsoft.azure.management.compute.DataDisk
Describes a data disk.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncaching()
Get specifies the caching requirements.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.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.Get specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS.Get specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS.Get specifies the size of an empty data disk in gigabytes.image()
Get the source user image virtual hard disk.int
lun()
Get specifies the logical unit number of the data disk.Get the managed disk parameters.name()
Get the disk name.Get specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.vhd()
Get the virtual hard disk.withCaching
(CachingTypes caching) Set specifies the caching requirements.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.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.withDiskSizeGB
(Integer diskSizeGB) Set specifies the size of an empty data disk in gigabytes.withImage
(VirtualHardDisk image) Set the source user image virtual hard disk.withLun
(int lun) Set specifies the logical unit number of the data disk.withManagedDisk
(ManagedDiskParameters managedDisk) Set the managed disk parameters.Set the disk name.withToBeDetached
(Boolean toBeDetached) Set specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.withVhd
(VirtualHardDisk vhd) Set the virtual hard disk.withWriteAcceleratorEnabled
(Boolean writeAcceleratorEnabled) Set specifies whether writeAccelerator should be enabled or disabled on the disk.Get specifies whether writeAccelerator should be enabled or disabled on the 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
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
Get the disk name.- Returns:
- the name value
-
withName
Set the disk name.- Parameters:
name
- the name value to set- Returns:
- the DataDisk object itself.
-
vhd
Get the virtual hard disk.- Returns:
- the vhd value
-
withVhd
Set the virtual hard disk.- Parameters:
vhd
- the vhd value to set- Returns:
- the DataDisk object itself.
-
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
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
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
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
Get specifies whether writeAccelerator should be enabled or disabled on the disk.- Returns:
- the writeAcceleratorEnabled value
-
withWriteAcceleratorEnabled
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
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
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
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
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
Get the managed disk parameters.- Returns:
- the managedDisk value
-
withManagedDisk
Set the managed disk parameters.- Parameters:
managedDisk
- the managedDisk value to set- Returns:
- the DataDisk object itself.
-
toBeDetached
Get specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset.- Returns:
- the toBeDetached value
-
withToBeDetached
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
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
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
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
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.
-