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?
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.
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.
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.
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.
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.