Configuring VM and storage movement
Hyper-V enables you to move VM details and VM storage to a new location. Moving a VM and moving a VM's storage are two important features you can use to manage your Hyper-V hosts.
Getting ready
In this recipe, you are going to move configuration details for the PSDirect VM within the HV1 server. Then, you move the entire VM to another server, HV2, and view the results. The two Hyper-V servers, HV1 and HV2, were set up in the Installing and configuring the Hyper-V recipe. The VM, PSDirect, was created in the Create a virtual machine recipe.
How to do it...
View the
PSDirectVM onHV1and verify that it is turned off:Get-VM -Name PSDirect -Computer HV1
Get the VM configuration location:
(Get-VM -Name PSDirect).ConfigurationLocation
Get virtual hard drive locations:
Get-VMHardDiskDrive -VMName PSDirect | Format-Table -Property VMName, ControllerType, Path
Move the VM's storage to the
C:\PSDirectNewfolder:$MHT = @{ Name = 'PSDirect' DestinationStoragePath...