Search This Blog

17 November 2008

Setting up xVM....

It was a long and tedious process, but I got it working (on my work machine)... well, actually, it wasn't so bad once this was resolved [which took about 2-3 days to figure out]. While working on that, I also installed SUNWxvmhvm as it appeared to be the only xVM one not installed according to the Package Manager.

The first step was to download the ISOs. I ended up downloading both sol-10-u6-companion-ga.iso and sol-10-u6-ga1-x86-dvd.iso, though I haven't gotten around to using (or even looking at) the companion cd.

I played around a few times until I figured out how I wanted this done. I decided the original domain was going to be used as a starting point to clone from, and not as a domain to run; so some of the names seem a little overboard early on. I used this page for a lot of the details of what to do.

The next step was to create a volume.
root@eris:/rpool/vm/iso# zfs create -V 16G rpool/vm/sol-10-u6-ga1-x86.zvol
This creates /dev/zvol/dsk/rpool/vm/sol-10-u6-ga1-x86.zvol.

Using virt-manager to create the domain:
name: sol_10_u6_ga1_x86
virtualization: full
iso: /rpool/vm/iso/sol-10-u6-ga1-x86-dvd.iso
os type: Solaris
os variant: Sun OpenSolaris
disk: /dev/zvol/dsk/rpool/vm/sol-10-u6-ga1-x86.zvol
nic: shared eg1000g0
mem (min): 1024
mem (max): 1024
VCPUs: 1

During the installation, Solaris and Option 4 (to allow for a ZFS root).
Once it was installed, I rebooted and verified that it worked. I shut it down.
root@eris# zfs snapshot rpool/vm/sol-10-u6-ga1-x86.zvol@FreshInstall
root@eris# zfs list -t snapshot -r rpool/vm/sol-10-u6-ga1-x86.zvol | grep -v auto-snap
(the second step was to verify that it worked)

Logged into the domain (using virt-manager)
root@sol_10_u6_ga1_x86# sys-unconfig
This halts it, but through trial and error I found that I need to hit a key to get it to start restarting THEN hit the shutdown button on xVM so that it is NOT running.
root@eris# zfs snapshot rpool/vm/sol-10-u6-ga1-x86.zvol@Unconfigured
root@eris# zfs clone rpool/vm/sol-10-u6-ga1-x86.zvol@Unconfigured rpool/vm/eris-vm1.zvol
zfs snapshot rpool/vm/eris-vm1.zvol@Unconfigured

root@eris# zfs list -t all -r rpool/vm/sol-10-u6-ga1-x86.zvol | grep -v auto-snap
rpool/vm/sol-10-u6-ga1-x86.zvol 22.1G 51.1G 5.93G -
rpool/vm/sol-10-u6-ga1-x86.zvol@FreshInstall 0 - 5.89G -
rpool/vm/sol-10-u6-ga1-x86.zvol@Unconfigured 0 - 5.93G -
root@eris# zfs list
rpool 37.7G 35.1G 50K /rpool
rpool/ROOT 7.64G 35.1G 18K legacy
rpool/ROOT/opensolaris 5.85G 35.1G 5.52G /BE/opensolaris
rpool/ROOT/opensolaris-1 776M 35.1G 5.52G /BE/opensolaris-1
rpool/ROOT/opensolaris-2 1.03G 35.1G 5.77G /tmp/tmpFWvL5Q
rpool/dump 1.93G 35.1G 1.93G -
rpool/export 1.35G 35.1G 19K /export
rpool/export/home 1.35G 35.1G 19K /export/home
rpool/export/home/malachi 1.35G 35.1G 423M /export/home/malachi
rpool/swap 1.93G 37.0G 16K -
rpool/vm 24.9G 35.1G 2.78G /rpool/vm
rpool/vm/eris-vm1.zvol 0 35.1G 5.93G -
rpool/vm/sol-10-u6-ga1-x86.zvol 22.1G 51.1G 5.93G -

Then to create the domain configuration:
root@eris:/rpool/vm# virsh dumpxml sol_10_u6_ga1_x86 > sol_10_u6_ga1_x86.xml
root@eris:/rpool/vm# cp sol_10_u6_ga1_x86.xml eris_vm1.xml

Edit the new eris_vm1.xml:
1. replace the domain name
2. remove the UUID line
3. replace the zvol location (from sol_10_u6_ga1_x86.zvol to eris_vm1.zvol)
root@eris:/rpool/vm# virsh define eris_vm1.xml

Boot into the new domain and configure it. Reboot and make sure the internet works. Shut it down.

root@eris# zfs snapshot rpool/vm/eris-vm1.zvol@Configured

That's it. It's now bootable and the original one is still available to clone another from.


  1. For some reason, well I try to do the sys-unconfig on the home server; it does not require the information on booting the new domain. Not sure what is happening there - it says I am running 'unknown' but doesn't prompt me.

  2. I'm not sure why sys-unconfig isn't forcing a config...

    even doing a sys-unconfig and rebooting didn't cause it to ask the questions...

    trying this

  3. Hmmm, that seemed to make it unbootable