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

public class OSDisk extends Object
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 Details

    • OSDisk

      public OSDisk()
  • Method Details

    • osType

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

      public OSDisk 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. <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

      public DiskEncryptionSettings encryptionSettings()
      Get specifies the encryption settings for the OS Disk. <br><br> Minimum api-version: 2015-06-15.
      Returns:
      the encryptionSettings value
    • withEncryptionSettings

      public OSDisk withEncryptionSettings(DiskEncryptionSettings encryptionSettings)
      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

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

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

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

      public OSDisk withVhd(VirtualHardDisk vhd)
      Set the virtual hard disk.
      Parameters:
      vhd - the vhd value to set
      Returns:
      the OSDisk 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 OSDisk 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 OSDisk 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 OSDisk 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 OSDisk object itself.
    • writeAcceleratorEnabled

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

      public OSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
      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

      public DiffDiskSettings diffDiskSettings()
      Get specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
      Returns:
      the diffDiskSettings value
    • withDiffDiskSettings

      public OSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings)
      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

      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 OSDisk 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 OSDisk 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 OSDisk 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 OSDisk object itself.
    • managedDisk

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

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