d61772gc11_toc

8
Sun Virtualization: Solaris 10 Containers Adm inis tration Student Guide SA-355-S10 Rev A.1 D61772GC11 Edition 1.1 D65087

Upload: hosnitmi

Post on 02-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 1/8

Sun Virtualization: Solaris

10 Containers Adminis tration

Student Guide

SA-355-S10 Rev A.1

D61772GC11

Edition 1.1

D65087

Page 2: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 2/8

Copyright © 2009, 2010, Oracle and/or its affiliates. All r ights reserved.

Disclaimer

This document contains proprietary information, is provided under a license agreement containing restrictions on use anddisclosure, and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except as expresslypermitted in your license agreement or allowed by law, you may not use, share, download, upload, copy, print, display,perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the expressauthorization of Oracle.

The information contained in this document is subject to change without notice. If you find any problems in the document,please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. Thisdocument is not warranted to be error-free.

Sun Microsyst ems, Inc. Disclaimer

This training manual may include references to materials, offerings, or products that were previously offered by SunMicrosystems, Inc. Certain materials, offerings, services, or products may no longer be offered or provided.Oracle and itsaffiliates cannot be held responsible for any such references should they appear in the text provided.

Restricted Rights Notice

If this documentation is delivered to the U.S. Government or anyone using the documentation on behalf of the U.S.Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTSThe U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials arerestricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.

Trademark Notic e

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respectiveowners.

AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced MicroDevices. Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are usedunder license and are trademarks or registered trademarks of SPARC International, Inc. UNIX is a registered trademarklicensed through X/Open Company, Ltd.

Page 3: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 3/8

viiCopyright2009 Sun Microsystems,Inc. All Rights Reserved.Sun Services, RevisionA.1

Table of ContentsAbout This Course .................................................................Preface-i

Course Goals............................................................................ Preface-iTopics Not Covered...............................................................Preface-iiiHow Prepared Are You?.......................................................Preface-ivIntroductions ...........................................................................Preface-vHow to Use Course Materials .............................................. Preface-viConventions...........................................................................Preface-vii

Typographical Conventions........................................ Preface-ixAdditional Conventions................................................ Preface-x

Virtualization Trends in the Datacenter ..........................................1-1Objectives ........................................................................................... 1-1Additional Resources ........................................................................ 1-2Introduction to Server Virtualization.............................................. 1-3

What is Server Virtualization.................................................. 1-4Virtualization Benefits: the Dynamic Datacenter.......................... 1-6Virtualization Technologies by Sun Microsystems....................... 1-8

Describing Solaris™ Zones and Containers..................................2-1Objectives ........................................................................................... 2-1Additional Resources ........................................................................ 2-2Solaris Zones....................................................................................... 2-3

Zone Features ............................................................................ 2-5When to Use Solaris Zones...................................................... 2-6Solaris Zones and Solaris Containers.................................. 2-13Guidelines for Deploying Solaris Containers ..................... 2-13

Zone Concepts.................................................................................. 2-16Zone Types............................................................................... 2-16Zone Daemons........................................................................ 2-19Zone Models ........................................................................... 2-20Zone Networking................................................................... 2-23Zone States ............................................................................... 2-24

Creating, Installing and Booting Zones..........................................3-1

Page 4: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 4/8

viii Sun Vir tualization: Solaris™ 10 Containers AdministrationCopyright 2009 Sun Microsystems, Inc.All Rights Reserved. Sun Services, Revision A.1

Objectives ........................................................................................... 3-1Additional Resources ........................................................................ 3-2Configuring Zones............................................................................. 3-3Using the zonecfg Command to Configure Zones...................... 3-4

Identifying the zonecfg Command Scope .......................... 3-4

Using zonecfg

Subcommands ............................................. 3-5Using zonecfg Resource and Property Parameters ............ 3-6Zone Configuration Walk-Through .................................... 3-12Viewing the Zone Configuration......................................... 3-16Exporting the Zone Configuration....................................... 3-17

Using the zoneadm Command ....................................................... 3-19Verifying a Configured Zone ................................................ 3-19Installing a Configured Zone ................................................ 3-20Booting a Zone......................................................................... 3-20Rebooting a Zone .................................................................... 3-21Halting a Zone......................................................................... 3-21

