Saturday, August 30, 2008


Install Xen 3.3 on CentOS 5.2 via http://www.gitco.de/repo/xen3.3.0



It's a review of Sascha's posting to blog mentioned in references
plus test installations PV and HVM DomUs via virt-install with Xen 3.3
Hypervisor running on CentOS 5.2 Dom0 (64-bit).
Download from location above:-



libvirt-0.4.4-3.x86_64.rpm
libvirt-devel-0.4.4-3.x86_64.rpm
libvirt-python-0.4.4-3.x86_64.rpm
xen-3.3.0-2.x86_64.rpm
xen-devel-3.3.0-2.x86_64.rpm
xen-libs-3.3.0-2.x86_64.rpm




Create new file:-



#vi /etc/yum.repos.d/XEN.repo
[xen]
name=CentOS-$releasever - XEN
baseurl=http://www.gitco.de/repo/xen3.3.0
gpgcheck=0




Then run:-



[root@ServerRHL51 InstallXen3.3]# yum install xen-3.3.0-2.x86_64.rpm \
> xen-devel-3.3.0-2.x86_64.rpm xen-libs-3.3.0-2.x86_64.rpm \
> libvirt-0.4.4-3.x86_64.rpm libvirt-devel-0.4.4-3.x86_64.rpm \
> libvirt-python-0.4.4-3.x86_64.rpm
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
xen 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 3.7 kB 00:00
################################################## 7/7
Parsing package install arguments
Examining xen-3.3.0-2.x86_64.rpm: xen - 3.3.0-2.x86_64
Marking xen-3.3.0-2.x86_64.rpm as an update to xen - 3.2.1-0xs.x86_64
Examining xen-devel-3.3.0-2.x86_64.rpm: xen-devel - 3.3.0-2.x86_64
Marking xen-devel-3.3.0-2.x86_64.rpm as an update to xen-devel - 3.2.1-0xs.x86_64
Examining xen-libs-3.3.0-2.x86_64.rpm: xen-libs - 3.3.0-2.x86_64
Marking xen-libs-3.3.0-2.x86_64.rpm as an update to xen-libs - 3.2.1-0xs.x86_64
Examining libvirt-0.4.4-3.x86_64.rpm: libvirt - 0.4.4-3.x86_64
Marking libvirt-0.4.4-3.x86_64.rpm as an update to libvirt - 0.3.3-7.el5.x86_64
Examining libvirt-devel-0.4.4-3.x86_64.rpm: libvirt-devel - 0.4.4-3.x86_64
Marking libvirt-devel-0.4.4-3.x86_64.rpm to be installed
Examining libvirt-python-0.4.4-3.x86_64.rpm: libvirt-python - 0.4.4-3.x86_64
Marking libvirt-python-0.4.4-3.x86_64.rpm as an update to libvirt-python - 0.3.3-7.el5.x86_64
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package xen.x86_64 0:3.3.0-2 set to be updated
---> Package xen-devel.x86_64 0:3.3.0-2 set to be updated
---> Package xen-libs.x86_64 0:3.3.0-2 set to be updated
---> Package libvirt.x86_64 0:0.4.4-3 set to be updated
---> Package libvirt-devel.x86_64 0:0.4.4-3 set to be updated
---> Package libvirt-python.x86_64 0:0.4.4-3 set to be updated
--> Running transaction check
--> Processing Dependency: /usr/bin/qemu-img for package: libvirt
--> Processing Dependency: iscsi-initiator-utils for package: libvirt
--> Processing Dependency: cyrus-sasl-md5 for package: libvirt
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for cyrus-sasl-md5 to pack into transaction set.
cyrus-sasl-md5-2.1.22-4.x 100% |=========================| 15 kB 00:00
---> Package cyrus-sasl-md5.x86_64 0:2.1.22-4 set to be updated
---> Downloading header for qemu to pack into transaction set.
qemu-0.9.0-4.x86_64.rpm 100% |=========================| 13 kB 00:00
---> Package qemu.x86_64 0:0.9.0-4 set to be updated
---> Downloading header for iscsi-initiator-utils to pack into transaction set.
iscsi-initiator-utils-6.2 100% |=========================| 12 kB 00:00
---> Package iscsi-initiator-utils.x86_64 0:6.2.0.868-0.7.el5 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
libvirt-devel x86_64 0.4.4-3 libvirt-devel-0.4.4-3.x86_64.rpm 1.0 M
Updating:
libvirt x86_64 0.4.4-3 libvirt-0.4.4-3.x86_64.rpm 6.0 M
libvirt-python x86_64 0.4.4-3 libvirt-python-0.4.4-3.x86_64.rpm 339 k
xen x86_64 3.3.0-2 xen-3.3.0-2.x86_64.rpm 15 M
xen-devel x86_64 3.3.0-2 xen-devel-3.3.0-2.x86_64.rpm 843 k
xen-libs x86_64 3.3.0-2 xen-libs-3.3.0-2.x86_64.rpm 1.0 M
Installing for dependencies:
cyrus-sasl-md5 x86_64 2.1.22-4 base 46 k
iscsi-initiator-utils x86_64 6.2.0.868-0.7.el5 base 575 k
qemu x86_64 0.9.0-4 extras 4.5 M

