Freigeben über


Using PowerShell to Storage Migrate with Windows Server “8”

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

Comments

  • Anonymous
    March 13, 2012
    for the second senario, it works only if you have the VM Name first following by the destination path.

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

  • Anonymous
    March 13, 2012
    Realmente estou muito empolgado com o windows SRV 8!! Fantástico!!

  • Anonymous
    January 15, 2015
    The comment has been removed