-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmware_resource_pool: cluster_name should not be required #492
Comments
@dmelha Thanks for reporting this issue. Also, while creating a new resource pool, we need to specify the parent resource pool under which new resource pool will be created. To get the value of the parent resource pool, cluster is required value. We can add support I hope this makes sense. Thanks. @sky-joker @goneri @mariolenz What do you think about this? |
I'm working with multiple vcenters/datacenters/esxi hosts, that are not organized in clusters but having separate resource_pools defined per host. vmware does in no way require a cluster to be defined for a resourcepool to be created on an esxi host.
while i don't know the details of the vmware API(s) + pyvmomi (yet), looking at govc/govmomi maybe helps, as govc can create a resource_pool on an esxi host without specifying any cluster or parent resource pool - i just need to specify datacenter & esxi host there via |
@dmelha Thanks for providing information. I tried -
Where 10.65.201.106 is esxi. Do you know what is wrong here? |
@Akasurde I can only guess that the parent folder(?) (maybe of type vim.ComputeResource) named "Resources" is missing on that host!? |
Nope, a ResourcePool is associated with a ComputeResource. In most cases, I should say this will be a cluster (there might be use cases for stand-alone ESXi hosts but HA and DRS are something I don't want to miss) but it doesn't have to be. A ClusterComputeResource is just sub-type of ComputeResource. I'll try to have closer look at his. |
@dmelha As far as I understand, you connect to a vCenter and want to configure a resource pool on an ESXi host instead of a cluster. You do not want to connect to the ESXi host directly and configure a resource pool. Is this correct? |
@mariolenz yes, I connect to a vcenter, and want to create resource pool on a specific esxi host. I do not want to directly connect to the esxi host for resource pool creation. sidenote: While I understand this seems like a feature request to you, to me it seems like a bug, as the vsphere api supports this use case, but the resource_pool module inhibits this use case. |
Great! I hope this'll be easier to implement :-) @sky-joker @Tomorrow9 Do you, by any chance, know how to get the ComputeResource object of an ESXi host? Does it, possibly, have the same name? Unfortunately, I'm away on leave at the moment and don't have access to our environment to check this myself. |
For the record: import ssl
from pyVim import connect
from pyVmomi import vim
context = ssl._create_unverified_context()
si = connect.SmartConnect(host="vcenter.example.com", user="[email protected]", pwd="T0pS3cret!", port=443, sslContext=context)
content = si.content
container = content.viewManager.CreateContainerView(content.rootFolder, [vim.ComputeResource], True)
for managed_object_ref in container.view:
print(managed_object_ref.name) This finds all clusters (ClusterComputeResource is a sub-type of ComputeResource) and all hosts (ComputeResource) that are not part of a cluster. I've removed one host from a cluster (esx1.example.com) and now there's a ComputeResource with this name. |
jfyi i used this hacky custom module as a (temporary) workaround for now: https://gist.github.com/dmelha/9b25d757e9f075c045b82dce784b8cd6 |
SUMMARY
when creating a resource pool using module vmware_resource_pool it should not be required to specify cluster when instead an esxi-host is specified (e.g.
esxi_hostname: foobarhost
) - this problem was part of this issue here but was not resolved - see: ansible/ansible#38300 (comment)ISSUE TYPE
COMPONENT NAME
vmware_resource_pool
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: