Class StorageProfile

java.lang.Object
com.azure.resourcemanager.compute.models.StorageProfile
All Implemented Interfaces:
com.azure.json.JsonSerializable<StorageProfile>

public final class StorageProfile extends Object implements com.azure.json.JsonSerializable<StorageProfile>
Specifies the storage settings for the virtual machine disks.
  • Constructor Details

    • StorageProfile

      public StorageProfile()
      Creates an instance of StorageProfile class.
  • Method Details

    • imageReference

      public ImageReference imageReference()
      Get the imageReference property: Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations.
      Returns:
      the imageReference value.
    • withImageReference

      public StorageProfile withImageReference(ImageReference imageReference)
      Set the imageReference property: Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations.
      Parameters:
      imageReference - the imageReference value to set.
      Returns:
      the StorageProfile object itself.
    • osDisk

      public OSDisk osDisk()
      Get the osDisk property: 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).
      Returns:
      the osDisk value.
    • withOsDisk

      public StorageProfile withOsDisk(OSDisk osDisk)
      Set the osDisk property: 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).
      Parameters:
      osDisk - the osDisk value to set.
      Returns:
      the StorageProfile object itself.
    • dataDisks

      public List<DataDisk> dataDisks()
      Get the dataDisks property: Specifies the parameters that are used to add a data disk to a 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).
      Returns:
      the dataDisks value.
    • withDataDisks

      public StorageProfile withDataDisks(List<DataDisk> dataDisks)
      Set the dataDisks property: Specifies the parameters that are used to add a data disk to a 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).
      Parameters:
      dataDisks - the dataDisks value to set.
      Returns:
      the StorageProfile object itself.
    • diskControllerType

      public DiskControllerTypes diskControllerType()
      Get the diskControllerType property: Specifies the disk controller type configured for the VM. **Note:** This property will be set to the default disk controller type if not specified provided virtual machine is being created with 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api version. You need to deallocate the VM before updating its disk controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM. Minimum api-version: 2022-08-01.
      Returns:
      the diskControllerType value.
    • withDiskControllerType

      public StorageProfile withDiskControllerType(DiskControllerTypes diskControllerType)
      Set the diskControllerType property: Specifies the disk controller type configured for the VM. **Note:** This property will be set to the default disk controller type if not specified provided virtual machine is being created with 'hyperVGeneration' set to V2 based on the capabilities of the operating system disk and VM size from the the specified minimum api version. You need to deallocate the VM before updating its disk controller type unless you are updating the VM size in the VM configuration which implicitly deallocates and reallocates the VM. Minimum api-version: 2022-08-01.
      Parameters:
      diskControllerType - the diskControllerType value to set.
      Returns:
      the StorageProfile object itself.
    • alignRegionalDisksToVMZone

      public Boolean alignRegionalDisksToVMZone()
      Get the alignRegionalDisksToVMZone property: Specifies whether the regional disks should be aligned/moved to the VM zone. This is applicable only for VMs with placement property set. Please note that this change is irreversible. Minimum api-version: 2024-11-01.
      Returns:
      the alignRegionalDisksToVMZone value.
    • withAlignRegionalDisksToVMZone

      public StorageProfile withAlignRegionalDisksToVMZone(Boolean alignRegionalDisksToVMZone)
      Set the alignRegionalDisksToVMZone property: Specifies whether the regional disks should be aligned/moved to the VM zone. This is applicable only for VMs with placement property set. Please note that this change is irreversible. Minimum api-version: 2024-11-01.
      Parameters:
      alignRegionalDisksToVMZone - the alignRegionalDisksToVMZone value to set.
      Returns:
      the StorageProfile object itself.
    • validate

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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<StorageProfile>
      Throws:
      IOException
    • fromJson

      public static StorageProfile fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of StorageProfile from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of StorageProfile if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the StorageProfile.