Quickly add additional disks to your VMs

You have the option of either using the variable $VM to specify multiple VMs that require the same disk configuration, or you can manually enter the VM name in its place

#Specify VMs
$vm = Get-VM "*VM Name*"
#Add a thick provisioned, Eager Zeroed disk to 1 or more VMs:
New-HardDisk -StorageFormat EagerZeroedThick -Controller "SCSI Controller 1" -VM $vm -CapacityGB 100 -Datastore “*Datastore*”
#This command sets the disk to use Thick Provisioning, Specifys "SCSI Controller 1" & “*Datastore*” as the location. If your VMs only have a single SCSI controller then you can remove this option. 

#Add a thin provisioned disk to 1 or more VMs:
New-HardDisk -StorageFormat Thin -Controller "SCSI Controller 1" -VM $vm -CapacityGB 100 -Datastore “*Datastore*”
#This command sets the disk to use Thin Provisioning, Specifys "SCSI Controller 1" & “*Datastore*” as the location. If your VMs only have a single SCSI controller then you can remove this option. 

#Add an RDM to 1 or more VMs: 
New-HardDisk -VM $vm -DiskType RawPhysical -DeviceName /vmfs/devices/disks/naa.600...

#If you want to place the RDM pointer files elsewhere, just use -Datastore "*Datastore* Name"
New-HardDisk -VM “Your-VM-Name” -DiskType RawPhysical -DeviceName /vmfs/devices/disks/naa.6000etc -Datastore “*Datastore*”

 553 total views,  1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *