For Example, I have 3 Compute servers and I want to have 1 Specific Instance on each of them and I want to have Node Affinity on them.
- instance_1 --> compute_node_1 (Always on this node)
- instance_2 --> compute_node_2 (Always on this node)
- instance_3 --> compute_node_3 (Always on this node)
I know there is a "Senlin" service. But how to use it exactly? Or if there is another solution?
Don’t.
You should not use a cloud platform when you want to treat your compute instances and hypervisors as old fashioned legacy IT and try to get load/VM’s to behave completely deterministic.
Having said that :
The normal method open to an OpenStack tenant: a server group with an anti affinity rule, will ensure that, load permitting , the scheduler will ensure that their compute instances run on different hypervisors.
As an OpenStack administrator you can place each hypervisor in its own availability zone. The tenant can then place their compute instances in specific AZ’s to create an even stronger separation than an anti affinity rule would be able to achieve.
I’m unfamiliar with Senlin
You don't need Senlin. You can create a server group with an anti-affinity policy (i.e. a policy that spreads servers over compute nodes), then launch your instances in that group.
The Nova-Scheduler anti-affinity filter must be enabled. Note that there is no guarantee that instances are scheduled in the desired way; for example, if a compute node has no capacity left, it won't be used.
See https://docs.openstack.org/nova/victoria/admin/configuration/schedulers.html#servergroupantiaffinityfilter for details.
There is another option: In one of the recent Nova releases (Xena, Wallaby or Victoria), it has become possible for an admin to ask for a specific compute node when launching an instance. Please see the release notes for more detail.