OpenStack takes care of Instance scheduling automatically for us depending on flavour selected during Nova instance boot, however, many times, we might need to populate the instance on a specific hypervisor / Nova compute node.
To achieve this we need to specify the compute node at the stage, you select Flavour, Image etc.
First step would be to find out the nova availability-zone.
Next, List the hypervisors in your OpenStack cluster.
For example, we wish to launch an Instance, specifically to host
Source to the user managing the particular tenant and run command -
# nova boot --nic net-id=8df4cd26-9fb2-445a-a0ed-f5f7ffce5ade --flavor m1.tiny --image web Web-inst-osp2 --availability-zone nova:server-osp2.example.com
–availability-zonetakes nova availability zone along with Compute hostname on which the instance is to be populated.
In this case, as we are trying with a non-admin user and so we get error message. This is a privileged operation by default and is allowed only by admin user. This prevents OpenStack users from hosting a compute host by scheduling all of their resources there.
If this command still needs to be run as a regular user, we need to edit Nova policy, which imposes this restriction.
/etc/nova/policy.json file and change
and restart OpenStack Nova Service.
Now you should be able to run the command successfully and see the instance up and running.
Run the below mentioned command to check on which hypervisor / Compute node, the instance is running
# nova hypervisor-servers server-osp2.example.com
Happy Cloud Computing :)
Like it? Click here to Tweet your feedback