Thursday, January 22, 2009

20090122 - xVM (Xen) in OpenSolaris

Ok, so Xen in OpenSolaris isn't quite as polished as Xen in Linux - for a couple of reasons.

virt-install doesn't quite work properly yet:

bash-3.2# virt-install
What is the name of your virtual machine? sol_para_vm
How much RAM should be allocated (in megabytes)? 512
What would you like to use as the disk (file path)? /export/vms/sol_para_vm.dsk
Would you like to enable graphics support? (yes or no) yes
What is the install location? /media/SOL_11_X86


Starting install...
virDomainCreateLinux() failed POST operation failed: (xend.err 'Device 0 (vkbd) could not be connected. Hotplug scripts not working.')
Domain installation may not have been
successful. If it was, you can restart your domain
by running 'virsh start sol_para_vm'; otherwise, please
restart your installation.
Wed, 21 Jan 2009 09:32:55 ERROR virDomainCreateLinux() failed POST operation failed: (xend.err 'Device 0 (vkbd) could not be connected. Hotplug scripts not working.')
Traceback (most recent call last):
File "/usr/bin/virt-install", line 511, in ?
main()
File "/usr/bin/virt-install", line 471, in main
dom = guest.start_install(conscb,progresscb)
File "/export/builds/xvm_101///proto/install/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 878, in start_install
File "/export/builds/xvm_101///proto/install/usr/lib/python2.4/site-packages/virtinst/Guest.py", line 899, in _do_install
File "libvirt.py", line 585, in createLinux
if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: virDomainCreateLinux() failed POST operation failed: (xend.err 'Device 0 (vkbd) could not be connected. Hotplug scripts not working.')


However, these can be fixed by a couple of actions:

By NFS (root,ro) sharing out the /media/SOL_11_X86 mount, It is possible to create a Solaris Xen instance. The only trick is that the automated installer bombs out and you have to restart it with a NFS source, pointing back to the installation source that you've already specified:


So the sequence to create a para VM runs like this:

-bash-3.2# mkfile -n 8g /export/vms/solaris_para_vm.dsk
-bash-3.2# share -o ro,root /media/SOL_11_X86
-bash-3.2# virt-install --paravirt --name solaris_para_vm --ram 512 --file /export/vms/solaris_para_vm.dsk --nographics --location nfs:10.128.16.205:/media/SOL_11_X86



Starting install...
Creating domain... 0 B 00:20
v3.1.4-xvm chgset 'Mon Oct 13 22:14:51 2008 -0700 15904:94bd0a643efe'
SunOS Release 5.11 Version snv_101 32-bit
Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Configuring /dev
/
1. Solaris Interactive Text (Console session) (default)
2. Apply driver updates
3. Single user shell

Enter the number of your choice.
Timed out, continuing.

Solaris Interactive Text (Console session)

ERROR: no source install media defined
Trying DHCP on xnf0
Success
Reading ZFS config: done.
ERROR: Cannot find Java software, Exiting to shell
# TERM=xterms ; export TERM
# stty rows 25 cols 80
# install-solaris
Starting Solaris installation program...
Executing JumpStart preinstall phase...
Searching for SolStart directory...
Checking rules.ok file...
Using begin script: install_begin
Using finish script: patch_finish
Executing SolStart preinstall phase...
Executing begin script "install_begin"...
Begin script install_begin execution completed.

On the following screens, you can accept the defaults or you can customize
how Solaris software will be installed by:

- Selecting the type of Solaris software to install
- Selecting disks to hold software you've selected
- Selecting unbundled products to be installed with Solaris
- Specifying how file systems are laid out on the disks

After completing these tasks, a summary of your selections (called a
profile) will be displayed.

There are two ways to install your Solaris software:

- "Standard" installs your system from a standard Solaris Distribution.
Selecting "Standard" allows you to choose between initial install
and upgrade, if your system is upgradable.
- "Flash" installs your system from one or more Flash Archives.




────────────────────────────────────────────────────────────────────────────────
F2_Standard F4_Flash F5_Exit F6_Help


During the installation of Solaris software, you may be using one or more
CDs/DVDs. With the exception of the currently booted CD/DVD, you can choose
to have the system eject each CD/DVD automatically after it is installed or
you can choose to manually eject each CD/DVD.

Note: The currently booted CD/DVD must be manually ejected during system
reboot.


[X] Automatically eject CD/DVD
[ ] Manually eject CD/DVD










────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit


After Solaris software is installed, the system must be rebooted. You can
choose to have the system automatically reboot, or you can choose to
manually reboot the system if you want to run scripts or do other
customizations before the reboot. You can manually reboot a system by using
the reboot(1M) command.


[X] Auto Reboot
[ ] Manual Reboot












────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit











You may need to manually eject the CD/DVD or select a different
boot device after reboot to avoid repeating the installation
process.









────────────────────────────────────────────────────────────────────────────────
F2_OK


