VMware Cloud Community
JDMils_Interact
Enthusiast
Enthusiast

Storage migration leaves VM swap files on original datastore

I have the following VMs on the datastore called "SAN_T0_NOR-001":
* sldc01
* vcdp02
* vcdp03

I performed a storage vMotion of the VMs to a new datastore called "nfs_vmdata_t2048_br_01", however when I view the datastore "SAN_T0_NOR-001", the VMs still appear there.

I logged into the ESXI host and checked the datastore "SAN_T0_NOR-001" and found the following:

[root@vmhep01:/vmfs/volumes/5a29e956-8e21a2aa-1b68-98be942a7ae2] ls -l
total 50507808
drwxr-xr-x 1 root root 1120 Dec 10 2020 ISO
drwxr-xr-x 1 root root 980 Dec 22 2017 RHEL7_Patched_20151027
drwxr-xr-x 1 root root 1400 Jan 11 2018 W2K12R2dc_SOE_v2_20160318
-rw------- 1 root root 25769803776 Jun 17 06:37 vcdp02-cab3cd2a.vswp
-rw------- 1 root root 25769803776 Jun 17 06:41 vcdp03-cab3cd2b.vswp
drwxr-xr-x 1 root root 1120 Mar 28 2018 proxy_centos7_template_1
-rw------- 1 root root 90177536 Jun 17 06:37 vmx-vcdp02-3400781098-1.vswp
-rw------- 1 root root 90177536 Jun 17 06:41 vmx-vcdp03-3400781099-1.vswp
[root@mhep01:/vmfs/volumes/5a29e956-8e21a2aa-1b68-98be942a7ae2]

I checked the vmx file for VM "vcdp02" and found the following entry:
sched.swap.derivedName = "/vmfs/volumes/5a29e956-8e21a2aa-1b68-98be942a7ae2/vcdp02-cab3cd2a.vswp"

I checked the volume "5a29e956-8e21a2aa-1b68-98be942a7ae2" and found it is the volume to which I storage migrated the VM:
lrwxr-xr-x 1 root root 17 Jun 19 23:49 nfs_vmdata_t2048_br_01 -> 58a59fed-1b459629

When I list the hard disks in the VM in the web client, I do not see a reference to the source datastore "SAN_T0_NOR_001".

Am I to believe that the swap file is located both at the source datastore "SAN_T0_NOR_001" and the target datastore "nfs_vmdata_t2048_br_01"?

How do I fix this now that the VM is storage migrated to the new datastore?

How do I stop this from happening again in future storage migrations? Note that the datastore "SAN_T0_NOR_001" was set as the host swap datastore and the Cluster swap datastore BEFORE I migrated the VM. I have since changed these settings to the new datastore "nfs_vmdata_t2048_br_01".

I'm assuming that for future storage migrations, I will need to set the cluster & hosts' swap datastore locations to the new datastore first then any VM with swap files on the source datastore will need to be powered off then back on again for the new swap datastore location to be 'activated'?

vSphere 6.7, ESXi 6.7

Labels (1)
0 Kudos
0 Replies