Automation

 View Only
  • 1.  Moving multiple vm disks to different datastores

    Posted Oct 05, 2023 12:04 PM

    Is it possible via PowerCLI to move multiple vm disks to different datastores on the same host in just one task?

    Via UI in vSphere Client it is possible if you select migrate -> change storage only -> configure per disk and then you can select the required disks and select the destination storage.

    I haven't tested if it is possible to use Move-Harddisk for multiple hard disks so that only one task with all vMotions included for each hard disk to migrate will be triggered.

    If I start a vMotion using Move-Harddisk for each vm disk only the first one runs immediately while the other tasks will be queued. I would like to avoid multiple Relocate tasks for one vm so that I can run more vMotions per Hosts in parallel.



  • 2.  RE: Moving multiple vm disks to different datastores

    Posted Oct 05, 2023 12:25 PM

    Not with the Move-VM nor Move-Harddisk cmdlets.
    You can use the Set-Harddisk cmdlet, in a loop over all vDisks of the VM, where you can specify per vDisk to which Datastore it should be moved.

    The method that is used from the Web Client is the RelocateVM method, which allows you to specify per vDisk to which Datastore it should be moved.



  • 3.  RE: Moving multiple vm disks to different datastores

    Posted Oct 05, 2023 01:42 PM

    Tried to move some of the vms use set-harddisk, get following warning messages:

    WARNING: Parameter 'Datastore' is obsolete. 'Datastore' parameter is obsolete. To move hard disk to another datastore and change it's storage format, use 'Move-HardDisk' cmdlet instead.
    What if: Performing the operation "Setting Datastore: mytestlab_03." on target "Hard disk 1".
    WARNING: Parameter 'Datastore' is obsolete. 'Datastore' parameter is obsolete. To move hard disk to another datastore and change it's storage format, use 'Move-HardDisk' cmdlet instead.
    What if: Performing the operation "Setting Datastore: mytestlab_03." on target "Hard disk 2".

     

     



  • 4.  RE: Moving multiple vm disks to different datastores

    Posted Oct 05, 2023 02:11 PM

    Ok, seems that Move-Harddisk also supports the move of a vDisk to another Datastore.
    An from the warning message seems to be the preferred method.

    The concept of my previous stays the same, just use Move-Harddisk instead of Set-Harddisk.

    PS: that warning has been there for quite some time, not sure when the parameter is actually ever going to be "obsolete"