Using the zlogin Command ......................................................... 3-22Modes of Operation................................................................ 3-22Logging In to the Zone’s Virtual Console – First Time ..... 3-23Using Failsafe Mode to Access a Zone................................. 3-24Using the init Command..................................................... 3-25Using the shutdown Command............................................ 3-25

Using an /etc/sysidcfg File to Perform Initial Zone SystemIdentification.................................................................................. 3-26

Connecting Storage to Zones......................................................... 4-1Objectives ........................................................................................... 4-1Additional Resources ........................................................................ 4-2Storage in Non-Global Zones........................................................... 4-3

Direct Attached Storage, Network Attached Storage, andStorage Area Networks......................................................... 4-3

Assigning File Systems to Zones ..................................................... 4-4Unmounting File Systems from Zones .................................. 4-5Working With Loopback File Systems (LOFS) ..................... 4-6Working With Solaris ZFS File Systems ................................ 4-8Working With UNIX® File Systems..................................... 4-10Working With Network File Systems .................................. 4-11

Security Restrictions and File System Behavior .......................... 4-12Additional File System Considerations........................................ 4-15

Accessing Direct Devices ....................................................... 4-15Using the -o nosuid Option ............................................... 4-16Mounting Read-Only File Systems....................................... 4-16Sharing File Systems............................................................... 4-16

Managing Packages and Patches Within Zones........................... 5-1Objectives ........................................................................................... 5-1Additional Resources ........................................................................ 5-2

Page 5: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 5/8

ixCopyright2009 Sun Microsystems,Inc. All Rights Reserved.Sun Services, RevisionA.1

Package Management and Solaris Zones Technology ................. 5-3How Zone State Affects Package Operations ....................... 5-4Package Parameters for Zones ................................................ 5-5

Adding Packages in Zones ............................................................. 5-10Using pkgadd in the Global Zone......................................... 5-10

Using pkgadd

in a Non-Global Zone ................................... 5-14Removing Packages from Zones.................................................... 5-15Using pkgrm in the Global Zone.......................................... 5-15Using pkgrm in a Non-Global Zone .................................... 5-17

Adding Patches in Zones ................................................................ 5-18Using patchadd in the Global Zone .................................... 5-18Using Parallel Patching to Reduce Patching Time............. 5-21Using patchadd in a Non-Global Zone............................... 5-22

Removing Patches from Zones ...................................................... 5-24Using patchrm in the Global Zone....................................... 5-24Using patchrm in a Non-Global Zone ................................. 5-24

Upgrading Systems With Non-Global Zones Installed.............. 5-25Configuring Persistent Resource Pools.........................................6-1

Objectives ........................................................................................... 6-1Additional Resources ........................................................................ 6-2Introducing Resource Management................................................ 6-3

Resource Containment ............................................................. 6-3Resource Management Control Mechanisms ....................... 6-4Managing Workloads............................................................... 6-5Defining Workloads ................................................................. 6-6

Introducing Resource Pools.............................................................. 6-8When to Use Resource Pools.................................................. 6-9

Resource Pools Framework ............................................................ 6-11The Pool Daemon.................................................................... 6-12The /etc/pooladm.conf Configuration File..................... 6-13

Implementing Pools on a System .................................................. 6-15Configuring Resource Pools........................................................... 6-16

Enabling and Disabling the Resource Pools Service.......... 6-16Configuring Pools ................................................................... 6-18Moving CPUs Between Processor Sets ............................... 6-28Validate a Configuration........................................................ 6-28Binding to a Resource Pool................................................... 6-29Monitoring Statistics for Pool-Related Resources ............. 6-31Remove a Pools Configuration ............................................. 6-32

Configuring Resource Management With Zones ..........................7-1Objectives ........................................................................................... 7-1Additional Resources ........................................................................ 7-2Introducing Resource Management With Zones .......................... 7-3

Enhancing Solaris Containers With Newer Solaris 10 FeaturesUsed With zonecfg................................................................. 7-3

Page 6: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 6/8

x Sun Virtualization: S olaris™ 10 Containers AdministrationCopyright 2009 Sun Microsystems, Inc.All Rights Reserved. Sun Services, Revision A.1

Managing Scheduling Classes and the Fair Share Scheduler...... 7-5Describing CPU Shares ............................................................ 7-6Combining FSS With Other Scheduling Classes .................. 7-7 Configuring FSS .............................................................. 7-10