Transaction Summary
=============================================================================
Install 4 Package(s)
Update 5 Package(s)
Remove 0 Package(s)

Total download size: 29 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): cyrus-sasl-md5-2.1 100% |=========================| 46 kB 00:00
(2/3): qemu-0.9.0-4.x86_6 100% |=========================| 4.5 MB 02:35
(3/3): iscsi-initiator-ut 100% |=========================| 575 kB 00:19
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : xen-libs ####################### [ 1/14]
Installing: iscsi-initiator-utils ####################### [ 2/14]
Installing: qemu ####################### [ 3/14]
Installing: cyrus-sasl-md5 ####################### [ 4/14]
Updating : libvirt ####################### [ 5/14]
Updating : libvirt-python ####################### [ 6/14]
Updating : xen ####################### [ 7/14]
Updating : xen-devel ####################### [ 8/14]
Installing: libvirt-devel ####################### [ 9/14]
Cleanup : xen ####################### [10/14]
Cleanup : xen-devel ####################### [11/14]
Cleanup : xen-libs ####################### [12/14]
Cleanup : libvirt ####################### [13/14]
Cleanup : libvirt-python ####################### [14/14]

Installed: libvirt-devel.x86_64 0:0.4.4-3
Dependency Installed: cyrus-sasl-md5.x86_64 0:2.1.22-4 iscsi-initiator-utils.x86_64 0:6.2.0.868-0.7.el5 qemu.x86_64 0:0.9.0-4
Updated: libvirt.x86_64 0:0.4.4-3 libvirt-python.x86_64 0:0.4.4-3 xen.x86_64 0:3.3.0-2 xen-devel.x86_64 0:3.3.0-2 xen-libs.x86_64 0:3.3.0-2
Complete!




Reboot system



[root@RHEL52 ~]# xm dmesg
__ __ _____ _____ ___
\ \/ /___ _ __ |___ / |___ / / _ \
\ // _ \ '_ \ |_ \ |_ \| | | |
/ \ __/ | | | ___) | ___) | |_| |
/_/\_\___|_| |_| |____(_)____(_)___/

