Collect a complete memory dump on a MCS (non-persistent) machine on XenServer (Citrix Hypervisor)

Collect a complete memory dump on a MCS (non-persistent) machine on XenServer (Citrix Hypervisor)

book

Article ID: CTX261722

calendar_today

Updated On:

Description

This article outlines the steps to collect complete memory dump on a MCS (non-persistent) machine on XenServer (Citrix Hypervisor).
Often we are not able to get the memory dump in instances where MCS provisioned VDAs show behaviors like unresponsiveness/hang. The reason being the machine fails to save the data on the drive because it is a non-persistent drive that gets recreated after every reboot.


Instructions

Follow these steps to collect complete memory dump on MCS provisioned machines on XenServer (Citrix Hypervisor).

Add a secondary disk that is not MCS-managed

  1. In XenCenter, go to the VM's Storage tab and click Add.
  2. Give the disk a name (for example, "Data").
  3. Set the size to large enough to collect the logs (for example, 50 GiB). Try to have at least 4 times that amount of RAM on the VM, plus 25 GB. (You need the 25GB free space to avoid the files being deleted.)
  4. Click Add.
  5. In the Windows VM, go to Run > diskmgmt.msc.
  6. In the Initialize Disk window that opens, select the disk, set the partition type to GPT, and click OK.
  7. At the bottom of the Disk Management window, in the unallocated section of the new disk, right-click and select New Simple Volume.
  8. Go through the pages of the New Simple Volume Wizard:
    1. Assign the disk to a letter driver. In this article, we use "E:".
    2. Give the volume a name, for example "Secondary".

Configure Windows to write the logs to the secondary disk

  1. Go to System Properties > Advanced System Settings > Advanced >  Startup and Recovery > System failure
    Ensure the settings are as in the following image:
    • Select Automatically restart.
    • For Write debugging information, select Automatic memory dump.
    • For Dump file, specify a location for the dump file on the non-MCS managed drive: E:\MEMORY.DMP
    • Select Overwrite any existing file.
  2. Go to System Properties > Advanced System Settings > Advanced > Performance > Advanced. 
  3. Under Virtual Memory, click Change.
  4. Uncheck Automatically manage paging file size for all drives.
  5. Keep the initial size and the maximum size as equal to the RAM size + 100 MB. Click Set > OK > OK.
  6. In the Registry Editor, go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CrashControl
  7. Make sure the highlighted values are as follows (DumpFileSize = RAM + 100 MB):
    • CrashDumpEnabled = 1
    • DedicatedDumpFile = E:\dedicateddumpfile.sys
    • DumpFile = E:\MEMORY.DMP
    • DumpFileSize = 2000
  8. The machine is now ready to capture the dump inside the additional drive (E: - Non MCS managed).
  9. Update the catalog so that the registry and system properties settings are updated to the VDAs.

Capture the dump

Reproduce the problem and when ready to capture the dump, you can crash the VM from XenServer (if not crashed already) by doing the following:

  1.  Run the following command to obtain the domain ID from the VM from which you would like to collect a memory dump:
    xe vm-param-get uuid=<vm_uuid> param-name=dom-id
  2. Capture the ID obtained from the above command and then run the following to crash the VM:
    xl trigger <dom_id> nmi
  3. Wait for the Windows VM to finish capturing the logs and to restart.
  4. In the VM, navigate to the E: drive and view the MEMORY.DMP file.

 

    Additional Information

    https://support.microsoft.com/en-in/help/969028/how-to-generate-a-kernel-or-a-complete-memory-dump-file-in-windows-ser