Solaris-Virtualizati..

Download Report

Transcript Solaris-Virtualizati..

Alcatel-Lucent: SUN Virtualization Implementations
(Concepts & Details)
Version 1.0 – January 27th, 2009
IT Infrastructure Engineering
Author: Asim Zuberi
Good Evening!
Page 2
Basic Concepts…
Basic Concepts: Sun Zones
Page 4
Basic Concepts: Sun Zones
 What is the purpose/meaning of the Russian Dolls?
 The technique of creating objects inside objects.
Page 5
Basic Concepts: Sun Zones
 The objective of virtualization: is to increase
the level of utilization in pursuit of more value,
efficiency and affordability
Page 6
Basic Concepts: Sun Zones

Solaris Zones technology, a way to virtualize system resources and
use multiple software partitions with one instance of the OS.
 The Solaris Containers functionality comprises two main
components, Solaris Zones partitioning technology and Resource
Management tools.
 The Solaris Zones feature enables the administrator to create
separate environments for running applications, while the Resource
Management framework allows for the allocation, management, and
accounting of system resources such as CPU and memory.
 Solaris Containers functionality is hardware independent and is
available on any machine that will support the Solaris 10 OS.
Page 7
Basic Concepts: Sun Zones
Two types of zones exist: global and non-global.
A machine with the Solaris Zones feature enabled has one global
zone and up to 8191 non-global zones.
Each zone has an ID assigned by the system when it's booted with
the global zone, always listed as zone ID 0.
Only the global zone contains a bootable Solaris kernel and is aware
of all devices, file systems, and other zones.
The global zone is also the only zone from which non-global zone
configuration, installation, and management are possible.
Non-global zones contain a subset of the Solaris OS installed in the
global zone and possibly additional packages not installed in the
global zone.
Each non-global zone has its own package database listing each
software package installed relative to the zone and does not share
package information with the global or other non-global zones.
Page 8
Basic Concepts: Sun Zones
Page 9
Solaris 10 Native Zones
Solaris 10: Native Zones
Step 1 to Solaris Zones - Creating Zones
1. login to a system as root
2. check the current status of the zones using zoneadm command
# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
a clean system without any non-global zones installed.
3. check the interface name (e.g. ce0, ce4, gbe0, etc)
3. create a basic zone with IP address 192.168.1.1; netmask 255.255.255.0
zonecfg -z zone1
zone1: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:zone1> create -b
zonecfg:zone1> set autoboot=true
Zonecfg:zone1> set zonepath=/zones/zone1
zonecfg:zone1> add net
zonecfg::zone1> set address=192.168.1.1/24
zonecfg:zone1:net> set physical=ce0
zonecfg:zone1:net> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
Page 11
Solaris 10: Native Zones
For autoboot to function, the zone service needs to be enabled.
'svcs' can be used to check the status.
# svcs –a | grep zones
online 11:33:06 svc:/system/zones:default
The result above shows that the zone service is enabled.
If the result is otherwise (disabled), it can be enabled using the 'svcadm' command as below
# svcadm enable svc:/system/zones:default
4. Change the permissions on zones home dir
# chmod 700 /zones/zone1
5. After the 'exit' step, the zone1 zone is now in 'configured' state.
# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 configured /zones/zone1 native shared
6. The next step is to install the zone. Below is a list of steps:
# zoneadm -z zone1 install
Page 12
Solaris 10: Native Zones
Preparing to install zone <tz>.
Creating list of files to copy from the global zone.
Copying <7665> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <1142> packages on the zone.
Initializing package <143> of <1142>: percent complete: 12%
7. At this state, the state of ‘zone1' zone is incomplete
# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
- zone1 incomplete /zones/tz native shared
8. Wait till initialize package is done, the status will change to 'installed' as shown below
# zoneadm list -cv
ID NAME STATUS PATH BRAND IP
0 global running / native shared
-zone1 installed /zones/tz native shared
9. next change the status to 'ready' using
(This is like powering the server without booting up)
# zoneadm -z zone1 ready
10. issue the boot command to the zone
(just like powering up the server)
# zoneadm -z zone1 boot
Page 13
Solaris 10: Native Zones
11. command below will connect to the console
# zlogin -C zone1
12. Since this is the first time that this zone is being booted up,
some initial configurations needs to be performed
13. After the reboot, the root prompt will appear and ready for login
14. Checking the interface
# ifconfig -a
ce0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.2 netmask ffffff00 broadcast 135.1.211.255
ether 0:14:4f:ad:46:e2
ce0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
zone zone1
inet 192.168.1.1 netmask ffffff00 broadcast 135.1.211.255
ce0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
zone zone3
inet 192.168.1.3 netmask ffffff00 broadcast 135.1.211.255
Page 14
Solaris 10: Native Zones
15. To shutdown the zone, issue the command (assuming from global zone):
# zlogin zone1 shutdown -y -i0 -g0
(remember the console terminal you've? Look at that and you'll see the interesting following)
# zoneadm –z zone1 halt
Page 15
Solaris 10: Native Zones Lessons Learned From Experience
zonecfg:zone1> create –b
 The “-b” option would make non-global zone completely independent of the global zone.
