how to debug fog/foreman/libvirt for CEPH image provisioning ?


I’m trying to use image based provisioning, and I’m hitting a wall when it comes to volumes cloned from a source image.

My test VMs always fail to boot telling me there is no filesystem on the volume, and indeed the libvirt backingStorage xml field is empty.
The rbd volume has no parent, and is an “just” a volume, not a clone.

I hacked my way into the foreman code up to “/usr/share/foreman/app/models/compute_resources/foreman/model/libvirt.rb” where I was able to find that the following lines seem to determine the cloning process, using fog (?).

  if args[:backing_id].present?
    raise'At least one volume must be specified for image-based provisioning.')) unless args[:volumes].size >= 1
    args[:volumes].first.backing_volume = template(args[:backing_id])

Note : I’m a complete ruby/rails noob. I know nothing about these except what’s needed for puppet irb templates.

That said : I’ve checked args[:backing_id] and was indeed what I gave in the foreman image path (or uuid), ie "pool_name/image_name"
But template(args[:backing_id]) seems to be empty (I checked String(template(args[:backing_id]).xml) which is an empty string )

? I wanted to debug this by running something like “bundle exec fog” in a local ruby env, but I then could find how to instanciate a libvirt provider, I always face a damn “ArgumentError: :libvirt is not a recognized provider”

? I tried cloning the image using virsh/libvirt directly : I faced no issue : the ceph volume was snapshotted and then another volume was created with that snapshot as a parent.

Any idea how I could fix this fog/foreman issue for volume cloning ?