flying zones für Arme im Eigenbau mit Solaris10 und Vmware Server 2
Geschrieben von otmanix in EMC, NAS, SAN, Solaris, VMware, Virtualisierung, tags: Container, disk set, Solaris, svm, UFS, VMware, ZFS, zones
Solaris Zones / Container
Sun Microsystems hat Solaris10 eine interessante OS-Virtualisierungslösung kostenlos beigelegt – Solaris Zones, ähnlich zu BSD jails. Im Gegensatz zu XVM (Xen im Solaris-Kernel für X86) oder Logical Domains (Hypervisor für CMT/Niagara) gibt es bei Zones kaum Overhead durch die Virtualisierung. Zudem steht es sowohl im Sparc- als auch im X86-Umfeld zur Verfügung. In einer Zone werden Resourcen der sog. “globalen Zone” genutzt. Es gibt aber auch z.T. die Möglichkeit dediziert Resourcen zuzuweisen, z.B. einen eigenen IP-Stack. Den OS-Kernel hingegen gibt es nur einmal. Die Kombination von OS-Virtualisierung mit Zones und dem Resourcemanagement wird als Container bezeichnet.
Container werden i.d.R. genutzt um Applikationen oder Applikationsschichten voneinander abzuschotten und die Resourcenverteilung zu steuern. So kann ein Container ein SAP ERP Entwicklungs- und Testsystem beinhalten und ein weiterer das Produktionssystem. Die Systeme haben je eine eigene Netzwerkkonfiguration und können weiche oder harten Grenzen für CPU-Auslastung und Speicherverbrauch besitzen.
flying zones
Heruntergefahrene Zonen kann man klonen oder exportieren. Kopiert man die Filesysteme der Zone auf einen anderen Rechner kann man sie dort importieren und die Zone wieder in Betrieb nehmen. Legt man die Filesysteme auf shared storage kann man durch Zuweisen der relevanten Disks auf allen relevanten Rechnern die Filesysteme je nach Bedarf am passenden System in Betrieb nehmen. Danach kann auch die Zone dort wieder in Betrieb genommen werden. Das Verfahren nennt man Zonenmigration. Das wird genutzt um bei Rechnerausfällen Zonen umzuziehen oder um eine bessere Auslastung der vorhandenen Systeme zu erzielen. Als Basis für den Umzug der Filesysteme kann sowohl ZFS als auch UFS auf shared disk sets genutzt werden.
Möchte man den Umzug von Zonen auf andere Rechner automatisieren, die Verfügbarkeit der Zonen/Rechner überwachen lassen und automische Reaktionen in Problemfällen haben, dann kann man den Sun Cluster 3.2 mit dem Zonenagent einsetzen.
Sun verkauft die Implementierung einer solchen Gesamtlösung unter dem Titel “flying zones“. Dabei wird noch das Monitoringtool N1AA Analyzer beigelegt. Dort kann man z.B. den Resourcenverbrauch von best. Zonen aufsummieren lassen und prüfen, ob das denn so zusammen auf einer best. Hardware laufen würde. Außerdem wird einem noch das Softwareinstallationssystem N1AA ans Herz gelegt.
flying zones für Arme im Eigenbau
Im kostenlosen Vmware Server 2.01 auf meinem PC habe ich eine Testumgebung aufgebaut um die Grundzüge von flying zones nachzustellen und zu testen. Wichtig war mir eine realistische Umgebung wie im Betriebsalltag, deshalb bin ich von 2 virt. Rechenzentren ausgegangen. In jedem virt. RZ befindet sich ein Solaris-Host und ein Storagesystem. Auf das Storagesystem jedes RZs kann jeder Server zugreifen. Die Platten im Storagesystem sind als shared disks konfiguriert. Es soll mit host based mirroring erreicht werden, dass trotz Ausfall eines kompletten Storagesystems den Betrieb der Zone nicht gestört wird, egal auf welchem host die Zone aktiv läuft. Auf den Einsatz kostenpflichtiger Clustersoftware zur Automatisierung verzichte ich in diesem Test.
In der Testumgebung gibt es nur eine Zone. In der Realität wären das natürlich mehr.
Auf jedem Solaris-Host ist Solaris10u6 (10/08) installiert. Dabei wurde ein lokale Platte genutzt um darauf das OS zu installieren. Dabei wurde bereits die neue Funktionalität genutzt ZFS als Rootfilesystem einzusetzen. Eine weitere kleine lokale Platte steht darüber hinaus zur Verfügung. Auf die Grundinstallation der Solaris-hosts gehe ich hier nicht näher ein. Die shared disks sind ebenfalls bereits den hosts bereitgestellt.
Testumgebung auf Vmware Server 2.01
Am Vmware Server ist eigentlich nur die Konfiguration der shared disks interessant. Die Disks werden zunächst in einer virt. Maschine erstellt, dann deren vmx-Dateien angepasst und die relevanten Teile der vmx-Datei in die des anderen hosts übertragen.
Benötigt werden also folgende Platten:
lokale disks pro System:
1 Disk mit >= 5GB für den ZFS-RootPool
1 Disk >= 20MB für die lokale State Database
shared disks (insgesamt):
2 shared Disks (preaallocated) für Zonen-Root (ZFS) 2GB
2 shared Disks (preaallocated) mit Zonen-Daten (UFS) 50MB
relevanter Teil der vmx-Dateien:
scsi1.present = "TRUE" scsi1.sharedBus = "virtual" scsi1.virtualDev = "lsilogic"
scsi1:0.present = "TRUE" scsi1:0.fileName = "D:\Virtual Machines\ext1disk1.vmdk" scsi1:0.writeThrough = "TRUE" scsi1:0.mode = "independent-persistent"
scsi1:1.present = "TRUE" scsi1:1.fileName = "D:\Virtual Machines\ext1disk2.vmdk" scsi1:1.writeThrough = "TRUE" scsi1:1.mode = "independent-persistent"
scsi2.present = "TRUE" scsi2.sharedBus = "virtual" scsi2.virtualDev = "lsilogic"
scsi2:0.present = "TRUE" scsi2:0.fileName = "D:\Virtual Machines\ext2disk1.vmdk" scsi2:0.writeThrough = "TRUE" scsi2:0.mode = "independent-persistent"
scsi2:1.present = "TRUE" scsi2:1.fileName = "D:\Virtual Machines\ext2disk2.vmdk" scsi2:1.writeThrough = "TRUE" scsi2:1.mode = "independent-persistent"
disk.locking = "FALSE"
Hier ein Blick auf das System nach der Solaris-Installation:
bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT rpool 7.94G 4.65G 3.28G 58% ONLINE - bash-3.00# zpool status rpool pool: rpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 c1t0d0s0 ONLINE 0 0 0 errors: No known data errors bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 5.15G 2.67G 35.5K /rpool rpool/ROOT 3.77G 2.67G 18K legacy rpool/ROOT/s10x_u6wos_07b 3.77G 2.67G 3.77G / rpool/dump 900M 2.67G 900M - rpool/export 37K 2.67G 19K /export rpool/export/home 18K 2.67G 18K /export/home rpool/swap 512M 3.16G 5.54M - bash-3.00# df -h Filesystem size used avail capacity Mounted on rpool/ROOT/s10x_u6wos_07b 7.8G 3.8G 2.7G 59% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 532M 364K 532M 1% /etc/svc/volatile objfs 0K 0K 0K 0% /system/object sharefs 0K 0K 0K 0% /etc/dfs/sharetab /usr/lib/libc/libc_hwcap2.so.1 6.4G 3.8G 2.7G 59% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 535M 2.7M 532M 1% /tmp swap 532M 32K 532M 1% /var/run rpool/export 7.8G 19K 2.7G 1% /export rpool/export/home 7.8G 18K 2.7G 1% /export/home rpool 7.8G 35K 2.7G 1% /rpool /hgfs 16G 4.0M 16G 1% /hgfs /tmp/VMwareDnD 0K 0K 0K 0% /var/run/vmblock bash-3.00# swap -l swapfile dev swaplo blocks free /dev/zvol/dsk/rpool/swap 181,1 8 1048568 1047280
Arbeiten mit den shared disks
ZFS für Zonenroot, RAID1 gespiegelt
bash-3.00# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 <DEFAULT cyl 4092 alt 2 hd 128 sec 32> /pci@0,0/pci15ad,1976@10/sd@0,0 1. c1t1d0 <DEFAULT cyl 47 alt 2 hd 64 sec 32> /pci@0,0/pci15ad,1976@10/sd@1,0 2. c2t0d0 <VMware,-VMware Virtual S-1.0-2.00GB> /pci@0,0/pci15ad,790@11/pci15ad,1976@0/sd@0,0 3. c2t1d0 <DEFAULT cyl 47 alt 2 hd 64 sec 32> /pci@0,0/pci15ad,790@11/pci15ad,1976@0/sd@1,0 4. c3t0d0 <VMware,-VMware Virtual S-1.0-2.00GB> /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@0,0 5. c3t1d0 <DEFAULT cyl 47 alt 2 hd 64 sec 32> /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@1,0 Specify disk (enter its number): 0 selecting c1t0d0 [disk formatted] /dev/dsk/c1t0d0s0 is part of active ZFS pool rpool. Please see zpool(1M). /dev/dsk/c1t0d0s2 is part of active ZFS pool rpool. Please see zpool(1M). bash-3.00# zpool create zone1 mirror c2t0d0 c3t0d0 bash-3.00# zpool list zone1 NAME SIZE USED AVAIL CAP HEALTH ALTROOT zone1 1.98G 94K 1.98G 0% ONLINE - bash-3.00# zpool status zone1 pool: zone1 state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM zone1 ONLINE 0 0 0 mirror ONLINE 0 0 0 c2t0d0 ONLINE 0 0 0 c3t0d0 ONLINE 0 0 0 errors: No known data errors bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT rpool 5.15G 2.67G 35.5K /rpool rpool/ROOT 3.77G 2.67G 18K legacy rpool/ROOT/s10x_u6wos_07b 3.77G 2.67G 3.77G / rpool/dump 900M 2.67G 900M - rpool/export 37K 2.67G 19K /export rpool/export/home 18K 2.67G 18K /export/home rpool/swap 512M 3.16G 5.54M - zone1 106K 1.95G 18K /zone1
Datenbereich mit UFS-Filesystem auf SVM shared disk set, RAID1 gespiegelt
bash-3.00# metaset -s zone1data -a c2t1d0 c3t1d0 -h horst1 horst2 metaset: horst1: there are no existing databases
Es existiert noch keine lokale state database. Deshalb auf horst1 und horst2 die zweite lokale Platte partitionieren und in der Slice7 eine lokale State Database anlegen.
bash-3.00# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c1t0d0 <DEFAULT cyl 4092 alt 2 hd 128 sec 32> /pci@0,0/pci15ad,1976@10/sd@0,0 1. c1t1d0 <DEFAULT cyl 47 alt 2 hd 64 sec 32> /pci@0,0/pci15ad,1976@10/sd@1,0 2. c2t0d0 <VMware,-VMware Virtual S-1.0-2.00GB> /pci@0,0/pci15ad,790@11/pci15ad,1976@0/sd@0,0 3. c2t1d0 <DEFAULT cyl 47 alt 2 hd 64 sec 32> /pci@0,0/pci15ad,790@11/pci15ad,1976@0/sd@1,0 4. c3t0d0 <VMware,-VMware Virtual S-1.0-2.00GB> /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@0,0 5. c3t1d0 <DEFAULT cyl 47 alt 2 hd 64 sec 32> /pci@0,0/pci15ad,790@11/pci15ad,1976@1/sd@1,0 Specify disk (enter its number): 1 selecting c1t1d0 [disk formatted] FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk fdisk - run the fdisk program repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name !<cmd> - execute <cmd>, then return format> fdisk No fdisk table exists. The default partition for the disk is: a 100% "SOLARIS System" partition Type "y" to accept the default partition, otherwise type "n" to edit the partition table. y quit format> part PARTITION MENU: 0 - change `0' partition 1 - change `1' partition 2 - change `2' partition 3 - change `3' partition 4 - change `4' partition 5 - change `5' partition 6 - change `6' partition 7 - change `7' partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk !<cmd> - execute <cmd>, then return quit partition> print Current partition table (original): Total disk cylinders available: 46 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 unassigned wm 0 0 (0/0/0) 0 1 unassigned wm 0 0 (0/0/0) 0 2 backup wu 0 - 45 46.00MB (46/0/0) 94208 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 0 (0/0/0) 0 8 boot wu 0 - 0 1.00MB (1/0/0) 2048 9 unassigned wm 0 0 (0/0/0) 0 partition> 7 Part Tag Flag Cylinders Size Blocks 7 unassigned wm 0 0 (0/0/0) 0 Enter partition id tag[unassigned]: Enter partition permission flags[wm]: Enter new starting cyl[0]: Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 46c partition> print Current partition table (unnamed): Total disk cylinders available: 46 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 unassigned wm 0 0 (0/0/0) 0 1 unassigned wm 0 0 (0/0/0) 0 2 backup wu 0 - 45 46.00MB (46/0/0) 94208 3 unassigned wm 0 0 (0/0/0) 0 4 unassigned wm 0 0 (0/0/0) 0 5 unassigned wm 0 0 (0/0/0) 0 6 unassigned wm 0 0 (0/0/0) 0 7 unassigned wm 0 - 45 46.00MB (46/0/0) 94208 8 boot wu 0 - 0 1.00MB (1/0/0) 2048 9 unassigned wm 0 0 (0/0/0) 0 partition> label Ready to label disk, continue? y partition> quit FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk fdisk - run the fdisk program repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name !<cmd> - execute <cmd>, then return quit format> quit bash-3.00# bash-3.00# metadb -a -f c1t1d0s7 bash-3.00# metadb flags first blk block count a u 16 8192 /dev/dsk/c1t1d0s7 bash-3.00# echo "set md:mirrored_root_flag=1" >> /etc/system
Auf horst1 nun das shared disk set anlegen.
bash-3.00# metaset -s zone1data -a -h horst1 horst2 metaset: horst2: rpc.metad: Permission denied
Dem Dienst fehlen die Berechtigungen.
Auf horst1
bash-3.00# echo horst2 > /.rhosts
Auf horst2
bash-3.00# echo horst1 > /.rhosts
Auf horst1 nun das shared disk set erstellen:
bash-3.00# metaset -s zone1data -a -h horst1 horst2 bash-3.00# metaset -s zone1data -a c2t1d0 c3t1d0 bash-3.00# metaset Set name = zone1data, Set number = 1 Host Owner horst1 Yes horst2 Drive Dbase c2t1d0 Yes c3t1d0 Yes bash-3.00# metadb -s zone1data flags first blk block count a u 16 8192 /dev/dsk/c2t1d0s7 a u 16 8192 /dev/dsk/c3t1d0s7
Nun die RAID1-Spiegelung mit Solaris Volummanager (SVM) aufsetzen:
bash-3.00# metainit -s zone1data d11 1 1 c2t1d0s0 zone1data/d11: Concat/Stripe is setup bash-3.00# metainit -s zone1data d12 1 1 c3t1d0s0 zone1data/d12: Concat/Stripe is setup bash-3.00# metainit -s zone1data d10 -m d11 zone1data/d10: Mirror is setup bash-3.00# metattach -s zone1data d10 d12 zone1data/d10: submirror zone1data/d12 is attached bash-3.00# metastat -s zone1data zone1data/d10: Mirror Submirror 0: zone1data/d11 State: Okay Submirror 1: zone1data/d12 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 86016 blocks (42 MB) zone1data/d11: Submirror of zone1data/d10 State: Okay Size: 86016 blocks (42 MB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c2t1d0s0 0 No Okay Yes zone1data/d12: Submirror of zone1data/d10 State: Okay Size: 86016 blocks (42 MB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t1d0s0 0 No Okay Yes Device Relocation Information: Device Reloc Device ID c3t1d0 Yes id1,sd@f0000000049d7b0e80006e5c10004 c2t1d0 Yes id1,sd@f0000000049d7b0e80004846b0003
Im Anschluss die Platte mit UFS formatieren:
bash-3.00# newfs /dev/md/zone1data/rdsk/d10 /dev/md/zone1data/rdsk/d10: Unable to find Media type. Proceeding with system determined parameters. newfs: construct a new file system /dev/md/zone1data/rdsk/d10: (y/n)? y /dev/md/zone1data/rdsk/d10: 86016 sectors in 42 cylinders of 64 tracks, 32 sectors 42.0MB in 3 cyl groups (16 c/g, 16.00MB/g, 7680 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 32832, 65632,
Konfiguration und Installation der Zone zone1
bash-3.00# zonecfg -z zone1 zone1: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zone1> create zonecfg:zone1> set zonepath=/zone1 zonecfg:zone1> set autoboot=false zonecfg:zone1> add fs zonecfg:zone1:fs> set dir=/daten zonecfg:zone1:fs> set special=/dev/md/zone1data/dsk/d10 zonecfg:zone1:fs> set raw=/dev/md/zone1data/rdsk/d10 zonecfg:zone1:fs> set type=ufs zonecfg:zone1:fs> end zonecfg:zone1> add net zonecfg:zone1:net> set physical=e100g0 zonecfg:zone1:net> set address=192.168.178.61 zonecfg:zone1:net> end zonecfg:zone1> exit bash-3.00# zoneadm list -c global zone1 bash-3.00# cat /etc/zones/index # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "@(#)zones-index 1.2 04/04/01 SMI" # # DO NOT EDIT: this file is automatically generated by zoneadm(1M) # and zonecfg(1M). Any manual changes will be lost. # global:installed:/ zone1:configured:/zone1: bash-3.00# cat /etc/zones/zone1.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE zone PUBLIC "-//Sun Microsystems Inc//DTD Zones//EN" "file:///usr/share/lib/xml/dtd/zonecfg.dtd.1"> <!-- DO NOT EDIT THIS FILE. Use zonecfg(1M) instead. --> <zone name="zone1" zonepath="/zone1" autoboot="false"> <inherited-pkg-dir directory="/lib"/> <inherited-pkg-dir directory="/platform"/> <inherited-pkg-dir directory="/sbin"/> <inherited-pkg-dir directory="/usr"/> <filesystem special="/dev/md/zone1data/dsk/d10" raw="/dev/md/zone1data/rdsk/d10" directory="/daten" type="ufs"/> <network address="192.168.178.61" physical="e100g0"/> </zone> bash-3.00# chmod 700 /zone1 bash-3.00# zoneadm -z zone1 install Preparing to install zone <zone1>. Checking <ufs> file system on device </dev/md/zone1data/rdsk/d10> to be mounted at </zone1/root> Creating list of files to copy from the global zone. Copying <8135> files to the zone. Initializing zone product registry. Determining zone package initialization order. Preparing to initialize <1186> packages on the zone. Initialized <1186> packages on zone. Zone <zone1> is initialized. The file </zone1/root/var/sadm/system/logs/install_log> contains a log of the zone installation. bash-3.00# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone1 installed /zone1 native shared bash-3.00# zoneadm -z zone1 boot bash-3.00# zlogin -C zone1 [Connected to zone 'zone1' console] 143/143 Reading ZFS config: done. Select a Language 0. English 1. German 2. es 3. fr Please make a choice (0 - 3), or press h or ? for help:1 ... Auf welcher Art von Terminal arbeiten Sie? 1) ANSI Standard CRT 2) DEC VT52 3) DEC VT100 4) Heathkit 19 5) Lear Siegler ADM31 6) PC-Konsole 7) Sun-Kommando-ShellSun-Workstation 9) Televideo 910 10) Televideo 925 11) Wyse Modell 50 12) X Terminal Emulator (xterms) 13) CDE Terminal Emulator (dtterm) 14) Andere Geben Sie die gewünschte Zahl ein und drücken Sie Eingabetaste: 3 ... System identification is completed. rebooting system due to change(s) in /etc/default/init [NOTICE: Zone rebooting] SunOS Release 5.10 Version Generic_137138-09 64-bit Copyright 1983-2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Hostname: zone1 Reading ZFS config: done. zone1 console login: Apr 5 13:33:22 zone1 sendmail[6008]: My unqualified host name (localhost) unknown; sleeping for retry root Password: Apr 5 13:33:44 zone1 login: ROOT LOGIN /dev/console Sun Microsystems Inc. SunOS 5.10 Generic January 2005 # svcadm disable svc:*sendmail* bash-3.00# df -h Dateisystem Größe belegt verfügbar Kapazität Eingehängt auf / 0K 541M 1,4G 28% / /daten 39M 1,0M 34M 3% /daten /dev 2,0G 541M 1,4G 28% /dev /lib 6,4G 3,8G 2,7G 59% /lib /platform 6,4G 3,8G 2,7G 59% /platform /sbin 6,4G 3,8G 2,7G 59% /sbin /usr 6,4G 3,8G 2,7G 59% /usr proc 0K 0K 0K 0% /proc ctfs 0K 0K 0K 0% /system/contract mnttab 0K 0K 0K 0% /etc/mnttab objfs 0K 0K 0K 0% /system/object swap 452M 316K 452M 1% /etc/svc/volatile /usr/lib/libc/libc_hwcap2.so.1 6,4G 3,8G 2,7G 59% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 452M 36K 452M 1% /tmp swap 452M 12K 452M 1% /var/run bash-3.00# exit # ^D zone1 console login: ~. [Connection to zone 'zone1' console closed]
Zonenmigration
Zone exportieren
bash-3.00# zlogin zone1 init 0 bash-3.00# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone1 installed /zone1 native shared bash-3.00# zoneadm -z zone1 detach bash-3.00# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone1 configured /zone1 native shared bash-3.00# ls -l /zone1 total 3343 -rw-r--r-- 1 root root 1618163 Apr 5 14:25 SUNWdetached.xml drwxr-xr-x 13 root root 52 Apr 5 14:22 dev drwxr-xr-x 19 root root 21 Apr 5 13:44 root
ZFS-Pool mit Zonenroot exportieren
bash-3.00# zpool export zone1 bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT rpool 7.94G 5.02G 2.92G 63% ONLINE -
SVM disk set mit UFS-Filesystem für Daten exportieren
bash-3.00# metaset Set name = zone1data, Set number = 1 Host Owner horst1 Yes horst2 Drive Dbase c2t1d0 Yes c3t1d0 Yes bash-3.00# metaset -s zone1data -r bash-3.00# metaset Set name = zone1data, Set number = 1 Host Owner horst1 horst2 Drive Dbase c2t1d0 Yes c3t1d0 Yes
Auf horst2:
ZFS-Pool importieren
bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT rpool 7.94G 4.65G 3.28G 58% ONLINE - bash-3.00# zpool import pool: zone1 id: 12609083278336438915 state: ONLINE action: The pool can be imported using its name or numeric identifier. config: zone1 ONLINE mirror ONLINE c2t0d0 ONLINE c3t0d0 ONLINE bash-3.00# zpool import zone1 bash-3.00# zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT rpool 7.94G 4.65G 3.28G 58% ONLINE - zone1 1.98G 544M 1.45G 26% ONLINE -
SVM disk set importieren
bash-3.00# metaset Set name = zone1data, Set number = 1 Host Owner horst1 horst2 Drive Dbase c2t1d0 Yes c3t1d0 Yes bash-3.00# metaset -s zone1data -t bash-3.00# metaset Set name = zone1data, Set number = 1 Host Owner horst1 horst2 Yes Drive Dbase c2t1d0 Yes c3t1d0 Yes bash-3.00# metastat -s zone1data d10 zone1data/d10: Mirror Submirror 0: zone1data/d11 State: Okay Submirror 1: zone1data/d12 State: Okay Pass: 1 Read option: roundrobin (default) Write option: parallel (default) Size: 86016 blocks (42 MB) zone1data/d11: Submirror of zone1data/d10 State: Okay Size: 86016 blocks (42 MB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c2t1d0s0 0 No Okay Yes zone1data/d12: Submirror of zone1data/d10 State: Okay Size: 86016 blocks (42 MB) Stripe 0: Device Start Block Dbase State Reloc Hot Spare c3t1d0s0 0 No Okay Yes Device Relocation Information: Device Reloc Device ID c2t1d0 Yes id1,sd@f0000000049d7b0e80004846b0003 c3t1d0 Yes id1,sd@f0000000049d7b0e80006e5c10004
Zone zone1 importieren und wieder in Betrieb nehmen:
bash-3.00# zonecfg -z zone1 zone1: No such zone configured Use 'create' to begin configuring a new zone. zonecfg:zone1> create -a /zone1 zonecfg:zone1> exit bash-3.00# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone1 configured /zone1 native shared bash-3.00# zoneadm -z zone1 attach bash-3.00# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared - zone1 installed /zone1 native shared bash-3.00# zoneadm -z zone1 boot bash-3.00# zoneadm list -cv ID NAME STATUS PATH BRAND IP 0 global running / native shared 2 zone1 running /zone1 native shared bash-3.00# zlogin zone1 [Connected to zone 'zone1' pts/5] Last login: Sun Apr 5 14:22:15 on pts/5 Sun Microsystems Inc. SunOS 5.10 Generic January 2005 # df -h Filesystem size used avail capacity Mounted on / 0K 545M 1.4G 28% / /daten 39M 5.0M 30M 15% /daten /dev 2.0G 545M 1.4G 28% /dev /lib 6.4G 3.8G 2.7G 59% /lib /platform 6.4G 3.8G 2.7G 59% /platform /sbin 6.4G 3.8G 2.7G 59% /sbin /usr 6.4G 3.8G 2.7G 59% /usr proc 0K 0K 0K 0% /proc ctfs 0K 0K 0K 0% /system/contract mnttab 0K 0K 0K 0% /etc/mnttab objfs 0K 0K 0K 0% /system/object swap 437M 300K 437M 1% /etc/svc/volatile /usr/lib/libc/libc_hwcap2.so.1 6.4G 3.8G 2.7G 59% /lib/libc.so.1 fd 0K 0K 0K 0% /dev/fd swap 437M 36K 437M 1% /tmp swap 437M 12K 437M 1% /var/run # ls -l /daten total 8176 -rw-r--r-- 1 root root 4165061 Apr 5 14:14 lksf_book_alpha.pdf drwx------ 2 root root 8192 Apr 5 12:13 lost+found
Fazit
Zonen sind ne nette Sache. Mit der Möglichkeit der Zonenmigration wird das Thema aber erst richtig interessant und RZ-tauglich.
Weiterführende Literatur, etc.
Solaris Volume Manager Administration Guide
Blog O’Matty zu shared disks unter Vmware Server 2
P.S.
Der nächste Test wird Liveupgrade mit ZFS-Rootfilesystem und Zonen zum Thema haben…


















Einträge (RSS)