I am looking to specify which compute node to reside on when creating an instance with Openstack ansible module openstack.cloud.server, Actually I want to ansiblealize the following command:
$ openstack server create --flavor g2 --image Ubuntu-20.04 --network public2 --security-group default --hypervisor-hostname compute3 --os-compute-api-version 2.74 test
# OR
$ openstack server create --flavor g2 --image Ubuntu-20.04 --network public2 --security-group default --host compute3 --os-compute-api-version 2.74 test
How I can pass --host or --hypervisor-hostname similar to Openstack CLI to openstack.cloud.server module in ansible???
Try to use
meta.hostnamedefine you hypervisor:meta:
Another way, it could use
availability_zoneparameter to select hosts:See also this example.