vmbuilder fails when specifying numeric values in config file

Bug #391001 reported by Jarl
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
vm-builder (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: python-vm-builder

When using a config file containing
[DEFAULT]
rootsize = 10000
swapsize = 4000

The vmbuilder script fails with

Traceback (most recent call last):
  File "/usr/bin/vmbuilder", line 29, in <module>
    VMBuilder.run()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/__init__.py", line 66, in run
    frontend.run()
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/cli/__init__.py", line 65, in run
    self.set_disk_layout(vm)
  File "/usr/lib/python2.6/dist-packages/VMBuilder/plugins/cli/__init__.py", line 92, in set_disk_layout
    size = vm.rootsize + vm.swapsize + vm.optsize
TypeError: cannot concatenate 'str' and 'int' objects

Of course the natural workaround is to use part = <partitionfile>, in stead of specifying rootsize and swapsize.

Jarl

Revision history for this message
Jarl (jarl-dk) wrote :

Even worse, much much worse; If the configuration file contains (for specifying 2GB ram)
mem = 2000

the vmbuilder script will not fail, it will silently create an XML file containing
  <memory>18446744073709551615</memory>
  <currentMemory>18446744073709551615</currentMemory>

This will in turn make 'virsh start ubuntu' hang and top will show a libvirtd using 100% of CPU.

Jarl

tags: added: hang kvm libvirt libvirtd virsh virtualization vmbuilder
Jarl (jarl-dk)
summary: - vmbuilder fails when specifying rootsize and swapsize in config file
+ vmbuilder fails when specifying numeric values in config file
Revision history for this message
Chuck Short (zulcss) wrote :

Hi,

Thanks for the bug report. What happens when you wrap the values in quotes?

Thanks
chuck

Changed in vm-builder (Ubuntu):
status: New → Incomplete
Revision history for this message
Jarl (jarl-dk) wrote :

I have now used a configuration file containing a line like this (with single quotes):

mem='2000'

and created a machine like this

vmbuilder kvm ubuntu --debug -c vmbuilder_pegasus.conf --hostname ubu-test

while having the memory number in quotes it failed to create the machine.

I attach the output of the above command

Changed in vm-builder (Ubuntu):
status: Incomplete → New
Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the bug report.

Regards
chuck

Changed in vm-builder (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Doka (doka-wepoca) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.