Showing posts with label xvm. Show all posts
Showing posts with label xvm. Show all posts

Monday, March 2, 2009

Create a zvol based hvm xvm

I have just created a Trixbox VM on my Opensolaris server (xVM/Xen).  It is currently a HVM and I will be looking into how I can paravirtualise it.

This really is disgustingly simple:

Create a 6GB zvol:
zfs create -V 6g array/xvm/trixbox

Create the VM:
virt-install --name Trixbox --ram 512 --file /dev/zvol/dsk/array/xvm/trixbox --vnc --hvm --os-type=linux os-variant=rhel5 --location /iso/trixbox.iso

Most of the options are self-explanatory:
--name Trixbox (the name of the VM)
--ram 512 (how much ram to allocate)
--file /dev/zvol/dsk/array/xvm/trixbox (uses the zvol device as hard disk)
--vnc (enables vnc access to the VM)
--hvm (specifies that the VM is a HVM, and not paravirtualised)
--os-type=linux os-variant=rhel5 (specifies that the VM is a rhel5 based linux VM)
--location /iso/trixbox.iso (uses this iso image as the installation media)

Easy peasy!

Tuesday, February 24, 2009

How to enable xVM on Opensolaris 2008.11

Create a new boot environment called "xvm":
beadm create -a -d xvm xvm

Reboot into new "xvm" environment:
reboot

Download & install xVM packages:
pkg install xvm-gui SUNWvirt-manager SUNWxvm SUNWvdisk SUNWvncviewer

Modify xvm entry in /rpool/boot/grub/menu.lst to the following:
#============ End of LIBBE entry =============
title xvm
bootfs rpool/ROOT/xvm
kernel$ /boot/$ISADIR/xen.gz
module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=text
module$ /platform/i86pc/$ISADIR/boot_archive
#============ End of LIBBE entry =============

Reboot into new "xvm" with xvm kernel:
reboot

Check xvm is enabled in kernel:
uname -a
Look for "i86xpv"

Enable xVM services:
svcadm enable -r xvm/virtd ; svcadm enable -r xvm/domains

References: