VMware vSphere

 View Only
  • 1.  Scripts for Initializing and Formatting Hard Disks

    Posted Aug 06, 2019 09:32 AM

    Hi All,

    I am trying to configure VM from remote computer through VM Name.

    I had tried to add hard disks with the below command and is added which i can see in disk management.

    New-HardDisk -VM $VMName -CapacityGB $DiskSize -Persistence persistent

    The disk is not been shown in my computer as the disks have to be initialized and formatted.

    Can someone help with powercli scripts to initialize and format hard disks from remote computer. I am a newbie to VMWare scripting and help will be very much appreciated.

    Thanks and Regards,

    Ashvin



  • 2.  RE: Scripts for Initializing and Formatting Hard Disks

    Posted Aug 06, 2019 09:52 AM

    Hi,

    Powercli is not good for initializing and formatting the HDD. If the computer is remote as Microsoft Windows operating system, you must use Powershell.

    Use PowerShell to Initialize Raw Disks and to Partition and Format Volumes | Scripting

    Alessandro Romeo



  • 3.  RE: Scripts for Initializing and Formatting Hard Disks

    Posted Aug 06, 2019 09:53 AM

    Ashvin,

    From within the VM you can run a script to initialize and format the new disk.

    Initialize a Volume Using Windows PowerShell

    Lars



  • 4.  RE: Scripts for Initializing and Formatting Hard Disks

    Posted Aug 06, 2019 10:22 AM

    Hi,

    From within the vm it can do it also with the graphic interface. I think he wanted to do it remotely. With Powershell you can do it by running commands remotely. as I had written before.

    Alessandro Romeo



  • 5.  RE: Scripts for Initializing and Formatting Hard Disks

    Posted Aug 06, 2019 10:34 AM

    Hi Alessandro,

    Yes, I had been trying to initialize and format disks from remote computer through powercli.

    I understand we can create scripts to format/initialize on remote machine and invoke them through powercli, Please correct me if I am wrong.

    Thanks and Regards,

    Ashvin



  • 6.  RE: Scripts for Initializing and Formatting Hard Disks