Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-977

VMware may fail to register VM if existing invalid VM is registered

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.2
    • 2.5
    • vcld (backend)
    • None

    Description

      Under some circumstances a VM may become invalid. It looks like this:

      VCL will fail to load a VM if an invalid VM exists on the host that is using the same .vmx file path as the new VM. As you can see in the image, there are 3 invalid VMs all using the same computer, vi1-154. Each VM had been loaded with a different image revision. If you attempt to load the same VM with any of the same revisions, the VMware host would not allow the new VM to be registered because it finds the existing invalid VM using the same .vmx path. The following appears in vcld.log:

      VIM_SSH.pm:_run_vim_cmd|265| ---- WARNING ----
      VIM_SSH.pm:_run_vim_cmd|265| 2016-07-27 11:35:17VIM_SSH.pm:_run_vim_cmd|265|attempt 1/5: failed to execute command on VM host blade1a5-3: vim-cmd solo/registervm "/vmfs/volumes/local/vi1-154_3705-v6/vi1-154_3705-v6.vmx", exit status: 1, output:
      VIM_SSH.pm:_run_vim_cmd|265| (vim.fault.AlreadyExists) {
      VIM_SSH.pm:_run_vim_cmd|265| faultCause = (vmodl.MethodFault) null,
      VIM_SSH.pm:_run_vim_cmd|265| name = "135",
      VIM_SSH.pm:_run_vim_cmd|265| msg = "The specified key, name, or identifier '135' already exists."
      VIM_SSH.pm:_run_vim_cmd|265| }
      VIM_SSH.pm:_run_vim_cmd|265| ( 0) VIM_SSH.pm, _run_vim_cmd (line: 265)
      VIM_SSH.pm:_run_vim_cmd|265| (-1) VIM_SSH.pm, vm_register (line: 1417)
      VIM_SSH.pm:_run_vim_cmd|265| (-2) VMware.pm, load (line: 548)
      VIM_SSH.pm:_run_vim_cmd|265| (-3) new.pm, reload_image (line: 634)
      VIM_SSH.pm:_run_vim_cmd|265| (-4) new.pm, process (line: 277)
      VIM_SSH.pm:_run_vim_cmd|265| (-5) vcld, make_new_child (line: 587)
      

      The code is not detecting the existing invalid VM because it is ignoring the Skipping invalid VM lines returned from vim-cmd vmsvc/getallvms:

      blade1a5-3:~ $ vim-cmd vmsvc/getallvms
      Skipping invalid VM '135'
      Skipping invalid VM '148'
      Skipping invalid VM '149'
      Vmid                     Name                                        File                           Guest OS       Version   Annotation
      162    vi1-152:win7-ISE716Test-3796-v3 (shared)   [local] vi1-152_3796-v3/vi1-152_3796-v3.vmx   windows7_64Guest   vmx-07
      

      The invalid VMs can be unregistered via vim-cmd vmsvc/unregister. The code could be updated to try to unregister invalid VMs if it fails to register a .vmx file.

      Attachments

        1. invalid.png
          17 kB
          Andrew Kurth

        Activity

          People

            arkurth Andrew Kurth
            arkurth Andrew Kurth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: