2

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)

2 Answers 2

2

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.

Get-HardDisk -vm $line.Name | where {$_.filename -match $startDS} |Move-HardDisk -Datastore $endDS -Confirm:$false

Where:

  • $line.Name = name of a VM
  • $startDS = the current datastore I was evacuating
  • &endDS = the datastore I was sending the drive to

This works for me on VMs regardless of the power state, but it does not move configuration files.

1

It turns out you can't simply

Move-HardDisk $hd -Datastore $dstds

which will give a message that the disk is locked. But instead you can do something along the lines of:

Get-HardDisk -VM MyVM -Name 'Hard Disk 1' | Move-HardDisk -Datastore MyDS

which seems to carry out an svMotion just nicely.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .