I'm not sure if I got the question right but imho it seems obvious
to me that no oem type specific settings exists for the vmx image
type. The main difference between oem and vmx is that an oem can
apply such changes like, repartition system and add swap on first
boot of the system. The vmx was designed to be a simple virtual
disk which boots up as it is.
Maybe you consider to create an oem instead of a vmx e.g
<type image="oem" filesystem="ext3" boot="oemboot/suse-12.1">
<oemconfig>
<oem-swapsize>2048</oem-swapsize>
</oemconfig>
</type>
The result is the same raw disk as with a vmx but the first boot
code will resize the disk to fit the real geometry and will also
create a swap space of 2G
Hope that helps ?
Regards,
Marcus
--
Public Key available
gpg --keyserver gpg-keyserver.de --recv-keys 0xCCE3C6A2
-------------------------------------------------------
Marcus Schäfer (Res. & Dev.) SUSE LINUX Products GmbH
Tel: 0911-740 53 0 Maxfeldstrasse 5
FAX: 0911-740 53 479 D-90409 Nürnberg
GF: Jeff Hawn,Jennifer Guild, Felix Imendörffer
HRB: 21284 (AG Nürnberg) Germany
http://www.suse.de
-------------------------------------------------------
> Actually, we already make oem images using Kiwi (with swap, of
> course). These images are intended for certain target hardware. We're
> exploring the possibility of virtualizing the product, though, and I
> wanted VM images with swap.
ok got that but you also can use oem images on VM systems
> Is there no way that the vmx first boot
> code can rearrange the LVM partition to create a swap partition?
there is a way but it involves some image postprocessing
1) build the vmx as usual
2) increase the size of the .raw disk file according to the
amount of swap space you want: e.g file.raw is 1G and you
want 500M swap
dd if=/dev/zero of=file.raw bs=1 count=1 seek=1500M conv=notrunc
3) update the partition table
losetup /dev/loop0 file.raw
fdisk /dev/loop0
d
2
n
p
2
<return>
<return>
t
2
8e
w
4) activate the LVM (I assume volume group name is kiwiVG)
kpartx -a /dev/loop0
vgchange -ay kiwiVG
5) resize physical volumes
pvresize /dev/mapper/loop0p2
6) create swap volume
lvcreate -l +100%FREE -n LVSwap kiwiVG
7) create swap signature
mkswap /dev/mapper/kiwiVG-LVSwap
8) update the fstab entry
/dev/kiwiVG/LVSwap swap swap defaults 0 0
==> kiwi's vmx code overwrites the fstab on first boot. You
have to update the fstab in a first boot script
9) clean up
vgchange -an kiwiVG
kpartx -d /dev/loop0
losetup -d /dev/loop0
> Q: Couldn't the image resizing etc be avoided if a dummy LVM partition
> to be used for swap? i.e. alter fstab and use mkswap in the vms first
> boot script.
Ah clever :) yes this would also work