Show / Hide Table of Contents

    Class DataDisk

    Describes a data disk.

    Inheritance
    Object
    DataDisk
    Namespace: System.Dynamic.ExpandoObject
    Assembly: Microsoft.Azure.Management.Compute.dll
    Syntax
    public class DataDisk

    Constructors

    DataDisk()

    Initializes a new instance of the DataDisk class.

    Declaration
    public DataDisk ();

    DataDisk(Int32, String, String, VirtualHardDisk, VirtualHardDisk, Nullable<CachingTypes>, Nullable<Boolean>, Nullable<Int32>, ManagedDiskParameters, Nullable<Boolean>)

    Initializes a new instance of the DataDisk class.

    Declaration
    public DataDisk (int lun, string createOption, string name = null, Microsoft.Azure.Management.Compute.Models.VirtualHardDisk vhd = null, Microsoft.Azure.Management.Compute.Models.VirtualHardDisk image = null, Nullable<Microsoft.Azure.Management.Compute.Models.CachingTypes> caching = null, Nullable<bool> writeAcceleratorEnabled = null, Nullable<int> diskSizeGB = null, Microsoft.Azure.Management.Compute.Models.ManagedDiskParameters managedDisk = null, Nullable<bool> toBeDetached = null);
    Parameters
    Int32 lun

    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.

    String createOption

    Specifies how the virtual machine should be created.<br><br> Possible values are:<br><br> Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine.<br><br> FromImage \u2013 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'

    String name

    The disk name.

    VirtualHardDisk vhd

    The virtual hard disk.

    VirtualHardDisk image

    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.

    Nullable<CachingTypes> caching

    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'

    Nullable<Boolean> writeAcceleratorEnabled

    Specifies whether writeAccelerator should be enabled or disabled on the disk.

    Nullable<Int32> diskSizeGB

    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

    ManagedDiskParameters managedDisk

    The managed disk parameters.

    Nullable<Boolean> toBeDetached

    Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset

    Properties

    Caching

    Gets or sets specifies the caching requirements. &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt; None &lt;br&gt;&lt;br&gt; ReadOnly &lt;br&gt;&lt;br&gt; ReadWrite &lt;br&gt;&lt;br&gt; Default: None for Standard storage. ReadOnly for Premium storage. Possible values include: 'None', 'ReadOnly', 'ReadWrite'

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="caching")]
    public Nullable<Microsoft.Azure.Management.Compute.Models.CachingTypes> Caching { get; set; }
    Property Value
    Nullable<CachingTypes>

    CreateOption

    Gets or sets specifies how the virtual machine should be created.&lt;br&gt;&lt;br&gt; Possible values are:&lt;br&gt;&lt;br&gt; Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine.&lt;br&gt;&lt;br&gt; FromImage \u2013 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'

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="createOption")]
    public string CreateOption { get; set; }
    Property Value
    String

    DiskSizeGB

    Gets or sets 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. &lt;br&gt;&lt;br&gt; This value cannot be larger than 1023 GB

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="diskSizeGB")]
    public Nullable<int> DiskSizeGB { get; set; }
    Property Value
    Nullable<Int32>

    Image

    Gets or sets 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.

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="image")]
    public Microsoft.Azure.Management.Compute.Models.VirtualHardDisk Image { get; set; }
    Property Value
    VirtualHardDisk

    Lun

    Gets or sets 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.

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="lun")]
    public int Lun { get; set; }
    Property Value
    Int32

    ManagedDisk

    Gets or sets the managed disk parameters.

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="managedDisk")]
    public Microsoft.Azure.Management.Compute.Models.ManagedDiskParameters ManagedDisk { get; set; }
    Property Value
    ManagedDiskParameters

    Name

    Gets or sets the disk name.

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="name")]
    public string Name { get; set; }
    Property Value
    String

    ToBeDetached

    Gets or sets specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="toBeDetached")]
    public Nullable<bool> ToBeDetached { get; set; }
    Property Value
    Nullable<Boolean>

    Vhd

    Gets or sets the virtual hard disk.

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="vhd")]
    public Microsoft.Azure.Management.Compute.Models.VirtualHardDisk Vhd { get; set; }
    Property Value
    VirtualHardDisk

    WriteAcceleratorEnabled

    Gets or sets specifies whether writeAccelerator should be enabled or disabled on the disk.

    Declaration
    [Newtonsoft.Json.JsonProperty(PropertyName="writeAcceleratorEnabled")]
    public Nullable<bool> WriteAcceleratorEnabled { get; set; }
    Property Value
    Nullable<Boolean>

    Methods

    Validate()

    Validate the object.

    Declaration
    public virtual void Validate ();
    Exceptions
    ValidationException

    Thrown if validation fails

    Back to top Azure SDK for Net