Using PowerShell to Storage Migrate with Windows Server “8”

Using PowerShell to Storage Migrate with Windows Server “8”

  • Comments 3


Yesterday I showed you how to do a simple storage migration using the Hyper-V Manager user interface.  Today I want to show you how to do the same thing in PowerShell – and in my opinion it is even easier to do in PowerShell than with our user interface.

As a quick reminder – I am not showing you the complex side of storage migration (yet) I am just showing you how to accomplish the task of getting all the bits for a given virtual machine moved to a single folder, while the virtual machine continues to run.  The PowerShell command for this is actually quite self explanatory:

Move-VMStorage -VMName "Windows Server 2008 R2" -DestinationStoragePath "E:\Hyper-V\Windows Server 2008 R2"

image

“Move-VMStorage”, the name of the virtual machine you want to move, and the name of the folder you want to move it to.  Couldn’t be much simpler than that right?  Well, actually it can.  You see, the “-VMName” and “-DestinationStoragePath” parameter names are not required.  You can actually just type this:

Move-VMStorage "Windows Server 2008 R2" "D:\Hyper-V\Windows Server 2008 R2"

image

Trust me, the first time you get to show this to someone who thinks that PowerShell is too complicated / tricky – you will feel like a rock star :-)

Cheers,
Ben

Leave a Comment
  • Please add 1 and 4 and type the answer here:
  • Post
  • for the second senario, it works only if you have the VM Name first following by the destination path.

  • Correct - the second version uses positional parameters (which are discussed here: msdn.microsoft.com/.../dd878252(v=vs.85).aspx)

  • Realmente estou muito empolgado com o windows SRV 8!!

    Fantástico!!

Page 1 of 1 (3 items)