Your SlideShare is downloading. ×
0
OpenSolaris 2009.06 A Workshop for some key Technologies Markus Weber Sun Microsystems, Inc. Iban Nieto OpenSolaris Commun...
Agenda <ul><li>Install OpenSolaris 2009.06
Sun VirtualBox
IPS, Package Manager, and Repositories
ZFS & Time Slider
DTrace
If time permits: Crossbow & Containers </li></ul>
Install OpenSolaris 2009.06 <ul><li>Options: </li><ul><li>Upgrade from a previous version
Natively on your laptop
In a partition on your laptop
In VirtualBox </li></ul></ul>
Install OpenSolaris 2009.06 <ul><li>Basic System Requirements: </li><ul><li>At least 512MB memory, more is better
Recommended at least 9GB disk space </li></ul></ul>
Upgrade to OpenSolaris 2009.06 <ul><li>Package Manager </li><ul><li>“Update All”
Follow instructions </li></ul><li>Command Line: </li><ul><li>pfexec su
pkg image-update [-nv]
Follow instructions  </li></ul></ul>
Install OpenSolaris 2009.06 Natively <ul><li>Boot from  </li><ul><li>OpenSolaris LiveCD
OpenSolaris LiveUSB </li></ul><li>Use “Device Driver Utility” </li><ul><li>To check support for your devices </li></ul><li...
Reboot
Done ! </li></ul></ul>
Install OpenSolaris 2009.06 in Partition <ul><li>Notes if running Windows:
If you have Windows installed, and you set up sufficient space for installing the OpenSolaris 2009.06 operating system, th...
Install OpenSolaris 2009.06 in Partition <ul><li>Notes if running Linux:
If you have either the Linux or Windows operating systems installed on your system, before installing the OpenSolaris oper...
Install OpenSolaris 2009.06 in Partition <ul><li>Notes if running Solaris 10:
The installer cannot be used to multiboot the OpenSolaris operating system. However, the installer can be used to replace ...
Notes on Extended Partitions: If you have another operating system installed on an extended partition, the existing extend...
Install OpenSolaris 2009.06 in Partition <ul><li>For more information on how to install OpenSolaris 2009.06 in a multiboot...
http://dlc.sun.com/osol/docs/content/2009.06/getstart/partition.html </li></ul>
Install OpenSolaris 2009.06 in VirtualBox <ul><li>http://www.virtualbox.org </li><ul><li>Download and install binaries acc...
Or use LiveCD </li></ul></ul>
Install OpenSolaris 2009.06 in VirtualBox <ul><li>In VirtualBox:  “New” </li><ul><li>Choose OS, a name, memory size, (virt...
Change graphic memory, attached .iso or LiveCD.
“Start”
Install OpenSolaris
Install Guest Additions !! </li><ul><li>“Devices” -> “Install Guest Additions...”
As root, cd /media,  pkgadd -d .pkg </li></ul></ul></ul>
Sun VirtualBox Host Platforms Guest Platforms x86 Hardware
Sun VirtualBox <ul><li>Broad platform support </li><ul><li>Hosts: Windows, Solaris, Linux, OS X
Guests: Support for practically any x86-based OS </li></ul><li>Powerful virtual hardware and device support
Versatile Networking options
Rich host/guest integration
Virtual SATA or IDE:  u p to 32 disks
Virtual NICs:  g igabit ethernet E1000
Virtual USB Controller:  USB 1.1 and 2.0 (with USB device filter)
Full ACPI Support:  g uests reflect power status of host
Virtual CD/DVD:  p assthru for CD/DVD writing
Processor:  32-bit and 64-bit guests;  PAE support
Graphics Acceleration:   OpenGL for Windows Guests </li></ul>
Sun VirtualBox: a useful example
Sun VirtualBox: the main window Check out all the Configuration options. And play around with it !!
What is IPS ? Image Packaging System <ul><li>Repositories
Easy to package  for the developer
Determine, control and resolve dependencies
Rapid delivery of fixes
Upgrade and rollback with ZFS snapshots </li></ul>
What are Repositories ? Community Sun Release Develop Contribute Pending Extra Support
Command Line Interface to IPS <ul><li>beadm (boot environment administration) </li><ul><li>beadm get a list of option (som...
man beadm for man pages
beadm list list current boot environments </li></ul><li>pkg (image packaging retrieval client) </li><ul><li>pkg   get a li...
man pkg for man pages
pkg publisher check current publishing authorities
pkg history some history information
pkg info [ |more ] check all packages installed (long  output !) </li></ul></ul>
Command Line Interface to IPS <ul><li>Curious or adventerous ? Let's add the /dev repository: </li><ul><li>pkg publisher
Upcoming SlideShare
Loading in...5
×

OpenSolaris 2009.06 Workshop

2,835

Published on

A workshop for some key technologies

Published in: Technology, Economy & Finance
2 Comments
0 Likes
Statistics
Notes
  • THANKS FOR THE SHARE!
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • thanks dude..
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total Views
2,835
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
129
Comments
2
Likes
0
Embeds 0
No embeds

No notes for slide
  • This presentation will show how the OpenSolaris OS ties into how open source OS technologies have been evolving over the last couple of decades, and show how the innovative features in the Solaris OS have laid the foundation for even more great new projects, making for an OS that&apos;s easy to use and support, and is an ideal platform for leading edge development and deployment.
  • Transcript of "OpenSolaris 2009.06 Workshop"

    1. 1. OpenSolaris 2009.06 A Workshop for some key Technologies Markus Weber Sun Microsystems, Inc. Iban Nieto OpenSolaris Community
    2. 2. Agenda <ul><li>Install OpenSolaris 2009.06
    3. 3. Sun VirtualBox
    4. 4. IPS, Package Manager, and Repositories
    5. 5. ZFS & Time Slider
    6. 6. DTrace
    7. 7. If time permits: Crossbow & Containers </li></ul>
    8. 8. Install OpenSolaris 2009.06 <ul><li>Options: </li><ul><li>Upgrade from a previous version
    9. 9. Natively on your laptop
    10. 10. In a partition on your laptop
    11. 11. In VirtualBox </li></ul></ul>
    12. 12. Install OpenSolaris 2009.06 <ul><li>Basic System Requirements: </li><ul><li>At least 512MB memory, more is better
    13. 13. Recommended at least 9GB disk space </li></ul></ul>
    14. 14. Upgrade to OpenSolaris 2009.06 <ul><li>Package Manager </li><ul><li>“Update All”
    15. 15. Follow instructions </li></ul><li>Command Line: </li><ul><li>pfexec su
    16. 16. pkg image-update [-nv]
    17. 17. Follow instructions </li></ul></ul>
    18. 18. Install OpenSolaris 2009.06 Natively <ul><li>Boot from </li><ul><li>OpenSolaris LiveCD
    19. 19. OpenSolaris LiveUSB </li></ul><li>Use “Device Driver Utility” </li><ul><li>To check support for your devices </li></ul><li>If ok, install </li><ul><li>Go through easy installation wizard
    20. 20. Reboot
    21. 21. Done ! </li></ul></ul>
    22. 22. Install OpenSolaris 2009.06 in Partition <ul><li>Notes if running Windows:
    23. 23. If you have Windows installed, and you set up sufficient space for installing the OpenSolaris 2009.06 operating system, the installation should be straightforward. All versions of the OpenSolaris software for the x86 platform use the GNU Grand Unified Bootloader (GRUB). The OpenSolaris software recognizes Windows and ensures that the Windows partitions remain unchanged during an installation. When the OpenSolaris installation completes, and the system reboots, the GRUB menu displays both the Windows and the OpenSolaris boot entries. </li></ul>
    24. 24. Install OpenSolaris 2009.06 in Partition <ul><li>Notes if running Linux:
    25. 25. If you have either the Linux or Windows operating systems installed on your system, before installing the OpenSolaris operating system, save a copy of the menu.lst file. You will need to manually update the menu.lst file to add the Linux information after the OpenSolaris installation completes. For instructions on that, please check: http://dlc.sun.com/osol/docs/content/2009.06/getstart/linuxgrub.html#linuxgrubtask </li></ul>
    26. 26. Install OpenSolaris 2009.06 in Partition <ul><li>Notes if running Solaris 10:
    27. 27. The installer cannot be used to multiboot the OpenSolaris operating system. However, the installer can be used to replace the Solaris 10 1/06 and later releases in an existing multiboot Solaris system.
    28. 28. Notes on Extended Partitions: If you have another operating system installed on an extended partition, the existing extended partition is neither changed nor lost during an OpenSolaris installation. Existing extended partitions are not visible during the installation, but the primary fdisk partition in which the extended partition resides is visible. No data in these partitions is lost as a result of the installation. The operating system on an extended partition is not displayed in the GRUB menu. </li></ul>
    29. 29. Install OpenSolaris 2009.06 in Partition <ul><li>For more information on how to install OpenSolaris 2009.06 in a multiboot environment, please check:
    30. 30. http://dlc.sun.com/osol/docs/content/2009.06/getstart/partition.html </li></ul>
    31. 31. Install OpenSolaris 2009.06 in VirtualBox <ul><li>http://www.virtualbox.org </li><ul><li>Download and install binaries according to your OS </li><ul><li>For any Windows, Linux, Solaris/OpenSolaris, Mac OS X (Intel) </li></ul></ul><li>http://www.opensolaris/get </li><ul><li>Download OpenSolaris .iso file
    32. 32. Or use LiveCD </li></ul></ul>
    33. 33. Install OpenSolaris 2009.06 in VirtualBox <ul><li>In VirtualBox: “New” </li><ul><li>Choose OS, a name, memory size, (virtual) disk image, Finish
    34. 34. Change graphic memory, attached .iso or LiveCD.
    35. 35. “Start”
    36. 36. Install OpenSolaris
    37. 37. Install Guest Additions !! </li><ul><li>“Devices” -> “Install Guest Additions...”
    38. 38. As root, cd /media, pkgadd -d .pkg </li></ul></ul></ul>
    39. 39. Sun VirtualBox Host Platforms Guest Platforms x86 Hardware
    40. 40. Sun VirtualBox <ul><li>Broad platform support </li><ul><li>Hosts: Windows, Solaris, Linux, OS X
    41. 41. Guests: Support for practically any x86-based OS </li></ul><li>Powerful virtual hardware and device support
    42. 42. Versatile Networking options
    43. 43. Rich host/guest integration
    44. 44. Virtual SATA or IDE: u p to 32 disks
    45. 45. Virtual NICs: g igabit ethernet E1000
    46. 46. Virtual USB Controller: USB 1.1 and 2.0 (with USB device filter)
    47. 47. Full ACPI Support: g uests reflect power status of host
    48. 48. Virtual CD/DVD: p assthru for CD/DVD writing
    49. 49. Processor: 32-bit and 64-bit guests; PAE support
    50. 50. Graphics Acceleration: OpenGL for Windows Guests </li></ul>
    51. 51. Sun VirtualBox: a useful example
    52. 52. Sun VirtualBox: the main window Check out all the Configuration options. And play around with it !!
    53. 53. What is IPS ? Image Packaging System <ul><li>Repositories
    54. 54. Easy to package for the developer
    55. 55. Determine, control and resolve dependencies
    56. 56. Rapid delivery of fixes
    57. 57. Upgrade and rollback with ZFS snapshots </li></ul>
    58. 58. What are Repositories ? Community Sun Release Develop Contribute Pending Extra Support
    59. 59. Command Line Interface to IPS <ul><li>beadm (boot environment administration) </li><ul><li>beadm get a list of option (some require pfexec / root)
    60. 60. man beadm for man pages
    61. 61. beadm list list current boot environments </li></ul><li>pkg (image packaging retrieval client) </li><ul><li>pkg get a list of options (some require pfexec / root)
    62. 62. man pkg for man pages
    63. 63. pkg publisher check current publishing authorities
    64. 64. pkg history some history information
    65. 65. pkg info [ |more ] check all packages installed (long output !) </li></ul></ul>
    66. 66. Command Line Interface to IPS <ul><li>Curious or adventerous ? Let's add the /dev repository: </li><ul><li>pkg publisher
    67. 67. pfexec pkg set-publisher -O http://pkg.opensolaris.org/dev dev.opensolaris.org
    68. 68. pkg publisher
    69. 69. pkg unset-publisher dev.opensolaris.org (if you want) </li></ul><li>Want VirtualBox and flash ? Let's add the /extra repository: </li><ul><li>Go to http://pkg.sun.com and register
    70. 70. Download SSL key & certificate
    71. 71. pfexec pkg set-publisher -k <path-to-key> -c <path-to-cert> -O https://pkg.sun.com/opensolaris/extra/ extra.opensolaris.org </li></ul></ul>
    72. 72. Command Line Interface to IPS <ul><li>Flash </li><ul><li>pkg info -r flash
    73. 73. pfexec pkg install flash </li></ul><li>VirtualBox </li><ul><li>pkg info -r virtualbox
    74. 74. pfexec pkg install virtualbox </li></ul><li>OpenOffice </li><ul><li>pkg info -r openoffice
    75. 75. pfexec pkg install openoffice </li></ul></ul>
    76. 76. Enhanced Package Manager
    77. 77. Package Manager <ul><li>Discover 'Repository' drop-down menu on the top right
    78. 78. Discover categories drop-down menu on the top left
    79. 79. Discover sub-categories on the left panel
    80. 80. Click on a package, and check out 'Files', 'Dependencies', and 'Licence on the bottom
    81. 81. Play with the 'Search' function
    82. 82. Click on 'File' -> 'Manage Boot Environments...'
    83. 83. Click on 'File' -> 'Manage Repositories...' </li></ul>
    84. 84. Package Manager: Manage Repositories <ul><li>Click on 'File' -> 'Manage Repositories...'
    85. 85. Let's add the sunfreeware.com repository: </li></ul>
    86. 86. Package Manager: Manage Repositories <ul><li>Browse or search through the packages
    87. 87. Click on a package, and select 'Install/Update' </li></ul>
    88. 88. ZFS & Time Slider
    89. 89. Time Slider <ul><li>Let's configure it
    90. 90. Let's use it
    91. 91. Use it everyday, even for your own version control ! </li></ul>
    92. 92. Time Slider <ul><li>'System' -> 'Administration' -> 'Time Slider': </li></ul><ul><li>Enable it
    93. 93. Choose 'All' or 'Custom'
    94. 94. Also note the 'Delete Snapshots...' button </li></ul>
    95. 95. Time Slider <ul><li>Open the File Browser (the house/home button)
    96. 96. Navigate to any directory that is snapshot'ed
    97. 97. Click on 'Restore'
    98. 98. Notice the 'Time Slider'
    99. 99. Slide the 'Time Slider' (note: if you setup Time Slider only a few minutes ago, of course the will not be any snapshots yet)
    100. 100. However, New: create a snapshot of this directory manually by clicking on the camera icon ! </li></ul>
    101. 101. Time Slider
    102. 102. Time Slider <ul><li>Once you have snapshots, delete a file
    103. 103. Then, 'travel back' in time on the slider.
    104. 104. Select the deleted file, right-click, select 'Restore to Desktop'
    105. 105. Backup / Restore as easy as that !!!
    106. 106. Open a new tab, compare directories
    107. 107. To close Time Slider, click on the white cross in red circle button on the top left. </li></ul>
    108. 108. ZFS <ul><li>ZFS is VERY cool ! </li><ul><li>The underlying technology that makes Time Slider possible </li></ul><li>End-to-End data integrity </li><ul><ul><li>256bit checksums
    109. 109. Copy-on-write transactions </li></ul></ul><li>Immense data capacity </li><ul><ul><li>128bit filesystem </li></ul></ul><li>Easy to use </li><ul><ul><li>Pooled storage model – no more volume mgr </li></ul></ul></ul>
    110. 110. ZFS <ul><li>To create one or more pools (zpool), let's simulate physical hard drives: </li><ul><li>Files can be used for that: </li><ul><li>mkfile 100m <path>/disk1
    111. 111. mkfile 100m <path>/disk2
    112. 112. etc. </li></ul><li>Or, virtual SATA disks in VirtualBox: </li><ul><li>On the powered-off OpenSolaris guest, open 'Hard Disks', then 'Enable Additional Controller', then create some virtual disks </li></ul></ul></ul>
    113. 113. ZFS <ul><li>zpool to see options
    114. 114. man zpool for man pages
    115. 115. zfs to see options
    116. 116. man zfs for man pages </li></ul>
    117. 117. ZFS Reference, Commands and Examples <ul><li>Create a ZFS storage pool # zpool create mpool mirror c1t0d0 c2t0d0
    118. 118. Add capacity to a ZFS storage pool # zpool add mpool mirror c5t0d0 c6t0d0
    119. 119. Add hot spares to a ZFS storage pool # zpool add mypool spare c6t0d0 c7t0d0
    120. 120. Replace a device in a storage pool # zpool replace mpool c6t0d0 [c7t0d0]
    121. 121. Display storage pool capacity # zpool list
    122. 122. Display storage pool status # zpool status
    123. 123. Scrub a pool # zpool scrub mpool
    124. 124. Remove a pool # zpool destroy mpool
    125. 125. Create a ZFS file system # zfs create mpool/devel
    126. 126. Create a child ZFS file system # zfs create mpool/devel/data
    127. 127. Remove a file system # zfs destroy mpool/devel
    128. 128. Take a snapshot of a file system # zfs snapshot mpool/devel/data@today
    129. 129. Roll back to a file system snapshot # zfs rollback -r mpool/devel/data@today
    130. 130. Create a writable clone from a snapshot # zfs clone mpool/devel/data@today mpool/clones/devdata </li></ul>
    131. 131. ZFS Reference, Commands and Examples <ul><li>Remove a snapshot # zfs destroy mpool/devel/data@today
    132. 132. Enable compression on a file system # zfs set compression=on mpool/clones/devdata
    133. 133. Disable compression on a file system # zfs inherit compression mpool/clones/devdata
    134. 134. Set a quota on a file system # zfs set quota=60G mpool/devel/data
    135. 135. Set a reservation on a new file system # zfs create -o reserv=20G mpool/devel/admin
    136. 136. Share a file system over NFS # zfs set sharenfs=on mpool/devel/data
    137. 137. Create a ZFS volume # zfs create -V 2GB mpool/vol
    138. 138. Remove a ZFS volume # zfs destroy mpool/vol </li></ul>
    139. 139. ZFS Basics <ul><li>Note: if you don't want to type pfexec all the time, just do ' pfexec su - '
    140. 140. Create a mirrored zpool </li><ul><li>zpool create mypool mirror <path>/file1 <path>/file2 or
    141. 141. zpool create mypool mirror c1t0d0s2 c1t1d0s2 (example for VirtualBox, check with 'format')
    142. 142. zpool list
    143. 143. zpool status mysool </li></ul><li>Add more disks to the pool (easy !) </li><ul><li>zpool add mypool mirror file3 file 4 (or different for VirtualBox)
    144. 144. zpool list
    145. 145. zpool status mysool </li></ul></ul>
    146. 146. ZFS Basics <ul><li>Create a mirrored zpool </li><ul><li>zpool create mypool mirror file1 file2 or
    147. 147. zpool create mypool mirror c1t0d0s2 c1t1d0s2 (example for VirtualBox, check with 'format')
    148. 148. zpool list
    149. 149. zpool status mysool </li></ul><li>Add more disks to the pool (easy !) </li><ul><li>zpool add mypool mirror file3 file 4 (or different for VirtualBox)
    150. 150. zpool list
    151. 151. zpool status mysool </li></ul></ul><ul><li>Create a zfs filesystem </li><ul><li>zfs list
    152. 152. zfs create mypool/myfs or
    153. 153. zfs create -o mountpoint=/export/myfs mypool/myfs
    154. 154. zfs list </li></ul><li>Note: no format, no newfs, no /etc/vfstab, no mount !! </li></ul>
    155. 155. ZFS Basics <ul><li>Let's do some snapshotting ! </li><ul><li>cd /mypool/myfs or /export/myfs
    156. 156. ls -l
    157. 157. echo “Before Snapshot” > file1.txt
    158. 158. zfs snapshot mypool/myfs@today
    159. 159. zfs list -t all | grep mypool (note, at that moment you might actually see also some snapshots created by time slider !)
    160. 160. rm file1.txt
    161. 161. echo “After Snapshot” > file1.txt
    162. 162. cat file1.txt
    163. 163. zfs rollback mypool/myfs@today
    164. 164. ls -l
    165. 165. cat file1.txt </li></ul></ul>
    166. 166. ZFS Basics <ul><li>Backup and Restore complete filesystems or pools </li><ul><li>zfs send mypool/myfs@today > /tmp/zfsdata
    167. 167. zfs destroy -r mypool/myfs Note: the -r option recursively destroys all children, including snapshots.
    168. 168. ls -l /mypool/myfs (gone !)
    169. 169. zfs receive -d mypool < /tmp/zfsdata
    170. 170. ls -l /mypool/myfs (back !) </li></ul><li>Note: you can also backup to different system(s) by using something like: </li><ul><li>zfs send <snapshot> | ssh <host2> zfs receive <snapshot> </li></ul></ul>
    171. 171. ZFS Basics <ul><li>RAID-Z </li><ul><li>RAID-Z (Redundant Array of Inexpensive Disks) is similar to RAID-5 but it's a bit better because it checksums on multiple disks, so data security is higher and performance is also better thanks to organizing data in a way that the disks are well harnessed (less going there and back to get data).
    172. 172. zpool destroy mypool
    173. 173. zpool create mypool raidz file1 file2 file3
    174. 174. zpool list
    175. 175. zpool status mypool </li></ul></ul>
    176. 176. ZFS Basics <ul><li>Other useful commands: </li><ul><li>zfs create mypool/home
    177. 177. zfs create mypool/home/jorge
    178. 178. zfs create mypool/home/antonio
    179. 179. zfs create mypool/home/maria
    180. 180. Zfs list
    181. 181. zfs set quota=20m mypool/home/jorge
    182. 182. zfs set reservation=10m mypool/home/maria
    183. 183. zfs get quota mypool/home/jorge
    184. 184. zfs get quota mypool/home/maria
    185. 185. zfs get reservation mypool/home/jorge
    186. 186. zfs get reservation mypool/home/maria </li></ul></ul>
    187. 187. ZFS Basics <ul><li>Other useful commands (cont.): </li><ul><li>cd /mypool/home/jorge/
    188. 188. mkfile 30m test
    189. 189. test: initialized 20840448 of 31457280 bytes: Disc quota exceeded
    190. 190. To see all properties: </li><ul><li>zfs get mypool/home/jorge </li></ul></ul></ul>
    191. 191. ZFS Basics <ul><li>Want to use OpenSolaris as a storage server ? </li><ul><li>zfs create mypool/nfsshare
    192. 192. zfs set sharenfs=on mypool/nfsshare
    193. 193. zfs get sharenfs mypool/nfsshare </li></ul><li>Happy Sharing !! </li></ul>
    194. 194. ZFS Basics <ul><li>Want to use OpenSolaris as a storage server ? </li><ul><li>pkg install SUNWsmbs (might be necessary to reboot)
    195. 195. svcadm enable -r smb/server
    196. 196. zfs create -o casesensitivity=mixed mypool/cifsshare
    197. 197. zfs set sharesmb=on mypool/cifsshare
    198. 198. zfs get sharesmb mypool/cifsshare
    199. 199. sharemgr show -vp </li></ul><li>Happy Sharing !! </li><ul><li>Note: if working with, and connecting from certain Windows workgroups, there are a few more steps. Check out the How to Guide ! </li></ul></ul>
    200. 200. DTrace <ul><li>Tool to observe and understand dynamic behavior of entire software system
    201. 201. Fundamentally different from previous tools </li><ul><li>Software does not have to be instrumented or explicitly built for monitoring
    202. 202. Safe for use on live production systems
    203. 203. No overhead until probes are enabled, and then only minimal overhead </li></ul><li>Includes programming language (“D”) for expressing variety of tracing behavior </li><ul><ul><li>Not super simple, but many free scripts, some C-like elements </li></ul></ul></ul>
    204. 204. DTrace <ul><li>Let's check what's available: </li><ul><li>pfexec su -
    205. 205. dtrace -l | more
    206. 206. dtrace -l | wc -l </li></ul><li>Create a file call syscall.d </li><ul><ul><li>syscall:::entry
    207. 207. {
    208. 208. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    209. 209. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul>
    210. 210. DTrace <ul><li>Let's check what's available: </li><ul><li>pfexec su -
    211. 211. dtrace -l | more
    212. 212. dtrace -l | wc -l </li></ul><li>Create a file call syscall.d </li><ul><ul><li>syscall:::entry
    213. 213. {
    214. 214. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    215. 215. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul><ul><li>Not interested in Xorg calls ? Modify file: </li><ul><ul><li>syscall:::entry
    216. 216. /execname != “Xorg”/
    217. 217. {
    218. 218. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    219. 219. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul>
    220. 220. DTrace <ul><li>Not interested in Xorg calls ? Modify file: </li><ul><ul><li>syscall:::entry
    221. 221. /execname != “Xorg”/
    222. 222. {
    223. 223. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    224. 224. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul><ul><li>Also not interested in dtrace calls ? Modify file: </li><ul><ul><li>syscall:::entry
    225. 225. /execname != “Xorg” && execname != “dtrace”/
    226. 226. {
    227. 227. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    228. 228. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul>
    229. 229. DTrace <ul><li>Only interested in calls by firefox ? Modify file: </li><ul><ul><li>syscall:::entry
    230. 230. /execname == “firefox-bin”/
    231. 231. {
    232. 232. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    233. 233. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul><ul><li>Also not interested in dtrace calls ? Modify file: </li><ul><ul><li>syscall:::entry
    234. 234. /execname != “Xorg” && execname != “dtrace”/
    235. 235. {
    236. 236. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    237. 237. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul>
    238. 238. DTrace <ul><li>Only interested in calls by firefox ? Modify file: </li><ul><ul><li>syscall:::entry
    239. 239. /execname == “firefox-bin”/
    240. 240. {
    241. 241. printf(&quot;%s(%d) called %s &quot;, execname, pid, probefunc);
    242. 242. } </li></ul></ul><li>Execute the file with: </li><ul><ul><li>dtrace -qs syscall.d </li></ul></ul></ul><ul><li>So you already understand some very bascis !
    243. 243. But what did the dtrace -l output actually mean ? </li><ul><li>Dtrace uses 'Probes'
    244. 244. Probes are instrumentation points </li><ul><li>Think of them as 'sensors' on your system, at any touch point of software (kernel, OS, applications, code, etc.) </li></ul><li>The names are a four-tuple: provider:module:function:name
    245. 245. Examples: </li><ul><li>fbt:zfs:zfs_create_unique_device:entry
    246. 246. fbt:zfs:zfs_create_unique_device:return </li></ul></ul></ul>
    247. 247. DTrace <ul><li>provider:module:function:name means:
    248. 248. Provider A library of related probes.
    249. 249. Module The module the function belongs to, either a kernel module or user segment.
    250. 250. Function The function name that contains the probe.
    251. 251. Name The name of the probe. </li></ul>
    252. 252. DTrace <ul><li>There a many D scripts, information, and tutorials out there !
    253. 253. Very good starting point: </li><ul><li>http://www.opensolaris.org/os/community/dtrace/ </li></ul></ul>
    254. 254. Network Virtualization <ul><li>Network virtualization (Project “Crossbow”) </li><ul><li>Enable Open Networking </li></ul></ul><ul><ul><li>Bandwith Control </li><ul><li>Down to the protocol and port level </li></ul><li>Virtual Wire – virtualize everything </li></ul></ul><ul><ul><ul><li>NICs, Firewall, Switches, Routers </li></ul><li>Don't run out of physical NICs anymore ! </li></ul></ul>
    255. 255. Project Crossbow
    256. 256. Project Crossbow
    257. 257. Network Virtualization <ul><li>A great 'Getting Started Guide': </li></ul><ul>http://www.sun.com/bigadmin/features/articles/crossbow_net_virt.pdf </ul>
    258. 258. Network Virtualization <ul><li>Let's create a VNIC, and then a zone with exclusive IP stack (to use dhcp): </li></ul><ul><ul><li>dladm show-link (check your physical NIC – in this example, we have e1000g0)
    259. 259. dladm create-vnic -l e1000g0 zonenic1
    260. 260. dladm show-link
    261. 261. dladm show-vnic (notice also the randomly assigned MAC address)
    262. 262. ifconfig zonenic1 plumb
    263. 263. ifconfig -a </li></ul></ul>
    264. 264. Network Virtualization <ul><li>Let's see if we can get a dhcp address: </li></ul><ul><ul><li>ifconfig zonenic1 dhcp
    265. 265. ifconfig -a
    266. 266. ifconfig zonenic1 unplumb
    267. 267. ifconfig -a </li></ul><li>Let's create a filesystem for our zone(s): </li><ul><li>zfs create rpool/export/zones
    268. 268. zfs list </li></ul></ul>
    269. 269. Network Virtualization <ul><li>Let's create a zone ! </li></ul><ul><ul><li># zonecfg -z zone1
    270. 270. zone1: No such zone configured
    271. 271. Use 'create' to begin configuring a new zone.
    272. 272. zonecfg:zone1> create
    273. 273. zonecfg:zone1> set zonepath=/export/zones/zone1
    274. 274. zonecfg:zone1> set autoboot=false
    275. 275. zonecfg:zone1> set ip-type=exclusive
    276. 276. zonecfg:zone1> add net
    277. 277. zonecfg:zone1:net> set physical= zonenic1
    278. 278. zonecfg:zone1:net> end
    279. 279. zonecfg:zone1> verify
    280. 280. zonecfg:zone1> commit
    281. 281. zonecfg:zone1> exit </li></ul></ul>
    282. 282. Network Virtualization <ul><li>Let's install and boot the zone: </li></ul><ul><ul><li>zoneadm -z zone1 install (note: this might take a while, as it will fetch the OpenSolaris image from the /release repository !)
    283. 283. zoneadm -z zone1 boot
    284. 284. zlogin -C zone1 (to get console access to the booting zone)
    285. 285. Go through the few installation steps
    286. 286. You might then have to configure it to use dhcp:
    287. 287. touch /etc/dhcp.zonenic1
    288. 288. Delete hostname entry in /etc/hosts </li></ul></ul>
    289. 289. Network Virtualization <ul><ul><li>reboot (check out how fast a zone reboots !)
    290. 290. zlogin zone1 (from the global zone)
    291. 291. To monitor the virtual network interface: </li><ul><li>netstat -a -I zonenic1 5 </li></ul></ul><li>You just created a new 'virtual machine' on your laptop !! </li></ul>
    292. 292. OpenSolaris Books
    293. 293. opensolaris.org & opensolaris.com
    294. 294. OpenSolaris Unlocks Your Potential OpenSolaris: Get it. Use it. Learn it. opensolaris.com/get
    295. 295. OpenSolaris 2009.06 A Workshop for some key Technologies ? ? ? ? ? ? ? ? ? ? Markus Weber Sun Microsystems, Inc. Iban Nieto OpenSolaris Community
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×