How do I svMotion a single disk in PowerCLI 5.5?
Trying Set-HardDisk
gives the following warning:
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.
Set-HardDisk
fails anyway with a message that the disk is locked (hence I guess you can't use it for an online migration).
Move-HardDisk
only seems to be able to move disks in offline mode too (cold migration), however I'd like to perform a Storage vMotion.
Move-VM
can only move all disks of a VM, which is not what I want. (Too many and too big disks on a VM, will never fit on one destination LUN)
I use this in part of a longer script I wrote for a migration projects. This is pulling names and csv I built earlier in the same script.
Where:
This works for me on VMs regardless of the power state, but it does not move configuration files.
It turns out you can't simply
which will give a message that the disk is locked. But instead you can do something along the lines of:
which seems to carry out an svMotion just nicely.