UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

44
Unix to SUSE® Linux Enterprise Server Tools and Tips for a Successful Migration Darren R. Davis Sr. Manager ISV Engineering [email protected] PK Mishra Principal Consulting Architect Novell India [email protected]

description

Tired of expensive, proprietary UNIX systems? Today’s IT professionals are making strategic investments in Linux, preferring its open architecture and low cost to the proprietary—and very expensive—UNIX platform. This session will target all those who are looking to move their software application from UNIX to SUSE Linux Enterprise. We will cover the programming languages, developer tools, and programming APIs that are available for many software applications types. We will also discuss how to plan and structure a porting project for SUSE Linux Enterprise Server.

Transcript of UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Page 1: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Unix to SUSE® Linux Enterprise ServerTools and Tips for a Successful Migration

Darren R. DavisSr. Manager ISV [email protected]

PK MishraPrincipal Consulting ArchitectNovell [email protected]

Page 2: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.2

2006 2007 2008 2009 2010 2011 2012

2

3

4

5

6

7

8

9

3.84.4

5.2

6.0

6.9

7.78.3

3.2 3.0 2.9 2.8 2.6 2.5 2.4

Worldwide Server Operating Environment ForecastPaid Linux vs Paid UNIX Installed Base (million servers)

Linux UNIX

Year

Inst

alle

d Ba

se

23% 20%

40% 36%

47%

35%

29% 26%

21%6%

21%

20%

15%23%

26%39%

4%

10%

6%2%

3%10%2% 4%

40% 40%

4%

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

Solaris(N=343)

SCO (N=20)

AIX (N=225)

Other Unix(N=43)

HP UX(N=249)

HP Tru64(N=52)

Not sure

Other

Unix

Linux

Windows

Enterprises Are Migrating from UNIX to Linux

Why are they migrating?

Better priceperformance

More innovation Less risk

UNIX Migration Path by UNIX Platform

Source: IDC UNIX Migration Survey, 2006

Source: WW Client and Server Operating Environments 2008-2012 Forecast, IDC April 2008

Page 3: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.3

What is UNIX?

• UNIX is a registered trademark of the Open Group– http://www.unix.org/ and http://www.opengroup.org/– A set of specifications for defining operating system interfaces

> Single UNIX Specification Version 3> UNIX 98, UNIX 03> IEEE POSIX> ISO C

– Products are certified by the Open Group to meet the UNIX specification (AIX, HP/UX, Mac OS X, SCO, Solaris)

– UNIX was a product (SVR3, SVR4), but now it is a specification.• Linux is based on the UNIX specifications

– Linux standard base

Page 4: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.4

Who Is Migrating?

www.novell.com/success

Page 5: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.5

Agenda

Server Migration Considerations

Application Porting Considerations

Tools and Resources

Next Steps

Page 6: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Server Migration Considerations

Page 7: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.7

System Administrator View

• Solaris Boot Manager vs GRUB / LILO • Both support a variety of installation method – rapid install on

mass scale is easier for SUSE® Linux Enterprise Server• Filesystem types – safe, secure, scalable

– Solaris (ufs, zfs..) - SLES (ext3, ext4, reiserfs, xfs, ocfs2)

• /tmp by default in memory as tmpfs filesystem• Similar content in directories /etc, /lib, /sbin, /usr, /opt etc.• /boot and /proc contents are not so similar• Init process is quite similar• /usr/X11 is similar

– Solaris Motif and CDE interface – JDS / KDE / GNOME also– SLES has no Motif / CDE

• Solaris packages are pkgadd format – SLES is rpm format

Page 8: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.8

System Administrator View (continued)

• YaST2 – A very productive GUI / CLI Tool for doing almost everything right from Installation

through Optimization

– Much better compared to default Solaris installation

– System Update / Patching / Addon mechanisms vary quite a bit

• Use YaST2 to configure and reuse most config files– Networking

– DHCP / DNS / openLDAP / iptables

– Authentication / Kerberos / PAM configuration

– NIS Services

– NFS Services

– CIFS (Samba) Services

– Security, Firewall and Services Enabling

– MAC and DAC using AppArmor (SELinux)

– Modify / Reconfig various init and inet services

– System Log Management

Page 9: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.9

System Administrator View (continued)

• Device naming conventions vary – Solaris /dev/dsk/c0t0d0p0 - SUSE® /dev/sda1– Do not assume similar device names

