Hi All,
Was in a task to move the 1000's of VM's swap file location to another datastore which is newly assigned to us from the existing swap file datastore which is going to be decomissioned.
Eager to check if any one did moving VM's swap file location from one datastore to another, and what all the steps taken to move.
Does it require VM downtime?
Thanks a ton in advance.
Yes it is possible without downtime to VMs.
1. Make sure your cluster is configured to use swap datastore specified by host
2. Take a host in the cluster to maintenance mode, change the VM swapfile location setting to point to new datastore
3. Do this for all the hosts in the cluster
When you vMotion a VM from one host to another the swap file will get moved to new datastore. Eventually when you take all the hosts to maintenance mode and release back, vMotion occurs for every VM in the cluster and swap file gets moved.
Yes it is possible without downtime to VMs.
1. Make sure your cluster is configured to use swap datastore specified by host
2. Take a host in the cluster to maintenance mode, change the VM swapfile location setting to point to new datastore
3. Do this for all the hosts in the cluster
When you vMotion a VM from one host to another the swap file will get moved to new datastore. Eventually when you take all the hosts to maintenance mode and release back, vMotion occurs for every VM in the cluster and swap file gets moved.
Thanks Prakash for your quick response.
I will try the steps given by you .. Thanks a lot.
this script will get the swap file location u can modify this to migrate to another datastore.
$dsTab = @{}
Get-Datastore | %{
$dsTab[$_.Name] = $_.FreeSpaceGB
}
Get-VM | %{
$ds = $_.ExtensionData.Layout.Swapfile.Split(']')[0].TrimStart('[')
$_ | Select Name,@{N="Swap DS";E={$ds}},@{N="Free GB";E={[math]::Round($dsTab[$ds],1)}}
}