Converting a virtual machine template to a new virtual machine fails
search cancel

Converting a virtual machine template to a new virtual machine fails

book

Article ID: 343160

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • Converting a virtual machine template to a new virtual machine fails before the host selection.
  • When you convert or deploy a template, you see the warning:

    Validation not applicable at this time

  • You see any of the below errors:

    This Host or Cluster is not Valid Selection.
    A component of the virtual machine is not accessible on the host.


Environment

VMware vCenter Server 5.5.x
VMware vCenter Server 4.1.x
VMware vCenter Server 5.0.x
VMware vCenter Server 5.1.x
VMware vCenter Server 4.0.x

Cause

This issue occurs when the template configuration (.vmtx) file references datastores no longer accessible by the ESXi/ESX host that the template is registered on.

Resolution

To resolve this issue, check if the template configuration (. vmtx) file references any datastores no longer accessible by the ESXi/ESX host that the template is registered on.
Note: This includes an ISO that is still mounted on the template's virtual CD-ROM.
To check if the template configuration (. vmtx) file references any datastores no longer accessible by the ESXi/ESX host that the template is registered on:

  1. Connect to the host that the template currently resides on. For more information, see Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
  2. Unregister the virtual machine from vCenter Server. Right-click the virtual machine and click Remove from Inventory.
  3. Go to the . vmtx file of the virtual machine by going to the Virtual Machines File System (VMFS) volume.

    cd /vmfs/volumes/LUN_A/virtualmachine

  4. Take a backup of the . vmtx file by running this command:

    cp vm_name.vmtx vm_name.bak

  5. Open the virtual machine name.vmtx file using the VI editor. For more information, see Editing files on an ESX host using vi or nano (1020302).
  6. Review these lines to ensure the datastores and files are still valid.

    1. If any idex:x.fileName or scsix:x.fileName reference a datastore or file that no longer exists on the ESXi/ESXi host, remove it using the VI editor:

      ide1:0.fileName = "/vmfs/volumes/<datastore>/<filename>.iso"

      scsi0:0.fileName = " "

      Note: By default, the virtual CDROM is ide1:0 for the virtual machine.

    2. Review all scsi or ide lines.

  7. Save and close the virtual machine name.vmtx file.
  8. Re-register the template on the host. For more information, see Registering or adding a virtual machine to the inventory on vCenter Server or on an ESX/ESXi host (1006160).


Additional Information

How to register/add a VM to the Inventory in vCenter Server
Using Tech Support Mode in ESXi 4.1, ESXi 5.x, and ESXi 6.x
Editing files on an ESX host using vi or nano