• MySQL / PostgreSQL behave similar – little variation in clustering• Both support loadable module - In SUSE Linux Enterprise Server

compile kernel and kernel modules – make config– make all

• Backup / Restore strategy remain almost same • Virtualization

– SLES supports Xen virtualization out-of-box – VirtualBox runs on SLES11 with some effort – VM migration ok

• Most Common Open Source Management Tools– Webmin, Nagios

Page 10: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Application Porting Considerations

Page 11: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.11

Application Porting

The process of taking a software application that is

built for a specific operating system and machine

architecture and moving that application to a new

operating system and possibly machine architecture.

For example, Solaris (UNIX) on SPARC to SUSE®

Linux on x86-64.

Page 12: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.12

Application Porting Process

Application Scoping

Porting Analysis

Porting by Engineer

Testing and Certification

Page 13: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.13

Application Porting Considerations

Application programming language and compilers

Application build environment and tools

Platform dependent issues (machine architecture, OS, etc.)

Platform run-time services (system services and daemons)

Middleware dependencies (database, libraries, etc.)

User interface dependencies (libraries)

Application testing environment (test tools, resources)

Application support issues

Page 14: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.14

Application Programming Language and Compilers• GNU Compiler Collection - GCC

– C, C++, Fortran– ISO C (C89, C95, C99) (Flags for setting standard)– http://gcc.gnu.org

• SUSE® Linux Enterprise 11 versions– GCC 4.3 Compiler– GDB 6.8 Debugger– Glibc 2.8 Standard C Library

• Java– SUSE Linux Enterprise Server 11 includes IBM Java 1.4.2

and IBM Java SE 6– SUSE Linux Enterprise Desktop 11 includes Sun Java SE 6

Page 15: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.15

Application Build Environment and ToolsApplication Build Environment

• Make– gmake (GNU Make 3.81)

> http://www.gnu.org/software/make/

– Autoconf (GNU Autoconf)• Source Code Control

– SVN (Subversion)> http://subversion.tigris.org/

– CVS (Concurrent Versions System)> http://www.nongnu.org/cvs/

• Commercial Build Tools– IBM Rational Software on SUSE® Linux Enterprise Server– Sun Studio - C, C++, and Fortran for Solaris and Linux

Page 16: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.16

Application Build Environment and ToolsApplication Build Tools

• GNU Binutils (binary utilities)

– /usr/bin/ar (utility for maintaining archives for static libs)

– /usr/bin/gprof (utility for displaying profiling information)

– /usr/bin/ld (the GNU linker)

– /usr/bin/nm (list symbols from object files)

– /usr/bin/objdump (display information from object files)

– /usr/bin/readelf (display information from ELF object files)

http://www.gnu.org/software/binutils/

Page 17: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.17

Application Build Environment and ToolsApplication Build Tools (continued)

• The GNU Linker

– /usr/bin/ld

– Generally considered better to use the 'gcc' command

– pass options from 'gcc' to the linker 'ld' with '-Wl' option

– An example to build a Dynamic Shared Object Library

> gcc -fPIC -shared libhello.c -Wl,-soname,libhello.so.1 -o libhello

– Supports the use of linker scripts

Page 18: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.18

Application Build Environment and ToolsApplication Build Tools—objdump

~/Projects/hello> objdump -s -j .comment hello

hello: file format elf64-x86-64

Contents of section .comment: 0000 00474343 3a202847 4e552920 342e312e .GCC: (GNU) 4.1. 0010 32203230 30373031 31352028 70726572 2 20070115 (prer 0020 656c6561 73652920 28535553 45204c69 elease) (SUSE Li 0030 6e757829 00004743 433a2028 474e5529 nux)..GCC: (GNU) 0040 20342e31 2e322032 30303730 31313520 4.1.2 20070115 0050 28707265 72656c65 61736529 20285355 (prerelease) (SU 0060 5345204c 696e7578 29000047 43433a20 SE Linux)..GCC:

Page 19: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.19

Application Build Environment and ToolsApplication Build Tools—readelf

~/Projects/hello> readelf -e helloELF Header: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: Advanced Micro Devices X86-64 Version: 0x1 Entry point address: 0x400440 Start of program headers: 64 (bytes into file) Start of section headers: 4768 (bytes into file) Flags: 0x0 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 9 Size of section headers: 64 (bytes) Number of section headers: 38 Section header string table index: 35

Page 20: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.20

Platform Dependent Issues

