Search the VMware Knowledge Base (KB)
View by Article ID

Collecting information about tasks in VMware ESXi/ESX (1013003)

  • 47 Ratings

Symptoms

  • When there are troubleshooting issues with ESXi/ESX hosts and VMware vCenter Server, there may be differences between what vCenter Server and an ESXi/ESX host considers tasks.
  • An issue may occur when a task within vCenter Server times out. And when attempting to run other tasks, you see the error:

    Another task is already in progress.

Purpose

This article provides steps to collect information about tasks for ESXi/ESX hosts.

Resolution

Note: For more information on resolving the symptoms described above, see Restarting the Management agents on an ESXi or ESX host (1003490). If your problem is re-occurring, and you must determine which task the ESXi/ESX host is taking a long time to process.

To isolate the task, follow these steps for the appropriate host:

ESX hosts

To collect information about tasks for ESX hosts:

  1. Log into the ESX host at the console or via SSH. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
  2. To get a list of tasks on the host, run the command:

    vmware-vim-cmd vimsvc/task_list

    The output is similar to:

    (ManagedObjectReference) [
       'vim.Task:haTask-112-vim.VirtualMachine.createSnapshot-3887',
       'vim.Task:haTask-pool21-vim.ResourcePool.updateConfig-33252',
       'vim.Task:haTask-pool22-vim.ResourcePool.updateConfig-33253',
       'vim.Task:haTask-pool3-vim.ResourcePool.updateConfig-33254',
       'vim.Task:haTask-pool5-vim.ResourcePool.updateConfig-33255',
       'vim.Task:haTask-pool6-vim.ResourcePool.updateConfig-33256',
       'vim.Task:haTask-pool7-vim.ResourcePool.updateConfig-33257',
       'vim.Task:haTask-pool8-vim.ResourcePool.updateConfig-33258',
       'vim.Task:haTask-pool10-vim.ResourcePool.updateConfig-33260'
    ]


  3. To get a list of tasks associated to specific virtual machines, you must first get the Vmid of the virtual machine. Run the command:

    vmware-vim-cmd vmsvc/getallvms

    The output is similar to:

    Vmid  Name   File                        Guest OS              Version   Annotation
    112   VM-1   [Datastore] VM-3/VM-3.vmx   winLonghornGuest      vmx-04
    128   VM-2   [Datastore] VM-3/VM-3.vmx   winXPProGuest         vmx-04
    144   VM-3   [Datastore] VM-3/VM-3.vmx   winNetStandardGuest   vmx-04


  4. Make note of the values under the Vmid column as they are referenced in later steps.
  5. When you have the Vmid, you can then get a list of tasks associated with a specific virtual machine. Run the command:

    vmware-vim-cmd vmsvc/get.tasklist VMID

    Where VMIDis the number identified in step 4.

    The output is similar to:

    (ManagedObjectReference) [
       'vim.Task:haTask-112-vim.VirtualMachine.createSnapshot-3887'
    ]


  6. Make note of the task identifier. In the example above, the task identifier is:

    haTask-112-vim.VirtualMachine.createSnapshot-3887

  7. To get information about the status of a particular task, run the command:

    vmware-vim-cmd vimsvc/task_info task_identifier

    Where task_identifier is the string recorded in step 6.

    The output is similar to:

    (vim.TaskInfo) {
      dynamicType = <unset>,
      key = "haTask-112-vim.VirtualMachine.createSnapshot-3887",
      task = 'vim.Task:haTask-112-vim.VirtualMachine.createSnapshot-3887',
      description = (vmodl.LocalizableMessage) null,
      name = "vim.VirtualMachine.createSnapshot",
      descriptionId = "VirtualMachine.createSnapshot",
      entity = 'vim.VirtualMachine:112',
      entityName = "deploy-test",
      state = "running",
      cancelled = false,
      cancelable = false,
      error = (vmodl.MethodFault) null,
      result = <unset>,
      progress = 15,
      reason = (vim.TaskReasonUser) {
         dynamicType = <unset>,
         userName = "root",
      },
      queueTime = "2012-11-28T01:29:35.233835Z",
      startTime = "2012-11-28T01:29:35.234891Z",
      completeTime = <unset>,
      eventChainId = 2936866,
      changeTag = <unset>,
      parentTaskKey = <unset>,
      rootTaskKey = <unset>,
    }