Please specify the media from which you will install the Solaris Operating
System.

Media:


[ ] CD/DVD
[X] Network File System













────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit


Please specify the path to the network file system from which you will
install the Solaris Operating System. Example:

NFS Location: server:/path_to_Solaris_image

============================================================================

NFS Location: 10.128.16.205:/media/SOL_11_X86













────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back

─ Initializing ─────────────────────────────────────────────────────────────────





The system is being initialized.















Loading install media, please wait...


- Sun Microsystems, Inc. ("Sun")
│ SOFTWARE LICENSE AGREEMENT

│ READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE
│ OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA
│ PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE
│ ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF
│ THESE TERMS BY SELECTING THE "ACCEPT"(OR EQUIVALENT) BUTTON AT
│ THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE
│ TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF
│ PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY,
│ SELECT THE "DECLINE" (OR EQUIVALENT) BUTTON AT THE END OF THIS
│ AGREEMENT. IF YOU HAVE SEPARATELY AGREED TO LICENSE TERMS
│ ("MASTER TERMS") FOR YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS
│ 1-6 OF THIS AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL
│ SUPPLEMENT AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS
│ SOFTWARE.

│ 1. Definitions.
v

────────────────────────────────────────────────────────────────────────────────
F2_Accept License F5_Exit


Select the geographic regions for which support should be installed.

V [/] Australasia
[X] Australia (ISO8859-1)
[ ] New Zealand (ISO8859-1)
> [ ] Eastern Europe
> [ ] Western Europe
> [ ] North America
> [ ] Southern Europe
> [ ] South America
> [ ] Central America
> [ ] Central Europe
> [ ] Asia
> [ ] Northern Europe
> [ ] Middle East
> [ ] Northern Africa




Locale is selected. Press Return to deselect
────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit F6_Help



Select the initial locale to be used after the system has been installed.

[ ] POSIX C ( C )
Australasia
[X] Australia (ISO8859-1) ( en_AU.ISO8859-1 )
[ ] English, Australia (UTF-8) ( en_AU.UTF-8 )















────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit F6_Help


To scan for additional products, select the location you wish to scan.
Products found at the selected location that are in a Web Start Ready
install form will be added to the Products list.

Web Start Ready product scan location:


[X] None
[ ] CD/DVD
[ ] Network File System











────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit


Select the filesystem to use for your Solaris installation


[X] UFS
[ ] ZFS
















────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F5_Exit F6_Help


Select the Solaris software to install on the system.

NOTE: After selecting a software group, you can add or remove software by
customizing it. However, this requires understanding of software
dependencies and how Solaris software is packaged.

[ ] Entire Distribution plus OEM support ....... 8439.00 MB
[X] Entire Distribution ........................ 8439.00 MB
[ ] Developer System Support ................... 8190.00 MB
[ ] End User System Support .................... 5870.00 MB
[ ] Core System Support ........................ 1206.00 MB
[ ] Reduced Networking Core System Support ..... 1143.00 MB









────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F4_Customize F5_Exit F6_Help


On this screen you must select the disks for installing Solaris software.
Start by looking at the Suggested Minimum field; this value is the
approximate space needed to install the software you've selected. Keep
selecting disks until the Total Selected value exceeds the Suggested Minimum
value.
NOTE: ** denotes current boot disk

Disk Device Available Space
=============================================================================
[ ] c0t0d0 0 MB

Total Selected: 0 MB
Suggested Minimum: 6738 MB








────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F4_Edit F5_Exit F6_Help










There is no Solaris fdisk partition on this disk. You must
create a Solaris fdisk partition if you want to use it to
install Solaris software.










────────────────────────────────────────────────────────────────────────────────
F2_OK F5_Cancel


There is no Solaris fdisk partition on this disk. You must create a Solaris
fdisk partition if you want to use this disk to install Solaris software.

One or more of the following methods are available: have the software
install a boot partition and a Solaris partition that will fill the entire
fdisk, install just a Solaris partition that will fill the entire fdisk
(both of these options will overwrite any existing fdisk partitions),
install a Solaris partition on the remainder of the disk, install a boot
partition on the disk, or manually lay out the Solaris fdisk partition.

[X] Use entire disk for Solaris partition (8190 MB)
[ ] Manually create fdisk partitions









────────────────────────────────────────────────────────────────────────────────
F2_OK F5_Cancel F6_Help


On this screen you must select the disks for installing Solaris software.
Start by looking at the Suggested Minimum field; this value is the
approximate space needed to install the software you've selected. Keep
selecting disks until the Total Selected value exceeds the Suggested Minimum
value.
NOTE: ** denotes current boot disk

Disk Device Available Space
=============================================================================
[X] c0t0d0 8184 MB (F4 to edit)

Total Selected: 8184 MB
Suggested Minimum: 6738 MB








────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F4_Edit F5_Exit F6_Help


Do you want to use auto-layout to automatically layout file systems?
Manually laying out file systems requires advanced system administration
skills.


















