create of flavor should be in 512MB multiplication for memory

Bug #1317189 reported by Dafna Ron
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Undecided
Unassigned

Bug Description

when we create a flavor, the limitation for the MB is bigger than 0.
however, we are simulating a computer and memory comes in 512MB multiplication
So we should not allow create of instance which is not in 512MB multiplication

[root@puma32 ~(keystone_admin)]# nova flavor-create Dafna_cli 91 300 6 1
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 91 | Dafna_cli | 300 | 6 | 0 | | 1 | 1.0 | True |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+

[root@puma32 ~(keystone_admin)]# nova flavor-list
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
| 9 | TEST1 | 512 | 6 | 0 | | 1 | 1.0 | True |
| 91 | Dafna_cli | 300 | 6 | 0 | | 1 | 1.0 | True |
| 92 | Dafna_cli1 | 1 | 6 | 0 | | 1 | 1.0 | True |
| e58fd866-46a5-4f43-8edd-769b8f31b5a1 | TEST | 512 | 6 | 0 | | 1 | 1.0 | True |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
[root@puma32 ~(keystone_admin)]# nova flavor-show Dafna_cli
+----------------------------+-----------+
| Property | Value |
+----------------------------+-----------+
| name | Dafna_cli |
| ram | 300 |
| OS-FLV-DISABLED:disabled | False |
| vcpus | 1 |
| extra_specs | {} |
| swap | |
| os-flavor-access:is_public | True |
| rxtx_factor | 1.0 |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 6 |
| id | 91 |
+----------------------------+-----------+
[root@puma32 ~(keystone_admin)]#

Revision history for this message
Juan Manuel Ollé (juan-m-olle) wrote :

Why should be base 512? perhaps base 2, you could create a VM with 256 or 768 (I had once a machine with that memory size :) )

Revision history for this message
Dafna Ron (dron-3) wrote :

the problem would come when you use operating systems which cannot support different types of memory (not naming names ;)).
it used to cause blue screens (again, not naming names ;) but perhaps they also improved with time - I have yet to check an installation of one on openstack (on my to-do list)

Revision history for this message
Juan Manuel Ollé (juan-m-olle) wrote :

But what about using less memory, for example m1.nano has 64 Mb.
IMHO checking that he memory is base2 is a valid check when creating a flavor. And I could implement it.

As a note, the machine I had with 768 MB had an OS I suppose you are talking about :)

Revision history for this message
Dafna Ron (dron-3) wrote :

long ago in a galxy far far away I had an old computer that I ran 512+256 memory sticks and it worked ok most of the time so come to think of it, as long as it is HW supported we should be able to run it virtually right?

I agree that checking that the memory base is valid is a good idea.

Revision history for this message
Juan Manuel Ollé (juan-m-olle) wrote :

Sorry I changes names, I mean nova and not novaclient

Changed in python-novaclient:
assignee: nobody → Juan Manuel Ollé (juan-m-olle)
affects: python-novaclient → nova
Changed in nova:
assignee: Juan Manuel Ollé (juan-m-olle) → nobody
assignee: nobody → Juan Manuel Ollé (juan-m-olle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/93467

Changed in nova:
status: New → In Progress
Revision history for this message
Juan Manuel Ollé (juan-m-olle) wrote :

After making the change, I reallice that some changes will be needed in tempest.

Is there any tips on how to perform the correct correlation of changes? tempest and nova

Revision history for this message
Giulio Fidente (gfidente) wrote :

hi Juan, hopefully tempest does not make assumptions about the flavors RAM but if you let me know which are the tests failing I can look into those and try to fix them

Revision history for this message
Juan Manuel Ollé (juan-m-olle) wrote :

Dafna:
After thinking a little at home, I'm not sure about this change.
One example is that if 768Mb is a valid size, it will not be allowed any more (with the constrain of 2^x)
Should we proceed?

Giulio:
In this case I could fix tempest test first and then integrate this patch. But I will try to contact you to know (just for curiosity ) how is the correct way to merge 2 patch that make the test fails in any order.

One of the failing test is:
tempest.api.compute.admin.test_servers_negative.ServersAdminNegativeTestJSON.test_resize_server_using_overlimit_ram
it is because is creating a new flavour with ram size (Quota + 1) and is not a 2 ^ x integer.

Revision history for this message
Dafna Ron (dron-3) wrote :

mmm... how about if instead of blocking this we issue a warning?
we can print a warning if the memory size is not in 2^x - that way we are not blocking someone from creating the flavor but we also help someone who made a mistake.
what do you think?

Changed in nova:
assignee: Juan Manuel Ollé (juan-m-olle) → nobody
Tracy Jones (tjones-i)
Changed in nova:
status: In Progress → Triaged
Revision history for this message
Joe Gordon (jogo) wrote :

I think the best way to fix this is in documentation, not in code.

Changed in nova:
status: Triaged → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.