Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume loses its format_type when saved #169

Open
mxey opened this issue Feb 5, 2025 · 1 comment
Open

Volume loses its format_type when saved #169

mxey opened this issue Feb 5, 2025 · 1 comment

Comments

@mxey
Copy link

mxey commented Feb 5, 2025

When creating a volume with fog-libvirt, the format_type is lost:

irb(main):004:0> compute = Fog::Compute.new(provider: :libvirt, libvirt_uri: "qemu+ssh://s098209.rz.babiel.com/system")
=> #<Fog::Libvirt::Compute::Real:5400 @uri=#<Fog::Libvirt::Util::URI:0x0000000109fd8068 @parsed_uri=#<URI::Generic qemu+ssh://s098209.rz....
irb(main):005:0> vol = compute.volumes.new
=> 
  <Fog::Libvirt::Compute::Volume
...

irb(main):006:0> vol.format_type
=> "raw"


irb(main):007:0> vol.save
=> 
  <Fog::Libvirt::Compute::Volume
    id="tqVRqA-UU7o-qOms-HaHd-e5hr-a4qi-Fz4hU7",
    pool_name="vg1",
    key="tqVRqA-UU7o-qOms-HaHd-e5hr-a4qi-Fz4hU7",
    name="fog-817509623589251",
    path="/dev/vg1/fog-817509623589251",
    capacity=10,
    allocation=1,
    owner=nil,
    group=nil,
    format_type=nil,
    backing_volume=nil
  >

irb(main):008:0> vol.format_type
=> nil

If this created volume is then used for a VM, the generated XML is invalid:

<driver name="qemu" type=""/>

which leads to the error Call to virDomainDefineXML failed: unsupported configuration: unknown driver format value ''

This causes https://projects.theforeman.org/issues/38081

@mxey
Copy link
Author

mxey commented Feb 5, 2025

This bug was introduced by 0277e9b - if I revert this, I cannot reproduce it anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant