VMware {code} Community
kedarjk
Enthusiast
Enthusiast
Jump to solution

Deploying template fails with an error

I am trying to deploy a vm template using the perl script attached.

The error I am getting is as below:

The request refers to an unexpected or unknown type.

I think it is failing because of incorrect resource pool. In my vcenter setup which has 4 ESXi servers, there is currently no resource pool created but there are 2 clusters available.

Is there a way I can deploy template without using resourcepool option?

Reply
0 Kudos
1 Solution

Accepted Solutions
kedarjk
Enthusiast
Enthusiast
Jump to solution

It worked successfully when I changed the value of folder as $_->parent in the script.

eval {

$_->CloneVM( folder => $_->parent, name => $vmname, spec => $clone_spec );

Util::trace (0, $vmname . " (template " . $sourcevm . ") successfully deployed.\n");

};

It was failing when I was keeping deploy location (folder) as cluster or datacenter or host.

In case of a template, its parent is the 'root' folder and there only it successfully deployed.

View solution in original post

Reply
0 Kudos
4 Replies
stumpr
Virtuoso
Virtuoso
Jump to solution

Yes, there is a default resource pool (the root resource pool) that's in both clusters and standalone hosts. For Clusters, it will be named "Resources".  You can get it from the ClusterComputeResources by using the property resourcePool.

Reuben Stump | http://www.virtuin.com | @ReubenStump
Reply
0 Kudos
kedarjk
Enthusiast
Enthusiast
Jump to solution

I checked the resource pool in use, it is using 'Resources' only. But it is still failing with the same error: "The request refers to an unexpected or unknown type."


I have verified that if I select the same datastore and cluster during manual deployment, it deploys successfully.



Reply
0 Kudos
stumpr
Virtuoso
Virtuoso
Jump to solution

Run the script with --verbose=10, capture the XML output of the deploy XML block.  You can also look at the vpxd.log file on the vCenter server.  It may indicate which property is generating the error.

Reuben Stump | http://www.virtuin.com | @ReubenStump
kedarjk
Enthusiast
Enthusiast
Jump to solution

It worked successfully when I changed the value of folder as $_->parent in the script.

eval {

$_->CloneVM( folder => $_->parent, name => $vmname, spec => $clone_spec );

Util::trace (0, $vmname . " (template " . $sourcevm . ") successfully deployed.\n");

};

It was failing when I was keeping deploy location (folder) as cluster or datacenter or host.

In case of a template, its parent is the 'root' folder and there only it successfully deployed.

Reply
0 Kudos