libvirt: driver calls volume connect twice for every volume on boot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Thang Pham |
Bug Description
Libvirt driver will attempt to connect the volume on the hipervisor twice for every volume provided to the instance when booting. If you examine the libvirt driver's spawn() method, both _get_guest_xml (by means of get_guest_
This is especially bad in the iscsi volume driver case, where we do 2 rootwraped calls in the best case, one of which is the target rescan, that can in theory add and remove devices in the kernel.
I suspect that fixing this will make a number of races that have to do with the volume not being present when expected on the hypervisor, at least less likely to happen, in addition to making the boot process with volumes more performant.
An example of a race condition that may be caused or made worse by this is: https:/
Changed in nova: | |
assignee: | nobody → Thang Pham (thang-pham) |
Changed in nova: | |
milestone: | none → kilo-1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | kilo-1 → 2015.1.0 |
It seems the problem here is that we're overloading the 'connect' method to serve two jobs - do the host OS integration/setup tasks, and return the XML config. I wonder if this is a sign we need to change volume.py to be more like vif.py
By that I mean, when connecting VIFs we have separate 'plug' and 'get_config' methods - the former does the host OS setup and must only be called once and the latter is idempotent for getting XML config.