Also known as “whole root zone”.
 By default, “zonecfg:zone1> create” command creates spares root zones by inheriting following
package dirs:
inherit-pkg-dir: dir: /lib
inherit-pkg-dir: dir: /platform
inherit-pkg-dir: dir: /sbin
inherit-pkg-dir: dir: /usr
Page 16
Solaris 10: Native Zones Lessons Learned From Experience
zonecfg:zone1> set zonepath=/zones/zone1
 Set “zonepath=/zones/zone1” on a dedicated LUN or Disk.
 Create a “ufs” filesystem on /zones/zone1
 Encapsulate the “/zones/zone1” under VRTS control for redundancy or clustering.
Page 17
Solaris 10 Branded Zones
Solaris 10: Branded Zones (Solaris 8)
Creating the Image for Directly Migrating Solaris 8 Systems Into Zones
s8-system # flarcreate -S -n s8-system /net/s10system/export/s8-system.flar
Determining which filesystems will be included in the archive...
Creating the archive...
cpio: File size of "etc/mnttab" has
increased by 435
2068650 blocks
1 error(s)
Archive creation complete.
Page 19
Solaris 10: Branded Zones (Solaris 8)
Installing the Solaris 8 Migration Assistant 1.0 Software on the Solaris 10 Host System
global# patchadd -G 127111-01
patchadd -p | grep 127111-01
Install the packages SUNWs8brandr and SUNWs8brandu in the following order.
# pkgadd -d /path/to/media SUNWs8brandr
# pkgadd -d /path/to/media SUNWs8brandu
Page 20
Solaris 10: Branded Zones (Solaris 8)
zonecfg -z zone2
zonecfg:zone2> create -t SUNWsolaris8
zonecfg:zone2> set zonepath=/zones/zone2
zonecfg:zone2> set autoboot=true
zonecfg:zone2> add net
zonecfg:zone2:net> set address=10.6.10.23/23
zonecfg:zone2:net> set physical=bge0
zonecfg:zone2:net> end
zonecfg:zone2> add fs
zonecfg:zone2:fs> set type=lofs
zonecfg:zone2:fs> set special=/share/zone/zone2
zonecfg:zone2:fs> set dir=/export/shared
zonecfg:zone2:fs> end
zonecfg:zone2> add attr
zonecfg:newzone:attr> set name=hostid
zonecfg:zone2:attr> set type=string
zonecfg:newzone:attr> set value=8325f14d
zonecfg:zone2:attr> end
zonecfg:zone2> verify
Commit the zone configuration for the zone.
zonecfg:zone2> commit
zonecfg:zone2> exit
global# zonecfg -z zone2 info
Page 21
Solaris 10: Branded Zones (Solaris 8)
global# zoneadm -z zone2 install -u -a /net/server/s8_image.flar
global# zoneadm list -cv
ID NAME STATUS
PATH
BRAND
IP
0 global running
/
native shared
- zone2 configured /export/home/zone2
solaris8 shared
global# zoneadm -z my-zone uninstall
global# zoneadm list -cv
global# zoneadm -z zone2 boot
global# zoneadm list –v
Page 22
Solaris 10: Branded Zones (Solaris 9)
Installing the Solaris 9 Migration Assistant 1.0 Software on the Solaris 10 Host System
global# patchadd -G 127111-01
patchadd -p | grep 127111-01
Install the packages SUNWs9brandr and SUNWs9brandu in the following order.
# pkgadd -d /path/to/media SUNWs9brandr
# pkgadd -d /path/to/media SUNWs9brandu
# pkgadd –d /path/to/media SUNWs9brandk
Page 23
Solaris 10: Branded Zones (Solaris 9)
zonecfg -z zone3
zonecfg:zone3> create -t SUNWsolaris9
zonecfg:zone3> set zonepath=/zones/zone3
zonecfg:zone3> set autoboot=true
zonecfg:zone3> add net
zonecfg:zone3:net> set address=10.6.10.23/23
zonecfg:zone3:net> set physical=bge0
zonecfg:zone3:net> end
zonecfg:zone3> add fs
zonecfg:zone3:fs> set type=lofs
zonecfg:zone3:fs> set special=/share/zone/zone3
zonecfg:zone3:fs> set dir=/export/shared
zonecfg:zone3:fs> end
zonecfg:zone3> add attr
zonecfg:newzone:attr> set name=hostid
zonecfg:zone3:attr> set type=string
zonecfg:newzone:attr> set value=8325f14d
zonecfg:zone3:attr> end
zonecfg:zone3> verify
Commit the zone configuration for the zone.
zonecfg:zone3> commit
zonecfg:zone3> exit
global# zonecfg -z zone3 info
Page 24
Solaris 10: Branded Zones (Solaris 9)
Creating the Image for Directly Migrating Solaris 8 Systems Into Zones
s9-system # flarcreate -S -n s9-system /net/s10system/export/s9-system.flar
Determining which filesystems will be included in the archive...
Creating the archive...
cpio: File size of "etc/mnttab" has
increased by 435
2068650 blocks
1 error(s)
Archive creation complete.
Page 25
Solaris 10: Branded Zones (Solaris 9)
global# zoneadm -z zone3 install -u -a /net/server/s9_image.flar
global# zoneadm list -cv
ID NAME STATUS
PATH
BRAND
IP
0 global running
/
native shared
- zone3 configured /export/home/zone3
solaris9 shared
global# zoneadm -z my-zone uninstall
global# zoneadm list -cv
global# zoneadm -z zone3 boot
global# zoneadm list –v
Page 26
Solaris 10: Branded Zones (Solaris 8 & 9)
Page 27
Solaris 10: Branded Zones (Solaris 10 unsupported)
1. Create the directory structure:
/usr/lib/brand/solaris10
/usr/lib/brand/solaris10/mods
/usr/lib/brand/solaris10/files
/usr/lib/brand/solaris10/files/patches
2. Copy the files from the native brand and the Solaris 9 brand (paths are relative from /usr/lib/brand/),
as shown in Table 1.
Source
native/config.xml
native/platform.xml
native/postclone
solaris9/s9_install
solaris9/s9_servicetag
Destination
solaris10/config.xml
solaris10/platform.xml
solaris10/postclone
solaris10/s10_install
solaris10/s10_servicetag
solaris9/s9_support
solaris10/s10_support
solaris9/s9_p2v
solaris9/s9_system
solaris9/mods/S20_install_patches
solaris10/s10_p2v
solaris10/s10_system
solaris10/mods/S20_install_patches
solaris9/mods/S3*_*
solaris9/files/patches/order
solaris10/mods/S3*_*
solaris10/files/patches/order
Page 28
Solaris 10: Branded Zones (Solaris 10 unsupported)
3. Edit the information in the following files:
a. In config.xml:
•Replace brand name=native with brand name=solaris10.
•Replace <install>/usr/lib/lu/lucreatezone -z %z</install> with
<install>/usr/lib/brand/solaris10/s10_install %z %R %*</install>.
•Replace <installopts></installopts> with
<installopts>a:d:DhpsuvV</installopts>.
•Replace <verify_cfg></verify_cfg> with
<verify_cfg>/usr/lib/brand/solaris10/s10_support verify</verify_cfg>.
b. In platform.xml, create an additional entry for the loopback mounting of the /usr file system
(which is necessary for applying the modifications later on) during bootup by adding the following:
<global_mount special="/usr" directory="/.SUNWnative/usr" \
type="lofs" opt="ro,nodevices" />
c. In s10_install, s10_servicetag and s10_system, replace all occurrences of Solaris9 and s9
with Solaris10 and s10, respectively.
d. In s10_p2v:
Replace all occurrences of Solaris9 and s9 with Solaris10 and s10, respectively.
Comment out the part concerning the s9_preload.so.1 library, since this library is not required for Solaris 10 zones.
Page 29
Solaris 10: Branded Zones (Solaris 10 unsupported)
4. Now that the brand has been created, a Solaris 10 branded zone can be configured:
zonecfg -z 10_zone01
create
set autoboot=true
set zonepath=/zones/zone4
set brand=solaris10
add net
set physical=hme0
set address=10.0.0.1/24
end
remove inherit-pkg-dir
verify
commit
The configured zone can now be installed using a flash archive (/tmp/solaris10.flar):
zoneadm -z 10_zone01 install -p -a /tmp/solaris10.flar
Page 30
Solaris 10: Branded Zones (Solaris 10 unsupported)
4. Now that the brand has been created, a Solaris 10 branded zone can be configured:
zonecfg -z 10_zone01
create
set autoboot=true
set zonepath=/zones/zone4
set brand=solaris10
add net
set physical=hme0
set address=10.0.0.1/24
end
remove inherit-pkg-dir
verify
commit
The configured zone can now be installed using a flash archive (/tmp/solaris10.flar):
zoneadm -z 10_zone01 install -p -a /tmp/solaris10.flar
Page 31
Solaris 10: Zones Migration







