On Sun, Feb 17, 2008 at 02:14:43AM +0000, Daniel P. Berrange wrote:
Future enhancements for this:
- Allow splitting across multiple disks (sda, sdb, etc)
- When staging final image, use qemu-img to generate qcow2, vmdk
or raw files at user's choice. qcow2 would give huge size savings
- Output XML file for use with 'virt-image' tool, so that the entire
build and deploy process consists of nothing more than:
# disk-creator ovirt-wui-appliance.ks
# virt-image ovirt-wui-appliance.xml
This new version of the patch implements all three of the above features.
As an example, creating an appliance with 2 disks (sda & sdb), outputting
in qcow2 format:
disk-creator --format qcow2 \
--name ovirt-wui \
--disk ovirt-wui-os --size 5000 \
--disk ovirt-wui-data --size 1000 \
ovirt-wui-appliance.ks
You'll end up with ovirt-wui-os.qcow2, ovirt-wui-data.qcow2 and ovirt-wui.xml
This can be deployed as a VM with
virt-image --connect qemu:///system ovirt-wui.xml
Well, due to a bug in virt-image, it'll refuse to create a VM with qcow2
disks, but I've fixed that upstream. For now just leave out the --format
arg to create in raw file.
I'm definitely now of opinion we should actually name it appliance-creator
instead of disk-creator, but not changed it in this patch yet.
The attached patch touches:
API | 4
Makefile | 3
imgcreate/__init__.py | 3
imgcreate/creator.py | 17 +
imgcreate/disk.py | 146 ++++++++++----
imgcreate/fs.py | 480 +++++++++++++++++++++++++++++++++++++++----------
imgcreate/kickstart.py | 3
imgcreate/live.py | 6
livecd-tools.spec | 1
tools/disk-creator | 49 ++++-
10 files changed, 569 insertions(+), 143 deletions(-)
Also attaching the new kickstart file I'm using for multi-disks.
Regards,
Dan.
--
|=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=|
|=- Perl modules:
http://search.cpan.org/~danberr/ -=|
|=- Projects:
http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|