I spoke before about Storage vMotion via PowerCLI, and today I got to put it into practice. It works, *but* there's a small thing: It doesn't do thin provisioning on the fly, as far as I can tell. So if you had a thick VM, and you wanted to make it thin, normally via the interface you get an option to do thin provisioning during the Storage vMotion. The Move-VM statement has no such feature yet (I think, at least I couldn't find it). Some searching around told me that the awesome LucD posted a function on poshcode to get the thin provisioning into Move-VM (sort of). I haven't tested it out yet, but it seems to be what I needed.
Oh and for my own reference: If I want to move all vm's from "cluster1" to the New-Storage datastore:
Get-Cluster cluster1 | Get-VM | Move-VM -Datastore(Get-Datastore "New-Storage")
PowerShell, VMware, and anything else I find interesting or keep forgetting
Showing posts with label Storage-Vmotion. Show all posts
Showing posts with label Storage-Vmotion. Show all posts
Tuesday, February 22, 2011
Thursday, February 3, 2011
Storage VMotion via PowerCLI
I keep running into occasions where I need to storage vmotion a lot of VM's to different locations. I looked at a solution some time ago, but that was an old version of PowerCLI. Turns out nowadays it's really easy:
get-vm "MyVM"| move-vm -datastore(Get-Datastore "New-Storage")
This simply moves the MyVM virtual machine to the New-Storage datastore.. Remove the "MyVM", and suddenly ALL vm's move to the New-Storage datastore: SWEET. Gotta love PowerCLI, and especially since I've got a job coming up where I need to be moving a whole bunch of vm's to new storage....
get-vm "MyVM"| move-vm -datastore(Get-Datastore "New-Storage")
This simply moves the MyVM virtual machine to the New-Storage datastore.. Remove the "MyVM", and suddenly ALL vm's move to the New-Storage datastore: SWEET. Gotta love PowerCLI, and especially since I've got a job coming up where I need to be moving a whole bunch of vm's to new storage....
Subscribe to:
Posts (Atom)