zoneadm –z zone1 halt
zoneadm –z zone1 detach
cd /zones
tar cvf zone1.tar zone1
gzip -9 zone1.tar
scp zone1.tar.gz root@remotehost:/zones
scp /etc/zones/zone1.xml root@remotehost:/etc/zones/zone1.xml
On the remote host:
 cd /zones
 gzip –c –d zone1.tar.gz | tar xvf –
 zonecfg –z zone1
 create –a /zones/zone1
 commit
 exit
Page 32
Solaris 10: Zones Administration
 zoneadm –z zone1 boot
 zoneadm –z zone1 halt
 zlogin –C zone1
 zonecfg –z zone1 info
 zoneadm -z zone1 uninstall
 zonecfg -z zone1 delete
 rm -r /zones/zone1
 zonecfg -z zone1
zonecfg:zone2: add fs
zonecfg:zone1:fs> set type=zfs
zonecfg:zone1:fs> set special=share/zone/s8-zone
zonecfg:zone1:fs> set dir=/export/shared
zonecfg:zone1:fs> end
zonecfg:zone1> add attr
zonecfg:zone1:attr> set name=hostid
zonecfg:zone1:attr> set type=string
zonecfg:zone1:attr> set value=8325f14d
zonecfg:zone1:attr> end
zonecfg:zone1> verify
zonecfg:zone1> commit
zonecfg:zone1> exit
Page 33
Solaris 10: Zones Administration
zonecfg -z zone1
zonecfg:zone2:> select fs special=/local
zonecfg:zone2: >add option ro
end
verify
commit
Page 34
Solaris 10: Sun Virtual Farm
Page 35
Trigence Capsules
Trigence Capsules
 With Trigence Application Capsules, enterprises run their applications where they want,
