VMware Cloud Community
nileshpawar1080
Contributor
Contributor

Need to create multi-writer disk through PowerShell

I  can able to create Disk by using powershell but cant make it Multiwritter disk.

 

Below is the script i have created to add new disk in VM, but i want to make it Multiwriter to share it with another VM.

 

$vcenterServer = "vesa-01a.corp.local"
$user = “administrator@corp.local"
$password = "VMware1!"
$vm = “acct-app-01"
$Persistence = "IndependentPersistent"
$DiskType = "Flat"
$controller "SCSI controller 1"
$CapacityGB = "5"
$storageFormat = “EagerZeroedThick"
$Datastore = "RegionAQ1-LOCAL-ESX01A"

#Connect Vcenter Server
Connect-VIServer -Server $vcenterServer -User $user -Password $password

#Create New HDD on WM
New-HardDisk -VM $VM -CapacityGB  $CapacityGB  -StorageFormat $storageFormat  -Persistence $Persistence -DiskType $DiskType -Controller $controller

need your help to make this script complete for making multi-writer disk. once I complete successful testing then i can implement the same in my organization.

 

Thanks,

Nilesh Pawar.

0 Kudos
4 Replies
LucD
Leadership
Leadership

0 Kudos
nileshpawar1080
Contributor
Contributor

Thanks LUC D for looking into this,

When i rub given script get an error : The property device change can not be found on this object verify that thr property exist and can be set.

 

Note : this is not RDM, disk which i am trying is Virtual disk.

 

Thanks,

Nilesh Pawar

0 Kudos
LucD
Leadership
Leadership

The $spec variable holds a VirtualMachineConfigSpec object, which has a DeviceChange property.
There might be something wrong with your copy/paste or whatever you changed in the snippet


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
nileshpawar1080
Contributor
Contributor

Spoiler
Spoiler
Spoiler
I will check and verify once again and update here if it get successful.



Thanks.,

Nilesh pawar
0 Kudos