Allow to use many disks in vagrant box for libvirt provider

Adds support for a new multi disk box format and handling to upload the
multiple disks to the storage pool.

New format is:
{
  'disks': [
    {
      'name': 'disk1.img',
      'virtual_size': 10,
      'format': 'qcow2'
    },
    {
      'name': 'disk2.img',
      'virtual_size': 15,
      'format': 'qcow2'
    },
    {
      'name': 'disk3.img',
    }
  ],
  'provider': 'libvirt',
  'format': 'qcow2'
}

It is expected to remove format from being set at the top level when
using the new format, with the assuming that qcow2 should be the default
format, and other formats should be permitted to be specified as needed.

Includes tests for handling the box images and creation of domain
volumes. Additionally includes an integration test to ensure a box with
2 disks will work as expected.

Partially fixes: #602
This commit is contained in:
Richard Turc
2020-09-10 10:03:00 +02:00
committed by Darragh Bailey
parent 6f608c54bf
commit 225237b125
19 changed files with 802 additions and 144 deletions

View File

@@ -18,6 +18,7 @@ jobs:
- simple vm provision via shell
- bring up with custom default prefix
- bring up with second disk
- bring up with two disks
- bring up with adjusted memory settings
- bring up with adjusted cpu settings
- ip is reachable with private network