• Machine Architecture– 32-bit and 64-bit architecture

– Big/little Endian issues (SPARC to Intel)

• Operating System Differences– Solaris / UNIX versus Linux signals

– Network programming API (sockets versus TLI)

– POSIX threads API (Linux threads, Solaris threads)

– Interprocess communication (IPC)

• Internationalization (I18N) and Localization (L10N)– UNICODE, UTF-8, UTF-16/UCS-2, UTF-32/UCS-4

Page 21: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.21

Platform Dependent IssuesMachine Architecture

• Big / little Endian portability (byte ordering)– Intel machines LE– SPARC machines BE– Network ordering is BE– Watch data format between BE and LE machines

> binary data files

– Check for nonuniform data references> Pointers> Unions> Structure packing

– Never cast a pointer to an integer and explicitly reference data

Page 22: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.22

Platform Dependent IssuesMachine Architecture (continued)

• Porting from Solaris on SPARC to Solaris on Intel may be a good intermediate step to getting to Linux on Intel (though extra step)

• 32-bit to 64-bit porting and migration– GCC provides compiler switches '-m32' or '-m64'– Common Issues

> Data type mismatch> 64-bit architecture is LP64> 32-bit architecture is ILP32

– Use 'sizeof' operator– Use POSIX data types <sys/types.h>

> like pid_t for process ID's

– Ignoring signed extensions is a common issue

Page 23: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.23

Platform Run-time Services

• System daemons and resources– System startup scripts

> Located in /etc/rc.d/> Follow the LSB Standard> http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic

/LSB-Core-generic/iniscrptact.html > http://www.novell.com/coolsolutions/feature/11256.html> Adds commands in comment blocks

– Account for all run-time services used by application> NFS> INETD> And others...

Page 24: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.24

Middleware Dependencies

• GNU glibc C Library– http://www.gnu.org/software/libc/

– Follows standards (ISO C 99, POSIX, SUS, UNIX 98)

– Useful commands> /usr/bin/ldd (display shared library dependencies)

> /lib/libc.so.6 (displays information about glibc)

• GNU Standard C++ Library– http://gcc.gnu.org/libstdc++/

– ISO 14882 Standard C++ Library

– Part of GCC

Page 25: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.25

Middleware DependenciesUseful Commands

~/Projects/hello> ldd hello

libc.so.6 => /lib64/libc.so.6 (0x00002b25b80d0000)

/lib64/ld-linux-x86-64.so.2 (0x00002b25b7fb4000)

~/Projects/hello>

Page 26: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.26

Middleware DependenciesUseful Commands (continued)

~/Projects/hello> /lib64/libc.so.6GNU C Library development release version 2.4 (20070503), by Roland McGrath et al.Copyright (C) 2006 Free Software Foundation, Inc.This is free software; see the source for copying conditions.There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR APARTICULAR PURPOSE.Configured for x86_64-suse-linux.Compiled by GNU CC version 4.1.2 20070115 (prerelease) (SUSE Linux).Compiled on a Linux 2.6.16 system on 2007-05-03.Available extensions: crypt add-on version 2.1 by Michael Glad and others GNU Libidn by Simon Josefsson GNU libio by Per Bothner NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk Native POSIX Threads Library by Ulrich Drepper et al BIND-8.2.3-T5BThread-local storage support included.For bug reporting instructions, please see:<http://www.gnu.org/software/libc/bugs.html>.~/Projects/hello>

Page 27: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.27

Middleware DependenciesDatabases

• Database support included– MySQL (Version 5 in SUSE® Linux Enterprise Server 11)– PostgreSQL (Version 8.3.3 in SUSE Linux Enterprise Server 11)– Berkeley DB (Version 4.5 in SUSE Linux Enterprise Server 11)

• Commercial databases available– Oracle– SAP– Enterprise DB (PostgreSQL)

• Database interfaces– ODBC– JDBC

Page 28: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.28

Middleware DependenciesSummary

• Many open source libraries and middleware– Check the SUSE® Linux Enterprise SDK

– Check the LSB specification for libraries

– Follow the LSB guidelines for use if making portable application (library not in the LSB)

– CORBA ORB (orbit is open source, commercial available)

– Curses applications use ncurses

• Commercial libraries and Middleware– Make sure they support SUSE Linux Enterprise

– Account for third-party dependencies in porting

Page 29: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.29

User Interface Dependencies

• Motif– The Open Motif runtime environment

