Rebuilding virtual machine swap files when swap files do not point to a replicated datastore
search cancel

Rebuilding virtual machine swap files when swap files do not point to a replicated datastore

book

Article ID: 311750

calendar_today

Updated On:

Products

VMware Live Recovery VMware vSphere ESXi

Issue/Introduction

This article provides steps to ensure your virtual machine is pointing at the appropriate virtual swap file.


Symptoms:


Environment

VMware ESXi 3.5.x Installable
VMware ESXi 4.1.x Embedded
VMware ESXi 4.0.x Installable
VMware vCenter Site Recovery Manager 4.0.x
VMware ESX 4.0.x
VMware vCenter Site Recovery Manager 1.0.x
VMware ESX Server 3.5.x
VMware vSphere ESXi 5.0
VMware ESXi 3.5.x Embedded
VMware ESX 4.1.x
VMware ESXi 4.0.x Embedded
VMware vCenter Site Recovery Manager 5.0.x
VMware vCenter Site Recovery Manager 4.1.x
VMware ESXi 4.1.x Installable

Resolution

For virtual machines that have virtual swap files located on datastores that are not replicated, you must configure the virtual machine to point to a different virtual swap file at the recovery site.
To configure the recovery site to use the proper swap file:
Caution: Shutdown the virtual machine and make backups of the .vmx file of the virtual machine before proceeding with these steps.
  1. Verify that the virtual swap file for this virtual machine is not on datastores (or SAN LUNs) that are being replicated. If virtual swap file is on a datastore that is being replicated, no action is required.
    If the .vmx file points to UUID and not a datastore name or relative path, proceed to the following step.
  2. Ensure that the name of the datastore that contains the swap file is the same at the production and recovery sites.
  3. Edit the .vmx file to point to the location of the datastore where the swap file is located.

    To edit the .vmx file:

    1. Open the .vmx file in text editor.
    2. Add or edit the setting sched.swap.dir to point to the correct datastore.

      For example:
      sched.swap.dir = "/vmfs/volumes/swap_directory_name"

    3. Remove any references to the sched.swap.derivedName setting. This is regenerated when the virtual machine is powered on.
    4. Save your changes and close the file.

  4. Power on the virtual machine.
  5. Verify using the Datastore Browser or the Service Console that a virtual swap file is created in the new datastore for the virtual machine:

    # ls
    /vmfs/volumes/swap_directory_name

    The output appears similar to:


    vm.vswp

  6. Verify this at the recovery site.
If more information or assistance with this procedure is required file a support request with VMware Technical Support and note this KB Article ID in the problem description. For more information, see "How to Submit a Support Request" .