Ask Your Question
0

how to pin a flavor type to a compute

asked 2016-09-25 07:53:41 -0500

vblando gravatar image

Im not sure if I read it somewhere but I do remember reading about pinning a flavor type to a compute.

Ex.

storage-optimized.large flavor should spawn the instance to my storage-optimized-compute-node-{1..10) memory-optimized.large flavor should spawn the instance to my memory-ooptimized-compute-node-{11..20}

something like that. I checked flavor extra_specs but I could not find it there or was it removed?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-09-25 10:43:26 -0500

dbaxps gravatar image

updated 2016-09-27 08:59:54 -0500

UPDATE 09/27/2016
Ugly workaround ( create bash script ) as admin

In shell loop ( X supposed to work as counter)
$ nova boot --image <uuid> --flavor m$X.large --key_name oskey092716 \
   --availability-zone nova:server$X
thus favor mx.large will boot nova instance on Compute Node serverx  (X=1,2,3,... or whatever you need )

I understand that it is worst case scenario if host-aggregates syntax won't help
END UPDATE

UPDATE 09/26/2016
Link 1 addresses questions
CPU Pinning in OpenStack

Reserving dedicated cores on the compute host(s) for host processes, avoiding host process and guest virtual machine instances from fighting for the same CPU cores;
Reserving dedicated cores on the compute host(s) for the virtual machine instances themselves;
Enabling the required scheduler filters;
Creating a host aggregate to add all hosts configured for CPU pinning to;
Creating a performance focused flavor to target this host aggregate; and
Launching an instance with CPU pinning!

Continue follow link 1 in your case I would try :-

$ nova aggregate-create storage
$ nova aggregate-set-metadata 1 storage=true
$ nova aggregate-create normal
$ nova aggregate-set-metadata 2 storage=false
$ nova flavor-key ID_OF_YOUR_STORAGE_OPTIMIZED set aggregate_instance_extra_specs:storage=true
$ nova aggregate-add-host 1 compute1.nova

======================================================================

Try this logic :-

[root@overcloud-controller-0 ~]# nova aggregate-create storage
+----+---------+-------------------+-------+----------+

| Id | Name    | Availability Zone | Hosts | Metadata |

+----+---------+-------------------+-------+----------+
| 1  | storage | -                 |       |          |
+----+---------+-------------------+-------+----------+

[root@overcloud-controller-0 ~]# nova aggregate-set-metadata 1 storage=true

Metadata has been successfully updated for aggregate 1.
+----+---------+-------------------+-------+----------------+
| Id | Name    | Availability Zone | Hosts | Metadata       |
+----+---------+-------------------+-------+----------------+
| 1  | storage | -                 |       | 'storage=true' |
+----+---------+-------------------+-------+----------------+


[root@overcloud-controller-0 ~]# nova aggregate-create normal
+----+--------+-------------------+-------+----------+
| Id | Name   | Availability Zone | Hosts | Metadata |

+----+--------+-------------------+-------+----------+

| 2  | normal | -                 |       |          |
+----+--------+-------------------+-------+----------+

[root@overcloud-controller-0 ~]# nova aggregate-set-metadata 2 storage=false
Metadata has been successfully updated for aggregate 2.
+----+--------+-------------------+-------+-----------------+
| Id | Name   | Availability Zone | Hosts | Metadata        |
+----+--------+-------------------+-------+-----------------+
| 2  | normal | -                 |       | 'storage=false' |
+----+--------+-------------------+-------+-----------------+
[root@overcloud-controller-0 ~]# nova flavor-key 3 set aggregate_instance_extra_specs:storage=true
[root@overcloud-controller-0 ~]# nova hypervisor-list
+----+-------------------------------------+-------+---------+

| ID | Hypervisor hostname                 | State | Status  |

+----+-------------------------------------+-------+---------+
| 1  | overcloud-novacompute-0.localdomain | up    | enabled |
| 2  | overcloud-novacompute-1.localdomain | up    | enabled |
+----+-------------------------------------+-------+---------+

[root@overcloud-controller-0 ~]# nova aggregate-add-host 1 overcloud-novacompute-1.localdomain
Host overcloud-novacompute-1.localdomain has been successfully added for aggregate 1
+----+---------+-------------------+---------------------------------------+----------------+
| Id | Name    | Availability Zone | Hosts                                 | Metadata       |
+----+---------+-------------------+---------------------------------------+----------------+

| 1  | storage | -                 | 'overcloud-novacompute-1.localdomain' | 'storage=true' |
+----+---------+-------------------+---------------------------------------+----------------+

[root@overcloud-controller-0 ~]# nova flavor-list
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

| ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |

+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 2  | m1.small  | 1000      | 20   | 0         |      | 1     | 1.0         | True      |
| 3  | m1.medium | 2000      | 20   | 0         |      | 1     | 1.0         | True      |

+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

[root@overcloud-controller-0 ~]# nova boot --flavor 3 --key-name oskey092616 \
                  --image 14359d87-0ae1-440d-ad6e-5a22f7f98d72  \
                  --nic net-id=2c7d77a1-7761-4a75-b3ae-57e234f83040 CentOS72Devs01

END UPDATE

I worked on this a while ago. However instructions from
http://redhatstackblog.redhat.com/201...
worked for me.

edit flag offensive delete link more

Comments

Hi,

I think that's another pinning topic, or is it related?

vblando gravatar imagevblando ( 2016-09-26 01:44:52 -0500 )edit

Could you post numactl --hardware ?

dbaxps gravatar imagedbaxps ( 2016-09-26 01:52:32 -0500 )edit

I updated answer . Link1 is related to your question , however it's major target is to allocate certain hosts on landscape for CPU pinning flavor. So it is not a perfect respond to your question. But it still addresses pinning created flavor to certain nodes.

dbaxps gravatar imagedbaxps ( 2016-09-26 02:30:25 -0500 )edit

thanks, this is very helpful.

vblando gravatar imagevblando ( 2016-09-27 05:48:15 -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: 2016-09-25 07:53:41 -0500

Seen: 269 times

Last updated: Sep 27 '16