Configuring CPU Shares for Zones............................................... 7-14

Using the cpu-shares

Zone Property................................. 7-14Using prctl to Configure CPU Shares................................ 7-18Monitoring the Effect of CPU Shares Using prstat ........ 7-19

Configuring Temporary Resource Pools ...................................... 7-20Using the dedicated-cpu Zone Resource.......................... 7-20Displaying Temporary Resource Pool Configurations .... 7-23

Configuring the capped-cpu Resource for Zones ....................... 7-26Configuring Memory Capping for Zones .................................... 7-27

How Resource Capping Works ............................................ 7-27Resource Capping Guidelines.............................................. 7-28Enabling and Disabling the rcap Service............................ 7-29

Using zonecfg to Configure Memory Caps ....................... 7-30Using rcapadm to Configure Memory Caps ....................... 7-31Monitoring the Effect of Memory Caps Using rcapstat .7-31Setting the Memory Cap Enforcement Threshold ............. 7-32

Performing Zone Advanced Network Management...................... 8-1Objectives ........................................................................................... 8-1Additional Resources ........................................................................ 8-2Introducing IPMP .............................................................................. 8-3Using IPMP on a System With Zones Installed............................. 8-5

IPMP in Shared-IP Zones......................................................... 8-5IPMP in Exclusive-IP Non-Global Zones ........................... 8-13

Renaming, Moving, Cloning, and Migrating Zones ...................... 9-1Objectives ........................................................................................... 9-1Additional Resources ........................................................................ 9-2Renaming a Zone ............................................................................... 9-3Moving a Zone ................................................................................... 9-4Cloning a Zone ................................................................................... 9-5

Clone a Zone.............................................................................. 9-5Migrating a Zone................................................................................ 9-8

Migrate a Non-Global Zone .................................................... 9-9How to Validate a Zone Migration Before the Migration Is

Performed.............................................................................. 9-11Performing Zone Backups and Restores .................................... 10-1

Objectives ......................................................................................... 10-1Additional Resources ...................................................................... 10-2Creating Backups on Systems With Installed Zones .................. 10-3

Relating Non-Global Zone Configurations to Backup andRecovery Requirements ...................................................... 10-3

Page 7: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 7/8

xiCopyright2009 Sun Microsystems,Inc. All Rights Reserved.Sun Services, RevisionA.1

Making Zone Backups From the Global Zone.................... 10-7Making Backups From Within a Non-Global Zone......... 10-11Backing Up Loopback File System Directories................. 10-11Saving and Restoring Non-Global Zone Configuration

Information ......................................................................... 10-12

Recovering Individual Non-Global Zones........................ 10-13Configuring the lx Branded Zone.................................................11-1

Objectives ......................................................................................... 11-1Additional Resources ...................................................................... 11-2Branded Zones Technology............................................................ 11-3

Linux Distribution Support .................................................. 11-4Planning the lx Branded Zone Configuration ............................ 11-5

System and Space Requirements.......................................... 11-5Branded Zone Network Address ......................................... 11-6Managing the lx Branded Zone Resources ........................ 11-6Determining the Zone Name and Zone Path...................... 11-6

Configuring the lx Branded Zone................................................. 11-8Configuring the lx Branded Zone Walk-Through ............ 11-8Displaying the Configuration of a Branded Zone............ 11-10

Installing the lx Branded Zone.................................................... 11-12Obtaining the Linux Archives............................................ 11-13lx Branded Zone Software Installation Walk-Through.. 11-14

Booting the lx Branded Zone ...................................................... 11-16Boot an lx Branded Zone .................................................... 11-16Enable Networking in an lx Branded Zone ..................... 11-17

Administering Applications in lx Branded Zones................... 11-18

IPMP Overview.................................................................................A-1Objective............................................................................................ A-1Introducing IPMP .................................................................... A-1Probe-Based IPMP ................................................................... A-2Configuring Probe-Based IPMP Using the Command Line.....

A-4Link-Based IPMP Configuration......................................... A-10Configuring Link-Based IPMP Using Files........................ A-10

Page 8: D61772GC11_TOC

8/10/2019 D61772GC11_TOC

http://slidepdf.com/reader/full/d61772gc11toc 8/8