(XEN) Xen version 3.3.0 (root@labor.lan) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) Thu Aug 28 22:24:29 CEST 2008
(XEN) Latest ChangeSet: unavailable
(XEN) Command line:
(XEN) Video information:
(XEN) VGA is text mode 80x25, font 8x16
(XEN) VBE/DDC methods: none; EDID transfer time: 0 seconds
(XEN) EDID info not retrieved because no DDC retrieval method detected
(XEN) Disc information:
(XEN) Found 0 MBR signatures
(XEN) Found 2 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN) 0000000000000000 - 000000000009ec00 (usable)
(XEN) 000000000009ec00 - 00000000000a0000 (reserved)
(XEN) 00000000000e4000 - 0000000000100000 (reserved)
(XEN) 0000000000100000 - 00000000cff80000 (usable)
(XEN) 00000000cff80000 - 00000000cff8e000 (ACPI data)
(XEN) 00000000cff8e000 - 00000000cffe0000 (ACPI NVS)
(XEN) 00000000cffe0000 - 00000000d0000000 (reserved)
(XEN) 00000000fee00000 - 00000000fee01000 (reserved)
(XEN) 00000000ffe00000 - 0000000100000000 (reserved)
(XEN) 0000000100000000 - 0000000230000000 (usable)
(XEN) System RAM: 8191MB (8387704kB)
(XEN) ACPI: RSDP 000FBB80, 0014 (r0 ACPIAM)
(XEN) ACPI: RSDT CFF80000, 003C (r1 A_M_I_ OEMRSDT 10000730 MSFT 97)
(XEN) ACPI: FACP CFF80200, 0084 (r2 A_M_I_ OEMFACP 10000730 MSFT 97)
(XEN) ACPI: DSDT CFF805C0, 8E13 (r1 A0840 A0840001 1 INTL 20060113)
(XEN) ACPI: FACS CFF8E000, 0040
(XEN) ACPI: APIC CFF80390, 006C (r1 A_M_I_ OEMAPIC 10000730 MSFT 97)
(XEN) ACPI: MCFG CFF80400, 003C (r1 A_M_I_ OEMMCFG 10000730 MSFT 97)
(XEN) ACPI: OEMB CFF8E040, 0081 (r1 A_M_I_ AMI_OEM 10000730 MSFT 97)
(XEN) ACPI: HPET CFF893E0, 0038 (r1 A_M_I_ OEMHPET 10000730 MSFT 97)
(XEN) ACPI: OSFR CFF89420, 00B0 (r1 A_M_I_ OEMOSFR 10000730 MSFT 97)
(XEN) Xen heap: 14MB (14500kB)
(XEN) Domain heap initialised
(XEN) Processor #0 7:7 APIC version 20
(XEN) Processor #1 7:7 APIC version 20
(XEN) IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23
(XEN) Enabling APIC mode: Flat. Using 1 I/O APICs
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Detected 3005.619 MHz processor.
(XEN) HVM: VMX enabled
(XEN) CPU0: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz stepping 06
(XEN) Booting processor 1/1 eip 8c000
(XEN) CPU1: Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz stepping 06
(XEN) Total of 2 processors activated.
(XEN) ENABLING IO-APIC IRQs
(XEN) -> Using new ACK method
(XEN) checking TSC synchronization across 2 CPUs: passed.
(XEN) Platform timer is 14.318MHz HPET
(XEN) Brought up 2 CPUs
(XEN) I/O virtualisation disabled
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Xen kernel: 64-bit, lsb, compat32
(XEN) Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff807014e4
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN) Dom0 alloc.: 0000000226000000->0000000228000000 (2022123 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN) Loaded kernel: ffffffff80200000->ffffffff807014e4
(XEN) Init. ramdisk: ffffffff80702000->ffffffff80e8be00
(XEN) Phys-Mach map: ffffffff80e8c000->ffffffff81e09758
(XEN) Start info: ffffffff81e0a000->ffffffff81e0a4a4
(XEN) Page tables: ffffffff81e0b000->ffffffff81e1e000
(XEN) Boot stack: ffffffff81e1e000->ffffffff81e1f000
(XEN) TOTAL: ffffffff80000000->ffffffff82000000
(XEN) ENTRY ADDRESS: ffffffff80200000
(XEN) Dom0 has maximum 2 VCPUs
(XEN) Scrubbing Free RAM: .done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: Errors and warnings
(XEN) Guest Loglevel: Nothing (Rate-limited: Errors and warnings)
(XEN) Xen is relinquishing VGA console.
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
(XEN) Freed 108kB init memory.
(XEN) ioapic_guest_write: apic=0, pin=22, old_irq=-1, new_irq=-1
(XEN) ioapic_guest_write: old_entry=00010a0b, new_entry=0001a9d0
(XEN) ioapic_guest_write: Special delivery mode 2 with non-zero vector 0b
(XEN) mm.c:676:d1 Non-privileged (1) attempt to map I/O space 000000f0




