Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Commit

Permalink
Merge pull request #383 from Exy13/qcow
Browse files Browse the repository at this point in the history
Add qcow2 as a disk backend for KVM
  • Loading branch information
andsens authored Jun 16, 2017
2 parents 3e5c94f + cc69173 commit c23e73c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bootstrapvz/base/fs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ def load_volume(data, bootloader):
from bootstrapvz.common.fs.virtualmachinedisk import VirtualMachineDisk
from bootstrapvz.common.fs.folder import Folder
from bootstrapvz.common.fs.logicalvolume import LogicalVolume
from bootstrapvz.common.fs.qcow2volume import Qcow2Volume
volume_backing = {'raw': LoopbackVolume,
's3': LoopbackVolume,
'vdi': VirtualDiskImage,
'vhd': VirtualHardDisk,
'vmdk': VirtualMachineDisk,
'ebs': EBSVolume,
'folder': Folder,
'lvm': LogicalVolume
'lvm': LogicalVolume,
'qcow2': Qcow2Volume
}.get(data['backing'])

# Instantiate the partition map
Expand Down
7 changes: 7 additions & 0 deletions bootstrapvz/common/fs/qcow2volume.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from qemuvolume import QEMUVolume


class Qcow2Volume(QEMUVolume):

extension = 'qcow2'
qemu_format = 'qcow2'
2 changes: 1 addition & 1 deletion bootstrapvz/providers/kvm/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ virtual images for Linux Kernel-based Virtual Machines. It supports the
installation of `virtio kernel
modules <http://www.linux-kvm.org/page/Virtio>`__ (paravirtualized
drivers for IO operations).
It also supports creating an image with LVM as a disk backend.
It also supports creating an image with LVM and qcow2 as a disk backend.

Manifest settings
-----------------
Expand Down
3 changes: 2 additions & 1 deletion bootstrapvz/providers/kvm/manifest-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ properties:
properties:
backing:
type: string
enum:
enum:
- qcow2
- raw
- lvm
logicalvolume: {type: string}
Expand Down
2 changes: 1 addition & 1 deletion manifests/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ boot, root and swap.

- ``backing``: Specifies the volume backing. This setting is very
provider specific.
Valid values: ``ebs``, ``s3``, ``vmdk``, ``vdi``, ``raw``
Valid values: ``ebs``, ``s3``, ``vmdk``, ``vdi``, ``raw``, ``qcow2``, ``lvm``
``required``
- ``partitions``: A map of the partitions that should be created on
the volume.
Expand Down
24 changes: 24 additions & 0 deletions manifests/examples/kvm/jessie-qcow2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: debian-qcow2-example
provider:
name: kvm
bootstrapper:
workspace: /target
system:
release: jessie
architecture: amd64
bootloader: grub
charmap: UTF-8
locale: en_US
timezone: UTC
volume:
backing: qcow2
partitions:
type: gpt
root:
filesystem: ext4
size: 1GB
packages: {}
plugins:
root_password:
password: test

0 comments on commit c23e73c

Please sign in to comment.