Automation

 View Only
  • 1.  Need to create multi-writer disk through PowerShell

    Posted Mar 26, 2021 01:40 PM

    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.



  • 2.  RE: Need to create multi-writer disk through PowerShell



  • 3.  RE: Need to create multi-writer disk through PowerShell

    Posted Mar 26, 2021 09:01 PM

    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



  • 4.  RE: Need to create multi-writer disk through PowerShell

    Posted Mar 26, 2021 09:17 PM

    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



  • 5.  RE: Need to create multi-writer disk through PowerShell

    Posted Mar 27, 2021 06:03 AM