![vmware 55 new-vm vmware 55 new-vm](https://www.nakivo.com/blog/wp-content/uploads/2020/07/Selecting-a-name-and-folder-for-a-new-VM-in-VMware-vSphere-Client-7.png)
Specifies the capacity of the new virtual disk in gigabytes (GB). You can pass the instance to the AdvancedOption parameter of the New-VM or New-HardDisk cmdlets. Only one such rule is supported per a virtual machine. The specified disks (and the disk to which the rule is applied) are placed in an anti-affinity rule on a DatastoreCluster.
![vmware 55 new-vm vmware 55 new-vm](https://i.ytimg.com/vi/xPJes1paeM4/maxresdefault.jpg)
For the first constructor, "diskIdentifier" can be either the disk key or the index of the disk in the disk array. There are two constructors - "public SdrsVMDiskAntiAffinityRule(param string diskIdentifier)" and "public SdrsVMDiskAntiAffinityRule(param HardDisk disk)". An instance of the object is created by invoking its constructor. It is only applicable when creating a virtual machine or hard disk on a datastore cluster. The SdrsVMDiskAntiAffinityRule defines a Storage DRS intra-VM anti-affinity rule (VM disk anti-affinity rule).
![vmware 55 new-vm vmware 55 new-vm](https://b3n.org/wp-content/uploads/2015/03/Image-18.png)
You can define an anti-affinity Storage Distributed Resource Scheduler (SDRS) rule for the disk by specifying a SdrsVMDiskAntiAffinityRule object to the AdvancedOption parameter and this will override any existing SdrsVMDiskAntiAffinityRule for the virtual machine. Accepts only SdrsVMDiskAntiAffinityRule objects. Specifies advanced options for creating hard disks. If the hard disk is attached to no virtual machine, the value of the DiskType parameter might be Unknown, which means that no type is specified. The valid values are rawVirtual, rawPhysical, flat, and unknown. Specifies the type of file backing that you want to use. Their usage is not recommended because they do not work with snapshots and are not supported on ESX 3.5 and later. The 'NonPersistent' and 'Undoable' values are deprecated and scheduled for removal. This parameter is supported only when the disk type is set to "rawVirtual" or "flat". The valid values are Persistent, NonPersistent, IndependentPersistent, IndependentNonPersistent, and Undoable. Passing multiple values to this parameter is obsolete. Specifies the virtual machine to which you want to add the new disk. Use the Persistence parameter to make the disk Persistent (changes are immediately and permanently written to the disk), Nonpersistent (changes to the disk are discarded when you power off or reset the virtual machine), IndependentPersistent, IndependentNonPersistent, or Undoable. If "flat" mode is set by the DiskType parameter, the virtual disk backing is pre-allocated. In "physical" compatibility mode, the disk modes are ignored and commands are passed directly to the backing Logical Unit Number (LUN). In "virtual" compatibility mode, the disk can use the specified disk modes. When a new virtual disk with raw disk mapping (RDM) backing is created, the compatibility mode of "virtual" or "physical" must be specified using the DiskType parameter. New-HardDisk -VDisk ĭetailed DescriptionThis cmdlet creates a new hard disk on the specified virtual machine or datastore. New-HardDisk - PowerCLI Help Reference PowerCLI Reference New-HardDisk SynopsisThis cmdlet creates a new hard disk on the specified location.