Install CentOS 5.2 DomU via virt-install

















Install Solaris 10 (05/08) HVM DomU via virt-install

























Solaris Nevada (b93) DomU at Xen 3.3 CentOS 5.2 Dom0








References
http://www.ruslansivak.com/index.cfm/2008/7/7/Xen-32-on-CentOS-52--x8664--RHEL-52-x8664

Tuesday, August 26, 2008


Solaris Nevada DomUs internet working at Xen 3.3 CentOS 5.2 Dom0 (64 bit)



First install Xen 3.3 from mercurial repository on xen-disabled CentOS 5.2 instance,previously installed the most recent version of "git" on the system (git-1.6.0.tar.gz), otherwise "make world" would fail.



# cd /usr/src/
# hg clone http://xenbits.xensource.com/xen-3.3-testing.hg
# cd xen-3.3-testing.hg
# make world
# make install




Determine the name of the Xen Linux kernel version that was installed.



# ls /lib/modules




There should be a directory for the Xen Linux kernel (e.g., 2.6.18.8-xen)
Generate the module dependency list and map files



# /sbin/depmod 2.6.18.8-xen




Create the Xen initial ramdisk image



# /sbin/mkinitrd /boot/initrd-2.6.18.8-xen.img 2.6.18.8-xen




Disable tls


 
# mv /lib64/tls /lib64/tls.disabled




Set xend service to start



# /sbin/chkconfig --add xend
# /sbin/chkconfig xend on




Install bridge-utils:-



# yum install bridge-utils




Edit /boot/grub/grub.conf and copy one of the existing boot entries to make the required changes for Xen and reboot into new kernel.



title Xen-3.3 CentOS 5.2 x86_64 (2.6.18.8-xen)
root (hd1,4)
kernel /xen-3.3.gz
module /vmlinuz-2.6.18.8-xen ro root=/dev/VolGroup01/LogVol00 rhgb quiet
module /initrd-2.6.18.8-xen.img












Open following 3 ports on firewall:-


67/UDP Bootstrap Protocol (BOOTP) Server; also used by Dynamic Host Configuration Protocol (DHCP)
68/UDP Bootstrap Protocol (BOOTP) Client; also used by Dynamic Host Configuration Protocol (DHCP)
53/TCP,UDP Domain Name System (DNS)


Allow SSH,HTTPS,HTTP services and proceed with SNV94 DomU install in DHCP mode with pygrub profile:-



name = 'Solaris94PV'
memory = '2048'
disk = [ 'file:/usr/lib/xen-solaris/snv94.iso,6:cdrom,r','phy:/dev/sda10,0,w']
vif = [ 'bridge = eth0' ]
bootloader = '/usr/bin/pygrub'
kernel = '/boot/platform/i86xpv/kernel/amd64/unix'
ramdisk = '/boot/amd64/x86.miniroot'
extra = '/platform/i86xpv/kernel/amd64/unix - nowin -B install_media=cdrom'









Load SNV94 DomU with profile:-



name = 'Solaris94PV'
memory = '2048'
disk = ['phy:/dev/sda10,0,w']
vif = [ 'bridge = eth0' ]




Bfu DomU to build 96 and reboot:-








Setup Sun Xvnc on DomU and verify Internet access:-











Notice also,that Solaris 10 (05/08) and Free BSD 7 HVM DomUs (32-bit on Intel,64-bit on AMD X2) may be easily installed at Xen 3.3 Linux Dom0(64 bit)
References
1.http://lxer.com/module/newswire/view/100541/index.html

Thursday, August 21, 2008


Deployment Seam 2.0.2 Application against Oracle 10gR2 database to Jboss 4.2.3 via NetBeans 6.1 on Solaris Nevada (b96)



