Class OSDisk
java.lang.Object
com.microsoft.azure.management.compute.OSDisk
Specifies information about the operating system disk used by the virtual
machine. <br><br> For more information about disks, see [About
disks and VHDs for Azure virtual
machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
-
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 ephemeral Disk Settings for the operating system disk used by the virtual machine.Get specifies the size of an empty data disk in gigabytes.Get specifies the encryption settings for the OS Disk.image()
Get the source user image virtual hard disk.Get the managed disk parameters.name()
Get the disk name.osType()
Get this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.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.withDiffDiskSettings
(DiffDiskSettings diffDiskSettings) Set specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.withDiskSizeGB
(Integer diskSizeGB) Set specifies the size of an empty data disk in gigabytes.withEncryptionSettings
(DiskEncryptionSettings encryptionSettings) Set specifies the encryption settings for the OS Disk.withImage
(VirtualHardDisk image) Set the source user image virtual hard disk.withManagedDisk
(ManagedDiskParameters managedDisk) Set the managed disk parameters.Set the disk name.withOsType
(OperatingSystemTypes osType) Set this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.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
-
OSDisk
public OSDisk()
-
-
Method Details
-
osType
Get this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'.- Returns:
- the osType value
-
withOsType
Set this property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux**. Possible values include: 'Windows', 'Linux'.- Parameters:
osType
- the osType value to set- Returns:
- the OSDisk object itself.
-
encryptionSettings
Get specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15.- Returns:
- the encryptionSettings value
-
withEncryptionSettings
Set specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15.- Parameters:
encryptionSettings
- the encryptionSettings value to set- Returns:
- the OSDisk 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 OSDisk 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 OSDisk 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 OSDisk 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 OSDisk 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 OSDisk object itself.
-
diffDiskSettings
Get specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.- Returns:
- the diffDiskSettings value
-
withDiffDiskSettings
Set specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.- Parameters:
diffDiskSettings
- the diffDiskSettings value to set- Returns:
- the OSDisk 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 OSDisk 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 OSDisk 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 OSDisk object itself.
-