packer-builder-vsphere
packer-builder-vsphere copied to clipboard
error creating vm: resource pool '<cluster>/resources/' not found
I'm trying to use the vSphere-iso builder but keep getting this error message. I am using a licensed vcenter instance, with 2 datacenters (I've specified the datacenter in the json). I have tried specifying the resource_pool and also omitting it.
Can anyone help me in getting this working? I've not used packer before so it could be something simple at my end.
here's the json content:
{
"builders": [
{
"type": "vsphere-iso",
"vcenter_server": "
I have specified values for the vcenter_server and password, but they have been sanitized from the above post.
Ok - I think I worked it out that you need to reference the full path to the cluster if its within a folder inside the vcenter. Documentation was not very clear on that. Can we update?
I am having the same issues. I am on VSphere 6.7
I have tried using:
- Cluster without Resource pool
--> vsphere-iso: error creating vm: resource pool '[cluster]/Resources/' not found - Cluster with Resource pool
--> vsphere-iso: error creating vm: resource pool '[cluster]/Resources/Pool1' not found - Host without Resource pool
--> vsphere-iso: error creating vm: resource pool '[host]/Resources/' not found - Host with Resource pool
--> vsphere-iso: error creating vm: resource pool '[host]/Resources/Pool1' not found
I found that I had to use the data center name in the path (as the vcenter has multiple data centers under it)
On Mon, 20 May 2019 at 8:11 pm, Dax T Games [email protected] wrote:
I am having the same issues. I am on VSphere 6.7
I have tried using:
- Cluster without Resource pool --> vsphere-iso: error creating vm: resource pool '[cluster]/Resources/' not found
- Cluster with Resource pool --> vsphere-iso: error creating vm: resource pool '[cluster]/Resources/Pool1' not found
- Host without Resource pool --> vsphere-iso: error creating vm: resource pool '[host]/Resources/' not found
- Host with Resource pool --> vsphere-iso: error creating vm: resource pool '[host]/Resources/Pool1' not found
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jetbrains-infra/packer-builder-vsphere/issues/235?email_source=notifications&email_token=AGL7PU3AR3JNFTCQZJDTIALPWLER7A5CNFSM4HGWXEI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZKLFI#issuecomment-494052757, or mute the thread https://github.com/notifications/unsubscribe-auth/AGL7PU72BPVQ64YXOKKLAEDPWLER7ANCNFSM4HGWXEIQ .
@pjolsen Can you post a Template that works? I only have on datacenter as I am doning this in a lab as a POC.
below is my current Template:
{
"builders": [
{
"type": "vsphere-iso",
"vcenter_server": "{{ user `vcenter_server` }}",
"username": "{{ user `vcenter_username` }}",
"password": "{{ user `vcenter_password` }}",
"insecure_connection": "true",
"datacenter": "{{ user `vcenter_datacenter` }}",
"datastore": "{{ user `vcenter_datastore` }}",
"cluster": "{{ user `vcenter_cluster` }}",
"host": "{{ user `vcenter_host` }}",
"folder": "{{ user `vcenter_folder` }}",
"vm_name": "{{ user `vm_name` }}-{{ timestamp }}",
"guest_os_type": "centos64Guest",
"communicator": "ssh",
"ssh_password": "{{ user `vm_ssh_password` }}",
"ssh_username": "{{ user `vm_ssh_username` }}",
"boot_command": [
"<tab>inst.text inst.ks=hd:fd0:/ks.cfg<enter><wait>"
],
"floppy_files": [
"{{template_dir}}/{{ user `kickstart_path` }}"
],
"iso_paths": [
"[{{ user `iso_datastore` }}] {{ user `iso_path` }}"
],
"CPUs": 1,
"RAM": "{{ user `vm_memory` }}",
"network": "{{ user `vm_network` }}",
"disk_size": "{{ user `vm_disk` }}",
"disk_thin_provisioned": true,
"convert_to_template": "true"
}
]
}
which results in:
$> packer build -var-file=centos7-jetbrains-vars.json centos7-jetbrains.json
vsphere-iso output will be in this color.
==> vsphere-iso: Creating VM...
Build 'vsphere-iso' errored: error creating vm: resource pool 'test-cluster/Resources/' not found
==> Some builds didn't complete successfully and had errors:
--> vsphere-iso: error creating vm: resource pool 'test-cluster/Resources/' not found
==> Builds finished but no artifacts were created.
It is working today. No idea why but I am successfully building templates.
sorry for the delay in responding... as I said, I needed to add the parent folder into the cluster variable in addition to the name of the cluster. See below which seems to execute as expected:
{ "builders": [ { "type": "vsphere-iso", "vcenter_server": "myvcenter", "username": "[email protected]", "password": "somepass", "insecure_connection": "true", "vm_name": "packer", "datacenter": "DC1", "cluster": "ParentFolder/Cluster1", "datastore": "windowsvol", "guest_os_type": "windows9_64Guest", "communicator": "winrm", "winrm_username": "jetbrains", "winrm_password": "jetbrains", "CPUs": 1, "RAM": 4096, "RAM_reserve_all": true, "disk_controller_type": "pvscsi", "disk_size": 32768, "disk_thin_provisioned": true, "network_card": "vmxnet3" } ] }
I had the same problem. Solved it by specifing the cluster name two times, dont know why thats needed. Like this: "cluster": "clusterName/clusterName"
I ran into this today also. The location-configuration docs and Working with Clusters and Hosts explain that there are some nuances to how/when you need to specify host and/or cluster and/or resource_pool. In my case I'm using "Clusters Without DRS" and I was specifying host but not cluster. When I added cluster to my packer template this error went away.
And there was nothing odd about the syntax of my cluster specification. I scraped the cluster names from my vcenter using:
[tblack-stretch]src/cm/packer/debian10 > curl -k -X GET -H "vmware-api-session-id: $VMSID" https://myvcenter/rest/vcenter/cluster | jq
{
"value": [
.
.
{
"drs_enabled": false,
"cluster": "domain-c80",
"name": "MyCluster",
"ha_enabled": true
}
]
}
and simply plugged in the value for cluster "name".
Had the same issue but for me it was as simple as making sure I copied the name of my cluster to my template since it is case sensitive.
Be sure your packer config is getting the full path to the cluster/host! If your cluster/host is in a folder, include the folder when telling packer what host you're using. This solved the issue for me.