Page MenuHomeSoftware Heritage

packer: Add template to build qemu/libvirt images
ClosedPublic

Authored by ardumont on Oct 3 2020, 8:56 PM.

Details

Summary

Build ok (cf. P800)

Goal is to try and build vm with libvirt/qemu possibly instead of virtualbox [1]

[1] https://github.com/vagrant-libvirt/vagrant-libvirt#create-vagrantfilen

Related to T2606

Test Plan

packer build debian_buster.qemu.json runs fine

Diff Detail

Repository
rSENV Puppet Environment
Branch
master
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 15868
Build 24418: arc lint + arc unit

Event Timeline

packer/debian_buster.qemu.json
33

grub-install step failed due to this naming which is different with the other template (in there sda)...

Drop the specific vbox vbguest install step (no need here ¯\_(ツ)_/¯)

ardumont edited the summary of this revision. (Show Details)
ardumont edited the summary of this revision. (Show Details)

heads up @vlorentz (since you raise the license remark) @olasd (since you raised the question about vbox) @vsellier (since you are the original author ;)

template build process worked, that's a start, i guess.

packer/debian_buster.qemu.json
16

up to line 9, that's the main differing part from the original template from D4136

(well that and the /dev/vda bootloader install instruction below and the qcow2 format at the end.)

33

explicitely /dev/sda is replaced by /dev/vda

68

.qcow2 format is different than the .box

packer/debian_buster.qemu.json
3

That's huge. I'm guessing that does thin provisioning (i.e. it's not allocating 20 GB worth of zeroes)?

packer/debian_buster.qemu.json
3

No idea, really. I started from the other vbox template which defined it as well.
I'll check.

packer/debian_buster.qemu.json
3

[1] does not convey much information

I'll decrease to say 5G, hoping that's sufficient for the template build to pass.

[1] https://www.packer.io/docs/builders/qemu.html#disk_size

  • Decrease disk_size to 5G
  • template build still ok (P800 updated)
packer/debian_buster.qemu.json
3

so i should have realized earlier, as @vsellier made me notice the finalized template is about ~500Mib.
So it's not indeed allocating the 20Gb worth of zeroes.

And my tryout of a deposit-staging with a 5Gb disk is not enough space.
So i'll readapt this.
(Most possibly in another diff though, to avoid the rebase dance a bit, if you don't mind ;).

Thanks, it's really great.
I have tested locally the qemutest vm and converted the staging-webapp and staging-deposit vms, everything looks good.
The virtualbox and libvirt networks (with the same ip range) can't cohabit together but after a cleanup on the virtualbox side, everything works as expected.

The vm management itself (up / destroy / status) is really smooth compared to the virtualbox provider.

As discuss, I'm ok to completely remove the virtualbox usage to focus on only one provider.

This revision is now accepted and ready to land.Oct 12 2020, 3:36 PM