Ok, we all know what Storage VMotion is…
- Before moving disk files, Storage VMotion creates a new virtual machine home directory for the virtual machine in the destination datastore.
- Next, a new instance of the virtual machine is created. Its configuration is kept in the new datastore.
- Storage VMotion then creates a child disk for each virtual machine disk that is being moved to capture a copy of write activity, while the parent disk is in read only mode.
- The original parent disk is copied to the new storage location.
- The child disk is re-parented to the newly copied parent disk in the new location.
- When the transfer to the new copy of the virtual machine is completed, and the original instance is shut down. Then, the original virtual machine home is deleted from VMware vStorage VMFS at the source location.
But if you are not lucky enough to be running vSphere where there is a fully supported integrated Virtual Infrastructure client option for SVMotion ?
There is the VMware unsupported method which most of us are unable to use in a corporate environment and especially not in production – SVMotion Plugin
Or there is the Remote CLI method which to me seams a little hard, well compared to the next one I’m going to show you.
Did you know you can also use SVMotion via PowerCLI ?!? Well you can and look how easy it is:
Get-VM “MyVM“ |Move-VM -datastore (Get-datastore “MyDatastore“)
The Move-VM Cmdlet covers a multiple of sins, lets check some out, you want VMotion:
Get-VM -Name “MyVM“ |Move-VM -Destination (Get-VMHost MyHost)
And also what you would expect, moving a VM to a new folder:
Move-VM -VM (Get-VM -Name MyVM)-Destination (Get-Folder -Name Production)
And moving a VM to a new resource pool, what a multifunctional cmdlet this is !
Move-VM -VM (Get-VM -Name MyVM)-Destination (Get-ResourcePool -Name “Important“)