Ask Your Question
0

selecting compute node to deploy an instance

asked 2019-02-28 09:59:04 -0500

arbermejo gravatar image

updated 2019-03-01 09:08:24 -0500

Hi, i recently added a new compute node to my Openstack Queens environment running on Ubuntu 18. Now i have an lxc compute node and one KVM compute node. Is possible in openstack to choose the compute node from where i want to deploy my new instance.

Note: i want to deploy a new lxc instance, but when i select the lxc image, the instance is been deployed in the kvm compute node node

UPDATE: I tried both solutions, with the ones of the host aggregate the containers can't find any bootable device, and then i tried to force my ubuntu image to the selected hypevisor (openstack image set --property hypervisor_type=lxc 9e4ada59-0776-4dc1-bce3-8499584c9c32) and this is the result

No valid host was found. There are not enough hosts available. Code 500 Details File "/usr/lib/python2.7/dist-packages/nova/conductor/manager.py", line 1120, in schedule_and_build_instances instance_uuids, return_alternates=True) File "/usr/lib/python2.7/dist-packages/nova/conductor/manager.py", line 717, in _schedule_instances return_alternates=return_alternates) File "/usr/lib/python2.7/dist-packages/nova/scheduler/utils.py", line 787, in wrapped return func(args, *kwargs) File "/usr/lib/python2.7/dist-packages/nova/scheduler/client/__init__.py", line 53, in select_destinations instance_uuids, return_objects, return_alternates) File "/usr/lib/python2.7/dist-packages/nova/scheduler/client/__init__.py", line 37, in __run_method return getattr(self.instance, __name)(args, *kwargs) File "/usr/lib/python2.7/dist-packages/nova/scheduler/client/query.py", line 42, in select_destinations instance_uuids, return_objects, return_alternates) File "/usr/lib/python2.7/dist-packages/nova/scheduler/rpcapi.py", line 158, in select_destinations return cctxt.call(ctxt, 'select_destinations', **msg_args) File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/client.py", line 174, in call retry=self.retry) File "/usr/lib/python2.7/dist-packages/oslo_messaging/transport.py", line 131, in _send timeout=timeout, retry=retry) File "/usr/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 559, in send retry=retry) File "/usr/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py", line 550, in _send raise result

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-02-28 18:25:45 -0500

One way is to create a host aggregate, add the host to the host aggregate, and create a flavor that links to that aggregate. First, ensure that the extra specs filter is enabled in nova.conf. Then the commands are roughly

openstack aggregate create MY-AGG
openstack aggregate add host <ID of MY-AGG> MY-HOST
openstack aggregate set <ID of MY-AGG> --property compute-type=lxc

Instead of compute-type and lxc, you can select your own names.

After this, you have an aggregate that contains your host and the lxc property. Next, create flavor and link it to the aggregate:

openstack flavor create lxc-flavor --id 12345  ...(other parameters)...
openstack flavor set 12345 --property aggregate_instance_extra_specs:compute-type=lxc

Users can now launch an instance with this flavor. It will be scheduled on a host in that aggregate.

Another option is to create images with the lxc hypervisor property. See https://docs.openstack.org/nova/lates....

edit flag offensive delete link more

Comments

can you explain please the parameter compute-type=lxc and aggregate_instance_extra_specs:compute-type=lxc

arbermejo gravatar imagearbermejo ( 2019-03-01 08:15:38 -0500 )edit

compute-type=lxc is a property I add to the aggregate. Properties are key-value pairs; both keys and values are defined by the user.

I then link the flavor to this aggregate using aggregate_instance_extra_specs:compute-type=lxc.

Bernd Bausch gravatar imageBernd Bausch ( 2019-03-01 08:20:27 -0500 )edit

The aggregate filter reacts to properties that are qualified with aggregate_instance_extra_specs. See https://docs.openstack.org/nova/lates....

Bernd Bausch gravatar imageBernd Bausch ( 2019-03-01 08:20:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-02-28 09:59:04 -0500

Seen: 102 times

Last updated: Mar 01