OSDisk Class
- java.
lang. Object - com.
azure. resourcemanager. compute. models. OSDisk
- com.
Implements
public final class OSDisk
implements JsonSerializable<OSDisk>
Specifies information about the operating system disk used by the virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
Constructor Summary
Constructor | Description |
---|---|
OSDisk() |
Creates an instance of OSDisk class. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Caching |
caching()
Get the caching property: Specifies the caching requirements. |
Disk |
createOption()
Get the create |
Disk |
deleteOption()
Get the delete |
Diff |
diffDiskSettings()
Get the diff |
Integer |
diskSizeGB()
Get the disk |
Disk |
encryptionSettings()
Get the encryption |
static OSDisk |
fromJson(JsonReader jsonReader)
Reads an instance of OSDisk from the Json |
Virtual |
image()
Get the image property: The source user image virtual hard disk. |
Managed |
managedDisk()
Get the managed |
String |
name()
Get the name property: The disk name. |
Operating |
osType()
Get the os |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Virtual |
vhd()
Get the vhd property: The virtual hard disk. |
OSDisk |
withCaching(CachingTypes caching)
Set the caching property: Specifies the caching requirements. |
OSDisk |
withCreateOption(DiskCreateOptionTypes createOption)
Set the create |
OSDisk |
withDeleteOption(DiskDeleteOptionTypes deleteOption)
Set the delete |
OSDisk |
withDiffDiskSettings(DiffDiskSettings diffDiskSettings)
Set the diff |
OSDisk |
withDiskSizeGB(Integer diskSizeGB)
Set the disk |
OSDisk |
withEncryptionSettings(DiskEncryptionSettings encryptionSettings)
Set the encryption |
OSDisk |
withImage(VirtualHardDisk image)
Set the image property: The source user image virtual hard disk. |
OSDisk |
withManagedDisk(ManagedDiskParameters managedDisk)
Set the managed |
OSDisk |
withName(String name)
Set the name property: The disk name. |
OSDisk |
withOsType(OperatingSystemTypes osType)
Set the os |
OSDisk |
withVhd(VirtualHardDisk vhd)
Set the vhd property: The virtual hard disk. |
OSDisk |
withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
Set the write |
Boolean |
writeAcceleratorEnabled()
Get the write |
Methods inherited from java.lang.Object
Constructor Details
OSDisk
public OSDisk()
Creates an instance of OSDisk class.
Method Details
caching
public CachingTypes caching()
Get the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**.
Returns:
createOption
public DiskCreateOptionTypes createOption()
Get the createOption property: Specifies how the virtual machine disk should be created. Possible values are **Attach:** This value is used when you are using a specialized disk to create the virtual machine. **FromImage:** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
Returns:
deleteOption
public DiskDeleteOptionTypes deleteOption()
Get the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
Returns:
diffDiskSettings
public DiffDiskSettings diffDiskSettings()
Get the diffDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
Returns:
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. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
Returns:
encryptionSettings
public DiskEncryptionSettings encryptionSettings()
Get the encryptionSettings property: Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
Returns:
fromJson
public static OSDisk fromJson(JsonReader jsonReader)
Reads an instance of OSDisk from the JsonReader.
Parameters:
Returns:
Throws:
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:
managedDisk
public ManagedDiskParameters managedDisk()
Get the managedDisk property: The managed disk parameters.
Returns:
name
public String name()
Get the name property: The disk name.
Returns:
osType
public OperatingSystemTypes osType()
Get the osType property: 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. Possible values are: **Windows,** **Linux.**.
Returns:
toJson
validate
public void validate()
Validates the instance.
vhd
public VirtualHardDisk vhd()
Get the vhd property: The virtual hard disk.
Returns:
withCaching
public OSDisk withCaching(CachingTypes caching)
Set the caching property: Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**.
Parameters:
Returns:
withCreateOption
public OSDisk withCreateOption(DiskCreateOptionTypes createOption)
Set the createOption property: Specifies how the virtual machine disk should be created. Possible values are **Attach:** This value is used when you are using a specialized disk to create the virtual machine. **FromImage:** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
Parameters:
Returns:
withDeleteOption
public OSDisk withDeleteOption(DiskDeleteOptionTypes deleteOption)
Set the deleteOption property: Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
Parameters:
Returns:
withDiffDiskSettings
public OSDisk withDiffDiskSettings(DiffDiskSettings diffDiskSettings)
Set the diffDiskSettings property: Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
Parameters:
Returns:
withDiskSizeGB
public OSDisk 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. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
Parameters:
Returns:
withEncryptionSettings
public OSDisk withEncryptionSettings(DiskEncryptionSettings encryptionSettings)
Set the encryptionSettings property: Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
Parameters:
Returns:
withImage
public OSDisk 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:
Returns:
withManagedDisk
public OSDisk withManagedDisk(ManagedDiskParameters managedDisk)
Set the managedDisk property: The managed disk parameters.
Parameters:
Returns:
withName
public OSDisk withName(String name)
Set the name property: The disk name.
Parameters:
Returns:
withOsType
public OSDisk withOsType(OperatingSystemTypes osType)
Set the osType property: 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. Possible values are: **Windows,** **Linux.**.
Parameters:
Returns:
withVhd
public OSDisk withVhd(VirtualHardDisk vhd)
Set the vhd property: The virtual hard disk.
Parameters:
Returns:
withWriteAcceleratorEnabled
public OSDisk withWriteAcceleratorEnabled(Boolean writeAcceleratorEnabled)
Set the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
Parameters:
Returns:
writeAcceleratorEnabled
public Boolean writeAcceleratorEnabled()
Get the writeAcceleratorEnabled property: Specifies whether writeAccelerator should be enabled or disabled on the disk.
Returns:
Applies to
Azure SDK for Java