PowerCLI: Evacuate a Datastore

More migration/upgrade stuff… As part of a larger migration strategy, I needed to migrate whole datastores. Literally Terabytes of VM data, while sVMotion did all the heavy lifting. I still needed a control script to manage this process for me. This script ran successfully for over three days on one of my larger datastores. Faithfully, moving my VM’s two by two!

Honestly I completed this over a month ago, but I consider these little scripts I write to be too simple to post… My drafts folder is full of stuff like this. On the one hand I want to post for my own use, but I can search my drafts for that. So I ask you, do you get any value out of these one off solutions? Please, don’t pad my ego… If you don’t find this kind of stuff useful don’t pretend. I have my documentation, I want to know if you would like access to it?

See ya’ll at VMworld
~Glenn

11 thoughts on “PowerCLI: Evacuate a Datastore”

  1. Keep them coming, one thing I have learnt is that what is simple to one person often is not to another, some of the most simple scripts on my blog seam to gain the most attention. Great work.

    Reply
  2. Is there a command switch that I can add to this amazing script that would automatically convert the vmdk to THIN provisioning during the evacuation process as well?

    Thank you for creating this, by the way. It has saved me a LOT of time.

    Reply
  3. Hey Albert,

    You can set the MaxConcurrent to whatever value you like. I originally set it to 2 to ensure I wouldn’t impact the production environment.

    Reply
  4. Hi

    This scriupt works great if you want to move the whole vm, but how can you move just the harddisks on that datastore to another datastore? I dont want to move the vm and allits associated harddisks. Reason is we have some VM’s with 6 or more harddisks and have created induvidual datstores for these large disks. On the other hand, some datstores have multiple vm’s on it, but if i was to move the whole vm to one datastore it will not fit.

    In short, i would like to move only that what is on the datastore to another without affecting any other disks for any of the vm’s on the source.

    Hope this makes sense.

    Thanks

    Kobus

    Reply
  5. Great job, dude. It works fine for me!
    But there I faced with the problem, when vSphere shows old datastore for VM after vMotion (it is attached iso fault, check solution: http://www.hiperlogic.com/blog/?p=473). Your script in that case hangs on circular moving the same two VMs between datastores.

    Reply

Leave a Reply