Pre-migration memory check- Invalid error message if memory value is 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Confirmed
|
Low
|
Unassigned |
Bug Description
There is possible correction in the logic and error handling in the pre-migration memory check in case when the memory value is zero '0'.
This check is present in the source code class: nova/conductor/
Below is the current code snippet:
if not mem_inst or avail <= mem_inst:
dest = self.destination
reason = _("Unable to migrate %(instance_uuid)s to %(dest)s: "
raise exception.
It can be seen that when mem_inst value is 0, the if condition is met and control enters the block resulting in 'lack of memory' error with a message 'avail memory < 0'. This is absurd.
Sample error message when memory is zero:
2014-10-13 19:52:09.441 3907 INFO nova.api.
NV-78D5611 Migration pre-check error: NV-37B7976 Unable to migrate 352122ae-
The trailing end part of the error doesn't make much sense (host:65536 <= instance:0).
Possible correction:
The check should handle the special case of zero memory value in a different way. If memory equals zero, then a different error of exception should be raised about invalid memory.
Sample fix:
if mem_inst <= 0:
reason = _("Unable to migrate %(instance_uuid)s to %(dest)s: "
raise exception.
elif avail <= mem_inst:
reason = _("Unable to migrate %(instance_uuid)s to %(dest)s: "
"Lack of memory available at destination. (host:%(avail)s <= "
raise exception.
Changed in nova: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in nova: | |
assignee: | Padmakanth (padmakanth-chandrapati) → nobody |
Hi Ravishankar Patil,
How could we get that Error Message? I mean what are the commands that I have to use to produce the bug. Could you please provide me a relevant information?