Thursday, August 22, 2013

Commands to monitor snapshot deletion in ESX 2.5/3.x/4.x and ESXi 3.x/4.x/5.x (1007566)

ESX 3.5/4.x and ESXi 4.1/5.x

To monitor directories during snapshot deletion in ESX 3.5/4.x and ESXi 4.1/5.x: 

  1. Log in as root to the ESX host using SSH. For more information, see Connecting to an ESX host using a SSH client (1019852) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.0 (1017910)
  2. Navigate to the virtual machine directory containing vmdk virtual disk files.
  3. List files in the directory by executing:

    # ls -al
  4. Determine any VM_NAME-00000#.vmdk or VM_NAME-00000#-delta.vmdk snapshot files. Look for numbered files following the hyphen(-) in the name.
  5. To monitor the VMDK snapshot and base disks which are currently being updated use the following watch command:

    # watch -d 'ls -luth | grep -E "delta|flat"'

    -d  highlights the differences between successive updates
    t   sorts by modification time
    l   shows a long listing which displays additional file information    sorts by and shows access time
    h   prints sizes in a readable format like 1K 234M 2G
    You can also run the following command to monitor the time stamp update of the base disks to confirm if the process is working or not.

    ls -lrt |grep -E "flat|delta"

    This command monitors the contents of a directory and displays files by their modification date.

    Note: In ESX 3.5 and 4.0 (pre Update 2) the snapshot delta files will be written to the previous snapshot delta file and so on and are finally written to the base disk (flat). In ESX/ESXi 4.0 Update 2 and later the process works differently in that the data in snapshots (deltas) are written directly to the base disk (flat). For more information on the snapshot process, see Understanding virtual machine snapshots in VMware ESXi and ESX (1015180) and Consolidating snapshots (1007849).

    If there are more than 10 snapshots, use this command to monitor the snapshot commit process and to prevent the screen from filling with too many files:

    # while true;do date;ls -lht *vmdk|head -10;echo ________;sleep 3;done

    Note: You can quit the consolidation process monitoring by pressing Ctrl + C. 

No comments: