ephemeral device creation when using LVM devices does not cause the resulting filesystem to get newfs'd
Reading through nova code:
in utils.py/LibvirtDriver/_create_image
fn = functools.partial(self._create_ephemeral,
fs_label='ephemeral0',
os_type=instance["os_type"])
then:
image('disk.local').cache(fetch_func=fn,
filename=fname,
size=size,
ephemeral_size=ephemeral_gb)
is called
cache() then calls imagebackend.py/Lvm/create_image
create_image() then calls libvirt_utils.create_lvm_image, which creates the LVM
prepare_template() is then called, leading us cache.call_if_not_exists
call_if_not_exists contains the following check:
if not os.path.exists(target):
since create_image has already created the lvm device, the /dev/ entry exists and therefore our fetch_func (self._create_ephemeral) never gets called, and no filesystem is created on the ephemeral device.
I have an absolutely hackish patch for this, that I'm 100% sure isn't the right way.
In, call_if_not_exists I changed: exists( target) : exists( target) and 'ephemeral_size' not in kwargs: ephemeral( self, target, ephemeral_size, fs_label, os_type): exists( target) :
self. _create_ local(target, ephemeral_size)
disk.mkfs( os_type, fs_label, target)
if not os.path.
to
if not os.path.
and
def _create_
if not os.path.
This is bad, but it works :)