Pages: [1]
Print
Author Topic: svMotion all VMs from on LUN to another  (Read 175 times)
ewannema
Administrator
Newbie
*****
Posts: 31


View Profile WWW
« on: July 13, 2010, 09:04:52 AM »

Here is some example code for migrating from one LUN to another. The first example does them all at once which is likely to overload your I/O capacity, but I wanted to include it to show how a slightly different construct ends up with potentially bad results.

There are potential optimizations to the code, but this simple method should be good enough.

Code:
# Storage VMotion ALL VMs from one LUN to another (All at the same time) COULD BE BAD
Get-Datastore "sourceDS" | Get-VM | Move-VM -Datastore (Get-Datastore "destDS")

# Storage VMotion ALL VMs from one LUN to another (One at a time)
Get-Datastore "sourceDS" | Get-VM | ForEach-Object {Move-VM -VM $_ -Datastore (Get-Datastore "destDS")}
Logged
esarakaitis
Administrator
Full Member
*****
Posts: 247


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« Reply #1 on: July 13, 2010, 01:28:46 PM »

ooooo very nice
Logged
Pages: [1]
Print
Jump to: