Sponsored

Not the solution you were looking for?

We’ll help you out!

How to start a VM on a Specified Host/Compute Node in OpenStack Mitaka?

With the appropriate permissions, the user can launch VM on a specified host/compute node in OpenStack Mitaka. All you need to do is to use –availability_zone zone:host argument while executing openstack server create command as shown below:

In order to perform this operation, you need to set which roles can launch an instance on a specified host using create:forced_host option in policy.json under nova configuration folder. By default this option is enabled for only the admin role.

So, open the file /etc/nova/policy.json file and change the below line:

It clearly shows that the policy set by administrator doesn’t allow a normal user to schedule an instance onto a particular node. The solution is to create a rule that allows even a normal user to schedule a VM onto a particular host as shown below:

Open the file /etc/nova/policy.json file on the controller node and change to the below:

"os_compute_api:servers:create:forced_host": "rule:admin_api",

to

"os_compute_api:servers:create:forced_host": "",

And restart the nova-api service as shown below:

#/etc/init.d/nova-api restart

Note: These changes need not be made in compute nodes.

Now as a normal user, you should be able to start a VM on a particular host.