Ask Your Question
0

Issue with openstack flavor set

asked 2017-06-19 04:00:50 -0600

CDOT gravatar image

I am creating a new flavor viz., test.small using the command :

openstack flavor create --public test.small --ram 512 --disk 2 --vcpus 1

On launching an instance using test.small flavour and running cat /proc/cpuinfo on the instance, the number of CPUs shows to be 1 and number of cores in the CPU is also 1.

I wanted to change the number of cores in the VCPU to 4. So, I ran the command (in controller node):

openstack flavor set test.small --property hw:cpu_cores=4

To verify the change, I ran :

openstack flavor show test.small

The change reflected in the output of the above command as :

 |properties                 | hw:cpu_cores='4'          |

Then I hard-rebooted the instance and ran cat /proc/cpuinfo on it. The number of VCPU is still 1, as expected. But the number of cores still shows as 1 and NOT 4 . How to proceed?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2017-06-19 10:02:57 -0600

The flavor set command just adds a key-value pair to the flavor. You can use it, for example, to link the flavor to an aggregate, or to influence the Nova scheduler, but it doesn't change any of the fundamental flavor parameters (CPU, disk, RAM). Run openstack flavor list or flavor show and check the number of CPUs - it doesn't change.

You can see that there is no Nova command that changes the number of CPUs. There is also no API to update a flavor in the way you want it.

The only solution, afaik, is deleting and recreating your flavor.

edit flag offensive delete link more

Comments

I edited the libvirt.xml of the instance:

<vcpu>4</vcpu>
<topology sockets="1" cores="4" threads="1"/>

I followed this. Number of cores now is 4 but the number of CPUs is also 4. I want 1 CPU 4 cores.

CDOT gravatar imageCDOT ( 2017-06-20 05:34:14 -0600 )edit

Obviously I didn't read your question correctly. I had not seen that you needed cores rather than CPUs.

Bernd Bausch gravatar imageBernd Bausch ( 2017-06-20 07:02:12 -0600 )edit

Perhaps this page helps, in particular the remark "the product of sockets multiplied by cores multiplied by threads must equal the number of instance vCPUs".

Bernd Bausch gravatar imageBernd Bausch ( 2017-06-20 07:09:46 -0600 )edit
0

answered 2017-06-19 08:14:59 -0600

tkokok gravatar image

rebuilt the instance? i guess that u just modify the flavor but not instance

edit flag offensive delete link more

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: 2017-06-19 04:00:50 -0600

Seen: 890 times

Last updated: Jun 19 '17