Technical exercise bellow is targeting testing Jboss-Seam 2.0.2 SP1 with
NetBeans 6.1 (JDK 6.0) to deploy Brian Leonard's Sample to Jboss 4.2.3
on Solaris Nevada ( build 96) with xVM kernel.
Hibernate has been selected as persistence provider. Oracle 10gR2 database instance has been installed on SNV93 DomU for performance evaluation.

Oracle 10g installation procedure on Solaris Nevada DomU may be viewed if needed



To tune Jboss 4.2.3 instance and make it connects to Oracle Server, perform the following steps on the JBoss Application Server 4.2.3 :
Download the JDBC driver for Oracle 10g Release 2 located at:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
For the Oracle JDBC driver with JDK 1.4 and 1.5, use the ojdbc14.jar file.
Copy the JDBC driver to the JBoss environment by entering the following:
# cp ojdbc14.jar $JBOSS_HOME/server/default/lib
Create a file named $JBOSS_HOME/server/default/deploy/oracle-ds.xml and add the following contents:



<datasources>
<local-tx-datasource>
<jndi-name>oracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@IP_OR_HOSTNAME_OF _ORACLE_DB_ SERVER:1521:ORACLE_SID
</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>USERNAME</user-name>
<password>PASSWORD</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>




Testing the Oracle Database Connectivity
Test the connectivity between JBoss and Oracle by performing the following steps on the JBoss Application Server:
Create a JSP file named $JBOSS_HOME/server/default/deploy/jmx-console.war/oracleTest.jsp and add the following contents:



<%@page contentType="text/html" import="java.net.*,java.util.*,org.jboss.jmx.adaptor.model.*,
java.io.*,java.sql.*,javax.sql.*,javax.naming.*"%>
<html>
<head>
<title>JBoss->Oracle Test </title>
<link rel="stylesheet" href="style_master.css" type="text/css">
<meta http-equiv="cache-control" content="no-cache">
</head>
<body>
<%
InitialContext ctx = new InitialContext();
DatabaseMetaData dm = null;
DataSource ds = (DataSource)
ctx.lookup("java:/oracleDS");
Connection conn = null;
Statement stmt = null;
try {
conn = ds.getConnection();
dm =conn.getMetaData();
out.println("Connected to-> database version "+dm.getDatabaseProductVersion());
}catch (Exception sqlex) {
out.println(sqlex.getMessage());
}finally{
conn.close();
}
%>
</body>
</html>




Start JBoss by entering the following:
# $JBOSS_HOME/bin/run.sh
Verify that the Oracle test page is displayed by opening a browser and navigating to the following URL:
http://localhost:8080/jmx-console/oracleTest.jsp








Follow [1],[2] in new environment.
Add corresponding jars to ejb and web modules ([2]) and
proceed with persistence.xml , keeping Hibernate as persistence provider and selecting datasource as


java:/OracleDS


previously defined for Jboss 4.2.3 Server.








Proceed with tuning web.xml,ejb-jar.xml,faces-config.xml per [1].














Modify code of entity bean User.java and RegistrationActionBean.java ([1])
to instantiate Seam instances at runtime and delete JSF managed bean
as no longer needed.Right click in text area to run "Fix imports" and
select appropriate ones. Embedding seam annotations will require this
fixes to be done.








Annotation @Interceptors({org.jboss.seam.ejb.SeamInterceptor.class})
is required only if ejb-jar.xml has not been modified.
Otherwise , it is not needed








Deploy "Registration Application" to Jboss and run.











Connect to Oracle database from NetBeans 6.1 and perform query against table "users" cumulating inserted records.








Jboss status via NetBeans 6.1 may be viewed here.











Regarding "Seam Plugin for NetBeans 6.1" , please , view [3],[4].
Viewing comments in [3] requires login, otherwise feedbacks stay hidden.
References
1.http://weblogs.java.net/blog/bleonard/archive/2007/06/seam_refresh_1.html
2.http://weblogs.java.net/blog/caroljmcdonald/archive/2008/01/sample_applicat_4.html
3.http://davidsalter.co.uk/index.php?q=node/104
4.http://seamframework.org/Community/SeamgenNetbeansPlugin