Error when checking out VM Template from Content Library
search cancel

Error when checking out VM Template from Content Library

book

Article ID: 429830

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Check out or deploy operations on the VM Template fail with a file not found error

From /var/log/vmware/content-library/cls.log on the vCenter:

 

<timestamp> | ERROR    | md3601u9-12229512-auto-####-h5:#########-b6-e1-33 | cls-simple-activity-19    | SimpleActivityWorker           | Exception will not be handled by activity CheckOutVpxdActivity (handle=72495e1a-####-####-####-090dc9018b2c, entityId=cb3174f4-####-####-####-8ab639c3f0bc): File [<DATASTORE_NAME] <VM_TEMPLATE_NAME>/<VM_TEMPLATE_NAME>-Snapshot1.vmsn was not found

 

Checking the datastore mentioned in the log or on the VM Template in Content Library on an ESXi with access, shows that there's no VM files for the VM Template present on it

VM files were moved around recently outside of the vCenter's scope; possibly due to adding new datastores

Environment

vSphere 8.0 U3

Cause

VM Template items in Content Library are stored on the datastore which the VM was on at the time the VM Template was created

When attempting to deploy/check out based on the VM Template; Content Library expects the VM files to be in the same location 

Resolution

Manually move the VM Template files back to the original location to deploy the VM

Method 1 - using an ESXi host that has access to the datastore:

  • SSH to the ESXi host
  • To copy the files back to old datastore, first move to the datastore content library specified

cd /vmfs/volumes/<OLD_DS_NAME>

  • Create a directory with the exact same name as the template:

mkdir <TEMPLATE_NAME>

  • Move to the location of the template on the new datastore

cd /vmfs/volumes/<NEW_DS_NAME>/<TEMPLATE_NAME>

  • Copy the contents to the directory created on the old datastore - this will take time to complete depending on the size of the files:

cp * /vmfs/volumes/<OLD_DS_NAME>/<TEMPLATE_NAME>

 

Method 2 - using datastore browser on vCenter/ESXi:

  1. Login to the vCenter/ESXi UI and navigate to the datastore where the files currently are
  2. Download them locally
  3. Navigate to the datastore content library specified
  4. Create a directory with the exact same name as the template
  5. Upload the files to this directory

 

After doing either method above, deploy the VM from the VM Template. 

 

To save again as a VM Template in a desired, accessible location:

  1. Storage vMotion the VM to the desired datastore
  2. Right click the VM and select clone -> clone as template to library
  3. Update the values as desired in the wizard and then the VM template will be created in content library