when they want and how they want.
 Trigence Capsule packages OS into an application capsule, creating a discrete object that defines
and contains an application.
 A capsule is a secure environment. Decouples the application from the underlying infrastructure.
 Legacy Solaris vers supported: Solaris 9, Solaris 8, Solaris 7, Solaris 2.6
Trigence Capsule consists of two software components:
 Capsule Creator – an interactive utility that packages the desired application into capsules
 Capsule Controller – a lightweight component that is installed on each server enabled to
run Capsule with runtime support and management interfaces.
Page 37
Trigence Capsules
1. How to create cpio archive using the find cmd
=============================================
For root;
cd /; find . -depth -xdev | cpio -oc | gzip | dd of=${filename.root}.cpio.gz
For var (if /var is a separate filesystem)
cd /var;find . -depth -xdev | cpio -oc| gzip|dd of=${filename.var}.cpio.gz
For opt (if /var is a sepate filesystem)
cd /opt;find .-depth -xdev | cpio -oc | gzip |dd of=${filename.opt}.cpio.gz
2. Uncpio the archives
===================
cpio –i filename.cpio
Page 38
Trigence Capsules
Creator:
Page 39
Trigence Capsules
Creator:
Page 40
Trigence Capsules
Creator:
Page 41
Trigence Capsules
Creator:
Page 42
Trigence Capsules
Creator:
Page 43
Trigence Capsules
Creator:
Page 44
Trigence Capsules
Creator:
Page 45
Trigence Capsules
alameda-tst# trictrl list
Name
Type
Activated State
=================================== ===========
hostfs
HostFS
Docked
bolt
Virtualized * Started
dudley
Virtualized
Started
snarg
Virtualized * Started
zeus
Virtualized
Started
Alameda-tst # ifconfig –a
ce4:11: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 135.1.45.2 netmask ffffff00 broadcast 135.1.45.255
ce4:12: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 135.1.45.165 netmask ffffff00 broadcast 135.1.45.255
ce4:13: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 135.1.45.173 netmask ffffff00 broadcast 135.1.45.255
ce4:14: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
zone charger
inet 135.1.44.149 netmask ffffff00 broadcast 135.1.44.255
Page 46
Trigence Capsules
alameda-tst# cd /capsules
alameda-tst# ls
bolt
bolt.con.cc08w37b snarg
bolt.con
dudley
snarg.con
bolt.con.cc08w33d dudley.con.cc08w33d zeus
Page 47
zeus.con.cc08w21d
Transitive: QuickTransit
Transitive: QuickTransit
 Transitive's QuickTransit cross-platform virtualization allow applications created for one
CPU and OS to run on different platforms.

Support legacy Solaris vers: Solaris 9, Solaris 8, Solaris 7, Solaris 2.6 & Solaris 2.5.1
Page 49
Transitive: QuickTransit
 Two commands:
 runsparc
 linksparc

Sample Output
-bash-3.1$ uname -a
Linux usilnw1asp 2.6.18-92.1.10.el5 #1 SMP Wed Jul 23 03:56:11 EDT 2008 x86_64 x86_64 x86_64
GNU/Linux
-bash-3.1$ runsparc
runsparc: Warning. The current working directory is not visible from the VSE, changing to VSE "/"
bash-3.00$ uname -a
SunOS usilnw1asp 5.10 CO_TB08Q3BHF_BASELINE_0013 sun4u sparc SUNW,Ultra-Enterprise
bash-3.00$
Page 50
Thank You!
Page 51