Ubuntu – uvtool second virtual disk for? (and how does it prevent vm snapshots…)

cloudkvmvirtualization

I am toying with uvtool to quickly create virtual machines. I once used vmbuilder, but its seems to be deprecated in favor of uvtool (or not ?).

When created with uvt, my vm has two virtual disks defined:

  1. First one is called my-vm-name.qcow, and its size fits the size I asked for the disk. Its type is qcow2.
  2. Second one is called my-vm-name-ds.qcow, and is small (few hundred mb). Its type is raw.

What is this second disk ?

[EDIT] I've found this in a IRC log:
[15:26] The second disk image is for the cloud-init data source
[15:26] It passes in cloud-init userdata and metadata.

But this is still unclear to me… What does it do. Can I simply remove it ? Should it be backed up with the VM ? …

[EDIT2] Another piece of information, that seems to confirm vmbuilder might be deprecated in favor of uvtool: https://bugs.launchpad.net/ubuntu/+source/auto-upgrade-testing/+bug/1261416

Reads: the vm-builder package may be pulled from the archive in trusty due to be un-maintained.

[EDIT3] Yet another piece of information, explaining cloud-init: http://blog.octo.com/cloudinit-kesako/ This is in french.

Best Answer

Answering my own question:

What is my-vm-name-ds.qcow for ?

  • uvtool relies on Ubuntu cloud images to quickly create virtual machines running Ubuntu
  • uvtool (namely uvt-kvm) allows the use of cloud-init framework to interact with the VM you are creating
  • cloud-init needs a way to get some data from you (scripts you want to run, etc.) : this is what my-vm-name-ds.qcow is for

Can I remove my-vm-name-ds.qcow ?

  • yes you can, but you have to remove cloud-init package from your VM before doing so, otherwise cloud-init will be stuck on boot
  • so to remove this second disk, first boot into your VM and apt-get purge cloud-init
  • then, you can remove the disk from the VM definition (using virt-manager or virsh for example)

Why would I want to remove that disk ?

  • the compelling reason to remove clout-init and its disk is that it is using the raw format: this will prevent you to use the snapshot feature of virt-manager!
  • after removing the -ds.qcow disk (which in fact is in raw format), you'll be able to access vm shapshots feature

enter image description here