────────────────────────────────────────────────────────────────────────────────
F2_Auto Layout F3_Go Back F4_Manual Layout F5_Exit F6_Help


Boot Disk: c0t0d0

Entry: swap Recommended: 0 MB Minimum: 0 MB
================================================================================
Slice Mount Point Size (MB)
0 / 7672
1 swap 512
2 overlap 8186
3 0
4 0
5 0
6 0
7 0
================================================================================
Solaris Partition Size: 8190 MB
OS Overhead: 6 MB

Usable Capacity: 8184 MB
Allocated: 8184 MB
Free: 0 MB


────────────────────────────────────────────────────────────────────────────────
F2_OK F4_Options F5_Cancel F6_Help


The summary below is your current file system and disk layout, based on the
information you've supplied.

NOTE: If you choose to customize, you should understand file systems, their
intended purpose on the disk, and how changing them may affect the operation
of the system.

File sys/Mnt point Disk/Slice Size
========================================================================
/ c0t0d0s0 7672 MB
swap c0t0d0s1 512 MB
overlap c0t0d0s2 8186 MB









────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F4_Customize F5_Exit F6_Help


Do you want to mount software from a remote file server? This may be
necessary if you had to remove software because of disk space problems.



















────────────────────────────────────────────────────────────────────────────────
F2_Continue F3_Go Back F4_Remote Mounts F5_Exit F6_Help


The information shown below is your profile for installing Solaris software.
It reflects the choices you've made on previous screens.

NOTE: You must change the BIOS because you have changed the default boot
device.

============================================================================

- Installation Option: Initial
│ Boot Device: c0t0d0
│ Root File System Type: UFS
│ Client Services: None

│ Locales: Australia (ISO8859-1)
│ System Locale: Australia (ISO8859-1) ( en_AU.ISO88

│ Software: Solaris 11, Entire Distribution

│ File System and Disk Layout: / c0t0d0s0 7672 MB
v swap c0t0d0s1 512 MB

────────────────────────────────────────────────────────────────────────────────
F2_Begin Installation F4_Change F5_Exit F6_Help

Preparing system for Solaris install

Configuring disk (c0t0d0)
- Creating Fdisk partition table
- Creating Solaris disk label (VTOC)

Creating and checking file systems
- Creating / (c0t0d0s0)

Beginning Solaris software installation

Solaris 11 software installation partially failed

Solaris 11 packages partially installed
SUNWxwfnt
SUNWxwcft
SUNW5xmft
SUNWgttf
SUNW5ttf
SUNWolrte
SUNWinttf
SUNWjxmft
SUNWkxmft
SUNWcxmft
SUNWtxfnt
SUNWxwoft
SUNWkxfnt
SUNWcttf

Customizing system files
- Mount points table (/etc/vfstab)
- Network host addresses (/etc/hosts)
- Environment variables (/etc/default/init)

Cleaning devices

Customizing system devices
- Physical devices (/devices)
- Logical devices (/dev)

Installing boot information
- Updating boot environment configuration file

Installation log location
- /a/var/sadm/system/logs/install_log (before reboot)
- /var/sadm/system/logs/install_log (after reboot)

Installation complete
sh: /usr/lib/install/data/wizards/bin/parsePackagesToBeAdded: not found
Executing SolStart postinstall phase...
Executing finish script "patch_finish"...


Finish script patch_finish execution completed.

Executing JumpStart postinstall phase...

The begin script log 'begin.log'
is located in /var/sadm/system/logs after reboot.

The finish script log 'finish.log'
is located in /var/sadm/system/logs after reboot.

/sbin/setup-launcher[82]: /usr/lib/install/data/wizards/apps: not found
cp: cannot access launcher.class
cp: cannot access postinstall.class
cp: com/sun/launcher and /a/var/sadm/launcher/com/sun/launcher are identical
cp: cannot access /tmp/find_device.out
cp: cannot access /usr/lib/install/data/wizards/bin/postinstaller
cp: cannot access /usr/lib/install/data/wizards/bin/getVold
cp: cannot access /usr/lib/install/data/wizards/bin/runinstall
cp: cannot access /usr/lib/install/data/wizards/bin/ttyFallback
cp: cannot access /usr/lib/install/data/wizards/bin/setupRoot
chmod: WARNING: can't access /a/var/sadm/launcher/bin/*
cp: cannot access /usr/lib/install/data/wizards/bin/install-launcher
/sbin/setup-launcher[186]: /usr/lib/install/data/wizards/apps: not found
Installing Additional Software

Installation of Additional Software Complete
Creating boot_archive for /a
updating /a/platform/i86pc/boot_archive
updating /a/platform/i86pc/amd64/boot_archive
syncing file systems... done
rebooting...



-bash-3.2# xm start solaris_para_vm
-bash-3.2# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 980 1 r----- 774.0
solaris_para_vm 1 1024 1 ------ 15.9