Add check on total disk size before deploying

Bug #1322179 reported by Dmitry Tantsur
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Expired
Low
Unassigned

Bug Description

Currently, the only thing we check is that instance image fits in a root partition. We need a check that all 3 possible partitions (ephemeral, swap and root) fit on a hard drive. Using test in review https://review.openstack.org/#/c/94620 I deducted the following formula: EPHEMERAL + SWAP + ROOT <= TOTAL_SIZE - 2 MiB.

What these 2 MiB account for:
1. Spacing for MBR before the first partition
2. Spacing after the last partition: parted can't have end of the partition after the end of the disk, i.e. `mkpart XX TOTAL_SIZE` won't work. Version of `parted` in Ubuntu Precise is still able to claim the trailing 1 MiB, if it's possible.
    This also accounts for GPT, which stores metadata also in the end.

Revision history for this message
Lucas Alvares Gomes (lucasagomes) wrote :

Copying the IRC chat as a reference here, I will to do some small investigation to see if that's still true:

<lucasagomes> dtantsur, afair, we need to fix some misunderstands with nova as well
<lucasagomes> for e.g
<lucasagomes> we have properties/local_gb, which represents the size of the _whole_ disk for ironic
<lucasagomes> but nova uses it as the size of the root_partition, independent of the ephemeral size or swap size
<lucasagomes> so what's passed for us is, size of the whole disk + eph + swap
<dtantsur> O_O
<lucasagomes> I think that is one reason why we don't have a sanity check within ironic
<lucasagomes> dtantsur, yeah, there's something odd around that area
<lucasagomes> is a bit grey area
<lucasagomes> dtantsur, we may want to calculate it on our driver tho

Dmitry Tantsur (divius)
Changed in ironic:
assignee: nobody → Dmitry "Divius" Tantsur (divius)
aeva black (tenbrae)
Changed in ironic:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Dmitry Tantsur (divius) wrote :

Unassigned myself. Note that parted vs sfdisk issues should be solved first.

Changed in ironic:
assignee: Dmitry "Divius" Tantsur (divius) → nobody
Revision history for this message
Robert Collins (lifeless) wrote :

So if this ever shows up, it means the scheduler did the wrong thing. This may be pointing at a scheduling algorithm bug.

Revision history for this message
Dmitry Tantsur (divius) wrote :

Robert, I guess we should be doing independent sanity checks (especially if we expect Ironic to be used w/o Nova)

Changed in ironic:
assignee: nobody → Sandhya Ganapathy (sandhya-ganapathy)
aeva black (tenbrae)
Changed in ironic:
milestone: none → kilo-rc1
aeva black (tenbrae)
Changed in ironic:
assignee: Sandhya Ganapathy (sandhya-ganapathy) → nobody
milestone: kilo-rc1 → none
importance: Medium → Low
Revision history for this message
Pavlo Shchelokovskyy (pshchelo) wrote :

Actually there already is a filter in Nova scheduler that does almost exactly that (except those extra 2 MiB) - ExactDiskFilter [1].

Moreover, it is included in default set of filters for IronicHostManager [2], but devstack (and probably others) do not use these default filters by default (sic) [3]

So probably the solution would be to update the ExactDiskFilter to account for extra 2MB (or create a modified variant of it) and start actually using it in scheduler filters.

[1] https://github.com/openstack/nova/blob/master/nova/scheduler/filters/exact_disk_filter.py#L23
[2] https://github.com/openstack/nova/blob/master/nova/scheduler/ironic_host_manager.py#L39
[3] https://github.com/openstack/nova/blob/master/nova/scheduler/ironic_host_manager.py#L45

Revision history for this message
Dmitry Tantsur (divius) wrote :

We should still double-check in case Nova is not used

bin Yu (froyo-bin)
Changed in ironic:
assignee: nobody → bin (froyo-bin)
assignee: bin Yu (froyo-bin) → nobody
Michael Turek (mjturek)
Changed in ironic:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Ironic because there has been no activity for 60 days.]

Changed in ironic:
status: Incomplete → Expired
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.