> http://www.motifzone.net/

• CDE® (Common Desktop Environment)– Commercial version available for Linux

• GTK (The GIMP Tool Kit)– http://www.gtk.org/

– Used by the GNOME Project> http://www.gnome.org/

Page 30: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.30

Application Testing Environment

• GDB (GNU Debugger)– http://sourceware.org/gdb/

– GUI Front End DDD (Data Display Debugger)> http://www.gnu.org/software/ddd/

• Memory debugging– Glibc provides memory debugging options

> mcheck, mtrace, MALLOC_CHECK

– Electric fence

– Valgrind

Page 31: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.31

Application Testing Environment (continued)

• Kernel debugging in SUSE® Linux Enterprise– SystemTap– Crash– kdump

• Application profiling– GNU Profiler 'gprof' part of binutils– 'strace' (system function call tracer)– 'ltrace' (library call tracer)– OProfile (system-wide profiler)– Linux commands

> iostat, vmstat, ps, top

Page 32: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.32

Application Testing Environment (continued)

• Commercial Tools

– Allinea DDT

– IBM Rational Purify

– Intel Software Group

– SGI ProPack

– TotalView Technologies Debugger

– TotalView Technologies MemoryScape

Page 33: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.33

Application Support Issues

• Defect reporting– Bugzilla

• Maintain SUSE® Linux Enterprise Server test environment

– Reproduce issues– Possibly maintain Solaris environment to compare

• Maintain SUSE Linux Enterprise Server build environment

– Rebuild update versions of applications• Novell® Technical Support

– To report any issues with SUSE Linux Enterprise

Page 34: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Tools and Resources

Page 35: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.35

SUSE® Linux Enterprise SDK

• C and C++ compiler in base SLE

• SDK contains the development packages

– Headers

– Development libraries

• Many extra packages

• Download from Novell®

• http://developer.novell.com/wiki/index.php/SLES_SDK

Page 36: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.36

Books

UNIX to Linux Porting Prentice Hall, ISBN 0-13-187109-9

Page 37: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.37

Internet Websites

• Novell® Developer Community

– http://developer.novell.com/wiki/index.php/Developer_Home

• Novell Porting and Migration Center

– http://developer.novell.com/wiki/index.php/Porting_and_Migration

• Linux Foundation Developer Network

– http://ldn.linuxfoundation.org/

• openSUSE® and openSUSE Build Service

– http://www.opensuse.org/

Page 38: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.38

Linux FoundationLSB Application Checker

• Application details:– Web UI based on embedded web server– Both installable and unpack-and-run versions

• Main features:– Accepts application as a set of components: binaries and .so

possibly in various directories or/and packed in .rpm / tar.gz (arbitrary mix)

– Visualizes external dependencies (libraries and interfaces) of the application (internal dependencies between components are excluded)

– For libraries, it highlights differences between required (DT_NEEDED) and actually used libraries

Page 39: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.39

Linux FoundationLSB Application Checker (continued)

• Results from using

– Local application analysis

– Optional submit info to the Linux Foundation to include in the Database Navigator

– Used to apply for LSB-compliance certification

• http://ldn.linuxfoundation.org/lsb/check-your-app

Page 40: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.40

Linux FoundationLSB Database Navigator

• Interactive reference guide for Linux API / ABI elements:

– Allows you to browse applications or distributions

– Information about the Linux Ecosystem

– Show Libraries and Interfaces used or available

– Great for understanding how applications are built for LSB

– Part of the Linux Developer Network

• http://www.linuxfoundation.org/navigator/

Page 41: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Next Steps

Page 42: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

© Novell, Inc. All rights reserved.42

Next Steps

OnDemand Webcast—The Business Case for Migrating from Solaris to SUSE® Linux Enterprise Server

www.novell.com/idc

Other UNIX to Linux migration resources

www.novell.com/solaris

Limited time offer—Zero Risk Migration Assessment

www.novell.com/promo/100/solaris.html

Page 43: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration
Page 44: UNIX to SUSE Linux Enterprise Server : Tools and Tips for a Successful Migration

Unpublished Work of Novell, Inc. All Rights Reserved.This work is an unpublished work and contains confidential, proprietary, and trade secret information of Novell, Inc. Access to this work is restricted to Novell employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of Novell, Inc. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.

General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. Novell, Inc. makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for Novell products remains at the sole discretion of Novell. Further, Novell, Inc. reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All Novell marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.