ESXi hosts

To collect information about tasks for ESXi hosts:

  1. Log into the ESXi host at the console. For more information, see Tech Support Mode for Emergency Support (1003677).
  2. To get a list of tasks on the host, run the command:

    vim-cmd vimsvc/task_list

    The output is similar to:

    (ManagedObjectReference) [
       'vim.Task:haTask-112-vim.VirtualMachine.createSnapshot-3887',
       'vim.Task:haTask-pool21-vim.ResourcePool.updateConfig-33252',
       'vim.Task:haTask-pool22-vim.ResourcePool.updateConfig-33253',
       'vim.Task:haTask-pool3-vim.ResourcePool.updateConfig-33254',
       'vim.Task:haTask-pool5-vim.ResourcePool.updateConfig-33255',
       'vim.Task:haTask-pool6-vim.ResourcePool.updateConfig-33256',
       'vim.Task:haTask-pool7-vim.ResourcePool.updateConfig-33257',
       'vim.Task:haTask-pool8-vim.ResourcePool.updateConfig-33258',
       'vim.Task:haTask-pool10-vim.ResourcePool.updateConfig-33260'
    ]


  3. To get a list of tasks associated to specific virtual machines, you must first get the Vmid of the virtual machine. Run the command:

    vim-cmd vmsvc/getallvms

    The output is similar to:

    Vmid  Name   File                        Guest OS              Version   Annotation
    112   VM-1   [Datastore] VM-3/VM-3.vmx   winLonghornGuest      vmx-04
    128   VM-2   [Datastore] VM-3/VM-3.vmx   winXPProGuest         vmx-04
    144   VM-3   [Datastore] VM-3/VM-3.vmx   winNetStandardGuest   vmx-04


  4. Make note of the values under the Vmid column as they are referenced in later steps.
  5. When you have the Vmid, you can then get a list of tasks associated with a specific virtual machine by running the command:

    vim-cmd vmsvc/get.tasklist VMID

    Where VMID is the number identified in step 4.

    The output is similar to:

    (ManagedObjectReference) [
       'vim.Task:haTask-112-vim.VirtualMachine.createSnapshot-3887'
    ]


  6. Make note of the task identifier. In the example above, the task identifier is:

    haTask-112-vim.VirtualMachine.createSnapshot-3887

  7. To get information about the status of a particular task, run the command:

    vim-cmd vimsvc/task_info task_identifier

    Where task_identifier is the string recorded in step 6.

    The output is similar to:

     (vim.TaskInfo) {
      dynamicType = <unset>,
      key = "haTask-112-vim.VirtualMachine.createSnapshot-3887",
      task = 'vim.Task:haTask-112-vim.VirtualMachine.createSnapshot-3887',
      description = (vmodl.LocalizableMessage) null,
      name = "vim.VirtualMachine.createSnapshot",
      descriptionId = "VirtualMachine.createSnapshot",
      entity = 'vim.VirtualMachine:112',
      entityName = "deploy-test",
      state = "running",
      cancelled = false,
      cancelable = false,
      error = (vmodl.MethodFault) null,
      result = <unset>,
      progress = 15,
      reason = (vim.TaskReasonUser) {
         dynamicType = <unset>,
         userName = "root",
      },
      queueTime = "2012-11-28T01:29:35.233835Z",
      startTime = "2012-11-28T01:29:35.234891Z",
      completeTime = <unset>,
      eventChainId = 2936866,
      changeTag = <unset>,
      parentTaskKey = <unset>,
      rootTaskKey = <unset>,
    }

See Also

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 47 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 47 Ratings
Actions
KB: